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.
Unfortunately, activation email could not send to your email. Please try again.

ReportWriter chart issue when trying to export PDF

Thread ID:

Created:

Updated:

Platform:

Replies:

129234 Mar 6,2017 11:08 AM Mar 23,2017 08:37 AM WPF 9
loading
Tags: ReportWriter
Alexandru Pastor Opris
Asked On March 6, 2017 11:08 AM

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,
Alexandru.

Attachment: ReportingSample_c697261c.rar

Vinoth Srinivasan [Syncfusion]
Replied On March 7, 2017 08:26 AM

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.  
 
Regards, 
Vinoth S. 


Alexandru Pastor Opris
Replied On March 8, 2017 05:25 AM

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,
Alexandru.

Vinoth Srinivasan [Syncfusion]
Replied On March 9, 2017 07:44 AM

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. 

Regards,   
Vinoth S. 


Alexandru Pastor Opris
Replied On March 10, 2017 04:42 AM

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,
Alexandru.

Attachment: SyncfusionReports_d5c78cb9.rar

Vinoth Srinivasan [Syncfusion]
Replied On March 13, 2017 08:54 AM

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. 

Regards, 
Vinoth S. 


Alexandru Pastor Opris
Replied On March 13, 2017 10:22 AM

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,
Alexandru.

Vinoth Srinivasan [Syncfusion]
Replied On March 17, 2017 01:12 AM

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. 

Regards, 
Vinoth S. 


Alexandru Pastor Opris
Replied On March 22, 2017 01:00 PM

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,
Alexandru.

Vinoth Srinivasan [Syncfusion]
Replied On March 23, 2017 08:37 AM

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. 
 
Regards, 
Vinoth S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;