Wednesday, February 15, 2012

Empty page 1 on short reports?

I have a suite of several SSRS reports that differ essentially on the stored procedure called. All have very the same one-page header block and all have a footer. Those where a large number of pages are produced, page without fault when printed or converted to PDF.

Two page reports often break down on printing, so that page 1 only has the header and a footer and all the detail lines are printed on page2 (together with the footer). However on the screen the report paged correctly.

I have checked all the obvious problems such as page dimensions exceeding that of the print medium. (A series of such problems was fixed earlier in development.)

I have observed this behaviour with SQL2005 SP1 and SP2 (i.e. SP2 did not provide any fix in this area). The host OS for development and production is Windows 2003 server. The tests were done by viewing in IE6 and the fault only became apparent when going to print preview, printing or in PDF production.

This has the appearance of a bug in SSRS hereby intermediate length reports are not handled correctly. It appears to happen when the amount of detail lines just fills page 2. As soon as the report has sufficient lines to be 3 pages long (page 1 is header plus some details lines plus footer, page 2 is full of detail lines plus footer and page 3 is remaining detail lines plus footer then the problem is no longer seen! Where the detail lines will all fit on page 1, then the problem is not seen.

I observe this variation in behaviour since I am able to switch between different sized datasets and thus switch between the different scenarios described above. I should also note that the reports are in landscape mode.

This behaviour has since been reproduced in a test scenario. There is one detail missing from the above scenario - instead of printing each record from the dataset, the records were (unneccessarily) grouped. The grouping was unncessary insofar as the table the program reports from is already grouped.|||

Further testing has show some rather odd behaviour. Using a test system I have arranged that I can readily select for the report a dataset with from 1 to 100 records.

The following tests are for running the report, bringing up the print dialog and going to the print preview. (I have previously established that the print behaviour is the same as the print preview behavious in respect to the blank first page problem.

With from 1 to 15 records it prints the first page heading, detail lines and a footer. This is expected behaviour.

From 23 to 40 records it prints the first page heading, detail lines, a footer, new page, detail lines and a footer. This is expected behaviour

From 41 records it prints the first page heading, detail lines, a footer, new page, detail lines, a footer, new page, details line(s) and a footer. This is expected behaviour.

However from 16 to 22 records it prints the first page heading, a footer, new page, detail lines and a footer. This is unexpected behaviour as details should be printed on both page 1 and page 2.

I have repeated the test with a report that just prints details lines as opposed to grouping then and this anomalous behaviour does not occur.

|||

Have you set the KeepTogether property of your table to true?

Shyam

No comments:

Post a Comment