This is a migrated thread and some comments may be shown as answers.

Export to PDF programmatically Lost Background

1 Answer 48 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Cory asked on 23 May 2013, 02:44 PM
Hello all,

I have a report that contains a chart.  In the chart plot area, I set the background image using relative path (~/Image/myimage.png). Everything works as expected using ReportViewer on page.  The problem I have is when I export the report to pdf format programmatically, the chart background is not set.

Here is how I export it.

   public Stream GetReportBytes(Guid studyId, string userName)
            ReportProcessor reportProcessor = new ReportProcessor();
            Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource();
            ProjectReport reportToExport = new ProjectReport();           
            reportToExport.ReportParameters[0].Value = studyId.ToString();
            reportToExport.ReportParameters[1].Value = userName;
            instanceReportSource.ReportDocument = reportToExport;
            RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, null);
            return new MemoryStream(result.DocumentBytes);           

And background image is set like this

MainChart.PlotArea.Appearance.FillStyle.FillSettings.BackgroundImage = "~/Images/ci_bg.png";

Please advice.


1 Answer, 1 is accepted

Sort by
Telerik team
answered on 28 May 2013, 04:40 PM
Hello Cory,

Please double-check how the relative path used to set the background image is resolved. In case the report definition is in the web application the relative path will be resolved based on the same root. If you need additional assistance please send us a sample runnable project to debug on our side.

I hope this helps.


Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

General Discussions
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question