Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New Page in QuickReport?

Status
Not open for further replies.

hstijnen

Programmer
Nov 13, 2002
172
0
0
NL
Hi,

I'm using QuicReport to build printed output. Now I've made a composite report from several basic reports.
How can I enforce every basic report to start on a new page?
There is, indeed, an option in the Title Band of a report: ForceNewPage. I've set it true, but without effect.
What can I do?

Thanks,

Henk
 
You must add a handler to the BeforePrint message for the first band (usualy the title band) on each of the basic reports. In these handlers call the NewPage() method of the report.

void __fastcall GenericBeforePrint(TObject *Sender)
{
((TMyReport*)Sender)->NewPage();
}

TMyReport * Rep[100];

void TMyCompositeReport::AddReports(...)
{
for (int i =0 ; i< NoOfReports; i++)
{
// add the report to composite report
((TMyReport*)Rep)->TitleBand1->BeforePrint = GenericBeforePrint;
}
}

usual c++ programmer
 
Thank you, iCounter for your suggestion. I had to make a slight modification:

void __fastcall TfrmPrint::GenericBeforePrint(TQRCustomBand *Sender, bool &PrintBand)
{
((TQuickRep*)Sender->ParentReport)->NewPage();
}

and in the QRCompositeReport1AddReports event:

frmPrintBasicRpt->TitleBand1->BeforePrint = GenericBeforePrint;

And it works.

Henk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top