MS Report Viewer Displaying Single Page - c#

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

Related

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

Formatting Visual Studio C# Reports at runtime

I asked a similar question yesterday. I have a large MS Access application that I want to convert into C#. On the whole I'm doing ok, but it's become apparent to me that I've got problems when formatting reports. Yesterday I was asking about changing a report title at runtime. I came up with a workaround for that. However, MS Access allows you at runtime to create, move, hide, reveal and resize report controls. In particular, my MS Access application constructs barcodes in reports at runtime. In the report I have an array of lines that my code places and resizes in order to construct the barcode. As far as I can see, this is completely impossible in a Visual Studio report. Do I have any options here? For instance are there any competent 3rd party solutions?
You have a couple of options.
You can use a 3rd party custom report item like Aspose Barcode for Reporting Services.
You can dynamically generate an image with embedded code.
Note: I've never attempted the 2nd option, but it seems like it has potential to be an easy way to dynamically generate images for a report...

Page Break in C# Crystal Reports

In my C# .Net windows application am using crystal reports to print employee information.Am using Roll Paper (A4) for printing purpose.Here when i print the report,its working fine.My issue is that if the table contains only one row of record,it takes the whole page to print there is no page break. ,i mean the whole A4 paper to print the report.But i need only a small portion of the same.How to put page break and remove the white blank space after the report. .
I understand your problem.it is not a one sided problem even if the records are more than A4 page capacity then your print will not be printed in single piece.
Crystal Report does not support dynamic paper size and roll printing does not have fixed paper height. so, using crystal report you could not place page break at the end of your report data.
You have to create your code to print your report if the report structure is not complicated. I don't know much about microsoft reporting tool. i think microsoft reporting tool may help you.

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

Categories