Displaying ReportViewer Report on One Page - reportviewer

I'm running ASP.NET/C# 3.5 with ReportViewer 2005. I'm having an issue where part of the data that gets spit out by the report gets split into pages one and two. The trouble is that most people don't notice pagination in the ReportViewer (I didn't even notice it myself for a while).
Is there a way to restrict ReportViewer so that the report gets displayed on one page only?

A workaround I've found was selecting the "Report" in design view and setting the Interactive Height/Width properties. I adjusted the height to 20 inches instead of the default 11 inches.

Related

Label printer starts printing blank pages in large jobs

I'm running into an extremely strange issue that a user of mine is reporting:
A Crystal Reports report is printing blank pages past a certain point. My troubleshooting has sort of narrowed down the culprit, but at the same time, has displayed some inconsistent results.
Here's the lowdown:
The application is a VB.NET application, using .NET 4.
There are multiple Crystal Report reports embedded in the solution, and a single form is used to display and print any report.
Which report to display is handled through the code backend, and assigned to the form's CrystalReportViewer object before showing the form.
For the problem report, the datasource comes from a SQL query run in the code, and then assigned as the report's datasource, and then the report is assigned as the reportsource for the CRV object in the form.
The label printer is attached via USB to the computer in question, with the installer used to provide the drivers.
If it matters, it's a Citizen CLP-7201e label printer.
The code that assigns the datasource to the report is as follow:
myCommand = New SqlClient.SqlCommand(strSQL, conPlanning)
myCommand.ExecuteNonQuery()
Da = New SqlClient.SqlDataAdapter(myCommand)
Da.Fill(dsData, "TempPrintLabels")
rptPrintLabels.SetDataSource(dsData.Tables(0))
rptPrintLabels.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Portrait
frmReports.rptViewer.ReportSource = rptPrintLabels
frmReports.Show()
strSQL is a basic SQL statement, based on which report is selected from this particular form. The report's SQL query is, SELECT * FROM TempPrintLabels.
There's the basic info. The report generates fine, and for reports with ~100 labels, it prints fine. The strangeness happens when the report exceeds that limit; it's somewhere in the 95-120 label range. It doesn't seem to be consistent. The report will print, up until it hits that certain point. At that time, it will print nothing but blanks for the rest of the report. There will be as many blanks as there are supposed to be remaining pages. If you start the job again at the point where the blanks started, though, it prints fine.
When I look at this report in the CrystalReportViewer, it looks fine; all the labels render properly. When I print it to a PDF or text file printer, all the pages are there. So the report and print generation seems to be working to me.
I thought it was the printer. To test that, I printed a 185 page job to PDF, and then printed that to the printer. That printed absolutely fine.
I'm at a loss to explain this, or even diagnose this further. There is no code in the form for printing; it uses the CrystalReportViewer object to handle everything. If it was this CRV object, the printing to PDF should've given me blank pages. It didn't. If it was the printer, it should have started printing blanks from the PDF right around the same point as printing directly from the CRV object did. It didn't.
What else can I look for?
For this question, I have some thoughts which causes this behavior while printing.
It may the width issue of your all label's length exceeds from the page size. So you can check all the labels and pages are not blank when you shrink the width of labels (even labels not show properly, we can handle separately). If it shows not (as currently you getting), then you just handle labels width by "Can grow" option to true for all labels.
If everything fine, then I think you can check your printer's page setting / margin.
If above is not work, then either create new report or existing report with just adding static labels and values and then first preview and then call from code. Something you find with this.
As per my experience(I may be wrong in this case), whenever blank page comes in crystal report when your columns will increase, the report's width create an issue. So either set report width to decrease or set printer page bigger. So it print, other wise it not throw error, but give blank pages.

SSRS 2008 - Multiple report page discrepancies when exporting to pdf

I am creating a report using SSRS 2008 consisting of a page with a single tablix, a header, and a footer. As far as I'm concern, the report itself isn't that complex. But when I tried to export it to PDF format for printing, several issues ensue:
When using the expression ="Page " & Globals!PageNumber & " of " & Globals!TotalPages in a textbox in the header, the displayed TotalPage number is not equal to the actual total pages in the report.
The pages after the printed TotalPages in the report does not display the page header and footer anymore. For example the actual total page number of the report is 50 but whats printed in the header is Page x of 42; after page 42, the pages does not display the Header and Footer anymore
The tablix applies pagebreaks at random pages eventhough there is no pagebreak condition to any group in the tablix nor on the tablix itself causing half of the page to be blank and the continuation is on the next page.
Does anyone know any fix or workaround on these issues? I've searched high and low on the internet on how to fix these issues but I always arrive at dead end. Please leave comments that you think can help, it will be greatly appreciated. Thanks!
I've helped solve a similar problem a few weeks ago.
Sometimes, any errors in expressions or custom code has side-effects that cascades into the report layout (sometimes causing pagination anomalies, layout issues, etc.). Just check if your expressions are error free, or if there are any scenarios that can cause some expressions or custom code to have errors (like null references, etc).
Also, check if you are calling custom code in a hidden control. From experience with SSRS 2008, custom code inside a hidden control or table row produces side-effects on total page counts, although I've yet to verify if these side effects still happen on newer versions of SSRS (like SSRS 2008 R2).

