Search code examples
c#asp.netreporting-servicescrystal-reports

Displaying existing Crystal Report in asp.net rendering odd chart output


I have been given the task of taking Crystal Reports developed with the standalone version of SAP Crystal Reports (2013 SP 2 version 14.1.2.1121) and figuring out a way to deploy them without use of Crystal Reports Server. The data connection is already stored in the report so all I have to do is load the rpt file, pass in a parameter, and display the results.

I thought I could accomplish this in an asp.net application. I am using the following code to export straight to pdf so I don't have to deal with Visual Studio's crystal report viewer:

report.Load(Server.MapPath("CrystalReport1.rpt"));
report.SetParameterValue("Quarter End Date", parmDate);
report.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, "Report1");

This method works fine for all reports expect for two that contain a chart type of 'Date axis line chart'. When I run these reports through my web app the data fields match up exactly with the original report, but the charts are displaying wrong.

I have included two images below. The top is the proper rendering and the bottom is the rendering when running the report through my code.

good chart bad chart I also tried to recreate the report from scratch in Visual Studio and, although the chart data was a little better, it was still off: enter image description here As I stated earlier, the report was given to me already completed. The question was could I could figure out a way to allow users to run it on demand supplying their own parameter from a browser without having to buy Crystal Report Server or some other tool.

There is another report that has a pie chart and it looks fine. Does anything have an idea of why this might be occurring?

Thank you.


Solution

  • Ultimately we had to downgrade the version these reports were created with to Crystal Reports 11.5. After that the charts rendered correctly.