Friday, July 17, 2009

External Stylesheets issue in Telerik Reporting

Situation:
I was able to create an stylesheet, exported into an xml file and then referenced it into another report and even though I could see the styles in the designer, when I run my project the styles simply disappeared.

Solution 1:
In the page where the report is called add the following code (replace the path properly):


Dim ess As New Telerik.Reporting.Drawing.ExternalStyleSheet("..\StyleSheets\TahomaSmall.xml")
myReport.ExternalStyleSheets.Add(ess)
Me.ReportViewer1.Report = myReport


Solution 2:
Replace the path properly in the rpt.designer.vb
Me.ExternalStyleSheets.Add(New Telerik.Reporting.Drawing.ExternalStyleSheet("..\StyleSheets\TahomaSmall.xml"))


Issue cause:
Even though the report has a reference to the external stylesheet in its vb code if your report is not in the same directory as your stylesheet it has to be estated like that in the reference.

No comments:

Post a Comment