How do i find the location of a page break in SSRS in RDL source?

I have a report with a page break in it that I want to remove, but I don't know where the break is being added. It could be on a table, a group, or I don't know where else.
I checked the tablix properties and group properties for each portion of the report to see if "add a page break before" or "add a page break after" were checked, but didn't find anything.
Is there something i can search for in the RDL source code that will help?
I usually find this occurs when the item (tablix, chart etc) will fit entirely on a new page but not entirely on the page where the control starts. For example if you have a header on page 1 but not on page 2 or you have a chart before your tablix and the tablix will not fit entirely on Page 1 but will fit entirely on Page 2 it chooses to put the tablix on Page 2 instead of half on Page 1 and half on Page 2.
If this is your issue try placing all elements inside another element (such as a rectangle, list or another tablix).
We would need more information to give a more specific answer. Can you post screens of the pages either side of the elusive page break?
I was exporting to report type Web Archive (MHTML) and the page break was coming from the interactive height of the report. Once I set it to zero I no longer got the page breaks.

RDLC Report showing data on other page if data is more

I have a bill application in winforms using reportviewer and showing rdlc report in it, I have a main report and a subreport in it
now the problem is that when i have less than 40 items it shows the report fine, but if its more than that the data comes from next page, please see the reports and ourput
Main Report
SubReport
Normal display when 25 records
When it is 40 records pg1
Second page
any help will be appriciated
try Unchecking Keep together on one page if possible option in Page break options.
I'm using vs2010, and it looks like you're in 08? so it might be a little different but I'll give it a try (mostly because I am looking for some help as well and I know how frustrating it is using this when there's not a lot of "quality" answers out there for specific problems).
In the subreport rdlc file, make sure that the "PageBreak" property (on the table containing your columns) isn't set to "start." I would just set it to "none."
What I believe that is happening is that it's moving it to the next page because it won't fit on the first page. what you can do to try to get around that is include everything on the main report in a rectangle (in the rectangle, set pagebreak = none, and keeptogether=true [I'm not sure if you actually want keeptogether=true... if it squeezes everything onto one page by resizing it set it to false]).
Hope I helped

Entire Table is pushed to the next page when rendering a SSRS 2005 Report (as .pdf) in SSRS 2008

I have a SSRS 2005 report that I'm rendering in SSRS 2008 as a .pdf. The report contains (among other things) a table that's very simple: header row, details, no footer, no aggregation, no grouping, keep together = false, pageBreakAtStart = false, pageBreakAtEnd = false, repeatHeaderOnNewPage = true. I resized the table to be much narrower than the body of the report just to be sure it wasn't extending beyond the bounds of the report, pushing everything down. But, no matter what I try, if some of the detail rows in that table would need to be pushed to the next page, then the ENTIRE TABLE is pushed to the next page, not just the extra rows.
So my question is: Is there a workaround for this problem, is this a known issue, or is it even possible to get this 2005 report to render properly in 2008?
NOTE: this is related to a question that I previously asked here, and is based on this MSDN forum post started by a coworker. This question is not the same as my previous question, as I'd like to see things work properly in with a 2005 report. If it's not possible, that would be good to know, as it would indicate that we need to upgrade one of our servers to SQL 2008.
Have you tried putting the table inside a rectangle (and check indeed that the table is a child of the rectangle using the Document Outline pane)
Actually, I did exactly the opposite of what is suggested in the other answers here...My table was already inside the rectangle, and it was still shifting to next page. So I removed the rectangle, and it seems to be working without any issues now!
Weird..But may be it all depends on the over all layout of the report or something.
Thanks!
I have faced a few problems in PDF Export and most of them were solved when I placed the Table within a Rectangle. That would be worth trying !
I'm using VS 2005 Report Viewer WinForms control (ver. 8.0.50727.42)
I got similar problem.
The problem occur when I try to put some text before Table (to display as Report header).
By adding this report header, the first page available height is less than others page height.
When the rows of table exceed to fit on the first page but can fit on the second page, the whole table move to second page and the first page leave blank with report header only.
But when the rows of table exceed to fit on first page and also exceed to fit on second page, the table display on the first page as normal.
If first page and other pages have the same available height, the problem not occur.
I think this is effect of KeepTogether option. But I already set it to False.
I try both True/False KeepTogether option, same result. May be KeepTogether option of Table control is not working at all.