Print Page | Close Window

styles not applied when exporting to PDF

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=5471
Printed Date: 17 Apr 2025 at 12:21pm


Topic: styles not applied when exporting to PDF
Posted By: babuk
Subject: styles not applied when exporting to PDF
Date Posted: 10 Feb 2009 at 2:33am
Hi,

When I apply style to report it is visible in the html page. But when I export the report to PDF, Word, Excel it is not available. How can I?


    private ReportDocument rd;

    protected void Page_Load(object sender, EventArgs e)
    {
        rd = new ReportDocument ();

        rd.Load(Server.MapPath("CrystalReport.rpt"));

        rd.SetCssClass(ObjectScope.DetailSections, "DetailSections");
        rd.SetCssClass(ObjectScope.PageHeaderSections, "PageHeaderSections");

        crystalReportViewer.ReportSource = rd;
    }


    <style type = "text/css">
    .DetailSections
    {
     color:red;font-family:Arial;
     font-weight:bold;
     background-color:#e2e2e2;
     border:Solid 10px #ffffff;
   
    }
    .PageHeaderSections
    {
     font-family:Arial;    
     background-color:#e2e2e2;
     border:Solid 10px #ffffff;
   
    }
    </style>


Thanks,
Babu Kumarasamy.



Print Page | Close Window