Extra page in Quick Report preview

Extra page in Quick Report preview

Post by PHiL » Thu, 08 Jul 2004 23:13:19


I originally posted a simialar message on
borland.public.cppbuilder.thirdpartytools but, seeing as I have not
gotten a response there and it this seems to be a Quick Reports issue,
I'll repost here. I usually find all my QR answers here anyway...

I am having an issue with Quick Reports v3.0.5 and Builder v5.0 Build
12.34 Update Pack 1.

Essentially, on rare occasions, a report is printed that is "missing"
the last page. If the report is previewed before printing, it has 4
pages. Page 4 does not contain any data. The header, footer, and all
other "static" information is displayed. The last page states "page 4 of 4".

When printed directly or via the preview window, the 4th page doesn't
print at all. We get "page 1 of 4", "page 2 of 4", and "page 3 of 4" but
no "page 4 of 4". This happens on every printer we tried it on - various
HPs, Cannons, Lexmarks, and even to .pdf.

The only work around we've found is to change the number of lines in
either the header or footer. If you get rid of enough lines (usually
only 1 or 2 is necessary), the 4th page goes away. If you add enough
lines (usually only 1 or 2 is necessary), the 4 page has data and prints
fine. However, with variable length reports, this is obviously not a
viable option.

Does anyone know if this is just a bug in v3.0.5 of QR?

I've read all the posts about how everyone dislikes QR and we are moving
toward Crystal Reports, but that is months down the road. We would like
to get a patch out quickly to our customers with QR if that is at all
possible.

Some code that might be helpful is below. Sorry for the C++ code on a
delphi group.

Thanks for your help.

PHiL

try
{
//reset the total page count every time the report is generated
PageNumber = 0;
// generate the first report
frmPreviewReport->rptReport->Prepare();
// get the total number of pages in the report
TotalPageCount = frmPreviewReport->rptReport->QRPrinter->PageCount;
}//end try
__finally
{
// free the QRPrinter that was generated by the Prepare call
frmPreviewReport->rptReport->QRPrinter->Free();
frmPreviewReport->rptReport->QRPrinter = NULL; }//end finally

try
{
// reset the total page count every time the report is generated
PageNumber = 0;
// generate the 2nd report with the total number of pages
frmPreviewReport->rptReport->Prepare();

if(Preview)
{
if(!frmPrintPreview)
{
frmPrintPreview = new TfrmPrintPreview(this);
}//end if

frmPrintPreview->TotalPages = TotalPageCount;
// preview the report
frmPreviewReport->rptReport->PreviewModal();
}//end if
else
{
// print the report
frmPreviewReport->rptReport->Print();
}//end else
}//end try
__finally
{
// free the QRPrinter that was generated by the Prepare call
frmPreviewReport->rptReport->QRPrinter->Free();
frmPreviewReport->rptReport->QRPrinter = NULL;
}//end finally
 
 
 

Extra page in Quick Report preview

Post by PHiL » Fri, 16 Jul 2004 00:30:34


We did find another work around. Save the report from the preview
window, load it in the preview window, and then print. By some minor
miracle, the "lost" page is now printed. Unless anyone has anything to
say to the contrary, I'm going to go out on a limb and say this is
definately a bug in QR.
Unless anyone has anything to say to the contrary, I'm going to go out
on a limb and say this is definately a bug in QR.