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

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.
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:
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.

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

Related

Unit Price in Crystal Report is not matching

I'm working on C# Desktop Application. A crystal report is generated. When I update my unit price. It doens't reflect in my Crystal report.
Database is of SQLite.
Can please someone help me out what the problem is?
In Crystal Reports Designer, under the File menu, the developer of the report probably forgot to turn off 'Save Data with Report'. Either turn it off or DiscardSavedData in code.

MS Report Viewer Displaying Single Page

I'm working on a WinForms program in C# which uses a ReportViewer control to display a fairly large *.rdlc report. The report was recently upgraded to the 2008 version, and now displays what should be 80+ pages as a single page and cuts off the bottom. It only seems to happen on one specific report, though it works fine in print preview and exports to PDF OK.
It may be that the report is just too long?
The only thing I've come across on Google suggested making all the cell KeepTogether properties true, which didn't help.
Open Your .rdlc file
goto Report-->ReportProperties-->Layout
Adjust your height,width,top,bottom

how to print (on printer) table from database using c#

I work on some project that is migrating from vb6 to web (asp.net). I need to print some kind of report - A table from database and number of simple headers with date and time. In vb it was implemented using vsPrinter object. Is there any Class in C# that is similar to this Class in vb6 in its functionality? If there in no such thing in .net, what is the easiest way to do this?
Thanx for assistance!
Remember you are moving to the web so you don't have access to the hardware printer controls. You only have access to what the browser gives you. If you are not doing anything fancy with this you can do one of two things.
Since this is an ASP.NET webpage, simply create a new browser or popup and render your report as html. The user can them choose print from the browser print dialog or you can launch it with some generated javascript.
Use the Microsoft Report and Report Viewer controls is you need more formal report layout. These are available from your toolbox under the category Reporting.
I think the easiest way would be by using any reporting tool, one of the powerfull tools is Crystal reports, just google it an you will find alot of useful tutorial such as:
Creating Crystal Reports using C# with Datasets.
Crystal reports in ASP.NET
You can also find alot of useful threads about it here in SO under Crystal Reports tag, like:
How to use Crystal Reports with ASP.NET?
C# Crystal Reports Tutorial on asp.net?

Crystal Report 11 and C# 2005 Export to PDF issue (Rendering issue, random pages)

I'm working on rewriting a vb6 application in .NET that exports our Crystal Reports to Pdfs on a daily basis. I'm running into an issue when I export to PDF, the report renders properly (2 pages) in a Crystal Report Viewer, but when I export it (either through the viewer or programatically, it turns into a 11 page document, when it should be a 2 page document). I'm not sure if this is something with the report, or if this is something with the Export()... Please help!
[The text of this answer was originally written by Eric]
Figured it out, I went into the Report Explorer and noticed there were a ton of extra fields in the details section that were not actually showing up in the viewer. I removed the extra fields and voila, back to two pages

Generating Reports in C#

I am creating a windows application.
I am now concentrating on the Reporting Module of my Application.
I have two ideas to do this task.
Either through Crystal Reports or using the Windows Forms and placing the Data Grid View.
Can any one suggest me which option should I choose?
Also the report should be able to Export in the Excel and PDF format and even it should be Printable.
I heard from others that Crystal Reports gives some problem at the time of Deployment.
Please suggest me. I am very much confused.
Thanks in advance!
Visual Studio 2005 and later comes with Microsoft Reporting tools that are so nice and, for me, better than Crystal Reports.
Update: You can install the Microsoft Report Viewer Redistributable 2005 or 2008.
Yes, I would advise not to use Crystal Reports (or Crusty Reports as they have unfortunately become known as in my department). We have had a whole load of problems from reports being corrupted and requiring recreating to simply being clunky and slow.
As our applications are being upgraded we are moving over to MS Report Viewer, which is far better. You can export to Excel from the report viewer.
Use SQL Server Reporting Services (SSRS). It gives you all the same functionality as Crystal Reports and will let you do your exports into whatever format you like (pdf, csv, txt, xls, etc.) right out of the box. You may run into some problems when trying to export to xls/csv when you are using embedded tables in your reports but microsoft is supposedly fixing this in the next release.
Try generating your reports in XML. Later you can decide/change which tool/technology you want to use, without doing much modifications. :-)
You should check out DevExpress Reporting controls, they rock, and are very easy to use. They also allow you to print to various formats like PDF, they also come with an end-user designer.
DevExpress Page
I second the Microsoft Reporting tools. I am using them extensively in my WinForm App and so far so good.
You can specify whether they processed remotely or locally before deployment.
Here is a link to get you started --> http://www.packtpub.com/article/creating-report-with-visual-studio-2008
I suggest you Reporting Services (buid with sql server).
you can develop with VS and publish your reports to Report Server.
Recently abandoned Crystal Reports myself
because of the large number of bugs and crashes
in favor of FastReports. They even have a converter that restored my old reports that were built on Crystal

Categories