We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Starting in 2019, the Reporting control is no longer included in Essential Studio. If you're experiencing issues with the Syncfusion Reporting Platform, Report Viewer, Report Designer, or Report Writer, we recommend migrating to Bold Reports, our dedicated reporting platform.

Bold Reports offers a comprehensive suite of tools and features for all your reporting needs, and we will help you make a smooth transition from the discontinued control. Our support team at https://support.boldreports.com/ is here to assist you with any questions or difficulties you may encounter during the migration process.

We thank you for choosing Syncfusion and appreciate your understanding.

ReportWriter chart issue when trying to export PDF

Hello, I don't if this is the right category, I apologize in advance if it's not as it's a library project and not WPF.

Basically what we're trying to do is export a report with a chart to PDF directly via ReportWriter but we're running into some strange issues using Syncfusion V15.1.0.37
I'll try to explain it the best way I can, there's an attached ZIP containing a sample and some explanations. Also we tried this in UWP and we're waiting for the feature, meanwhile we decided to use a library class for this.

On the sample we've 3 projects which are the following:
- ReportingLibrary -> Read below for details
- ReportingWpf -> This is a brand new WPF project without any modifications, just a call to the CreateReport from the Library
- ReportingConsole -> This is a brand new Console project and just the call to CreateReport

Inside the Library project we can find the ReportManager class with a static method "CreateReport", we've added some constants to facilitate the report creation method, via Stream or Path and if we want to print a report with a chart or not.

The issue comes when we try to create a report with a Chart inside of it and doesn't matter if the report is loaded via Stream or path. While running the WPF project, the report is exported successfully and the chart is showing on the PDF. But when we try to run the console project the PDF is corrupt.
After testing this we decided to give it a try without the chart and just a table inside, and we found that both WPF and console could export the PDF without problems.
Is there anything that we could do about this if we want to print a chart without having a WPF project? Right now we have some kind of API where we send a notification about a new created report on the database and then we execute a method just like the one in the sample.

Thanks in advance and have a nice day,

Attachment: ReportingSample_c697261c.rar

9 Replies

VS Vinoth Srinivasan Syncfusion Team March 7, 2017 01:26 PM UTC

Hi Alexandru, 
Thanks for contacting Syncfusion support. 
The problem raised due to threading, when you try to export a UI element using WPF console application, if you make the call from the main thread, you must add the STAThread attribute to the Main method. We have modified your sample based on this and we were able to export the report to PDF with chart report item. The modified sample can be downloaded from the below location. 
Please refer the below MSDN forum for more details regarding UI thread.  
Vinoth S. 

AP Alexandru Pastor Opris March 8, 2017 10:25 AM UTC

Hello Vinoth,

My bad for missing some explanations, that indeed solved the issue which we had with the console project and the sample, so thank you for that.

But we're still having issues when we have a library project and wanting to generate a report with ReportWriter from a library which is on the server side, let me clarify it a little more on the following steps:

1. We've a UWP project application where we insert the basic data which we need to generate the report in a database table,
2. Once everything is successfully done, we send a notification to our server API and tell him to generate that report.
3. When the server receives the notification, we then get the entities from the database which we need for the specific report.
4. Once we've got the data, we start building our PDF report (which remember, its done on the server side) and then save the report.

I hope this is a little more clear and that we could get some solution for this.

Have a nice day and thanks,

VS Vinoth Srinivasan Syncfusion Team March 9, 2017 12:44 PM UTC

Hi Alexandru, 

We have prepared a simple UWP sample for exporting the RDLC report. You can use the same method to export the report through service. The sample can be downloaded from the following location. 

If the above sample does not meet your requirement, then share the sample as per your requirement. It will help us to provide the solution at the earliest. 

Vinoth S. 

AP Alexandru Pastor Opris March 10, 2017 09:42 AM UTC

Hello Vinoth,

Sorry for the delay, thanks for the sample but unfortunately thats not what we needed, I've created a sample just as we use it, hope this helps.

Thanks again and have a nice day / weekend,

Attachment: SyncfusionReports_d5c78cb9.rar

VS Vinoth Srinivasan Syncfusion Team March 13, 2017 12:54 PM UTC

Hi Alexandru, 

We are not able to run the provided sample at our end. could you please update us with a runnable sample. Meanwhile we are modifying the sample to run at our end. 

Vinoth S. 

AP Alexandru Pastor Opris March 13, 2017 02:22 PM UTC

Hello Vinoth,

Does the application compile correctly and then once is running if you press any of the buttons it crashes? If yes, then you need to change the Export Path which you can find in the SyncfusionReports.Library.Reports class, to be more precise the GetExportPath method.

We tried compiling and running it here at our office on 4 different machines and worked without issues if the Export folder existed. If not, it just crashes when pressing any of the buttons.

Hope this was the issue, if not, I would need more info about the problem.

Have a nice day,

VS Vinoth Srinivasan Syncfusion Team March 17, 2017 05:12 AM UTC

Hi Alexandru, 

We have resolved the errors and modified the report path but when it is clicked on the export function, it throws an error “net_http_client_execution_error”. Also, we tried to update the service configuration in the sample by right clicking on the “Connected Services”, but it shows unspecified error, can you give further details on resolving this problem to make your sample run, and it will  help us to provide the solution at the earliest. 

Vinoth S. 

AP Alexandru Pastor Opris March 22, 2017 05:00 PM UTC

Hello Vinoth,

Sorry for the delay, we've been and still are kinda busy, sadly we've tried running the sample on more machines and still ran successfully without issues.

Also we tried to "break" the sample or atleast see if we could get the same exception in one way or another, no success on that for now, we'll keep trying to see if we can get the same exception, we've been searching online for a solution but nothing so far.

We'll try to have a "simplier" sample for you in the next days and see if that solves the issue. Again, sorry for the delay, hopefully maybe you can find a solution for the issue before our new sample.

Thanks and have a nice day,

VS Vinoth Srinivasan Syncfusion Team March 23, 2017 12:37 PM UTC

Hi Alexandru, 
In your shared sample, connected service type is used, so could you please provide details to configure the “Connected Service” or we can run the service project with the provided sample. And, when we try to run the sample the service is not registered in IIS or running stand alone. 
Vinoth S. 

Live Chat Icon For mobile
Up arrow icon