I'm not new to C++ programming but I'm not an expert either.
I'm using Borland C++ builder 5. I know it's extremely antiquated, but I have no choice right now. Writing a database reporting program, using third party report building components (ACE) which has it's own print dialogs built in. However, in this report we cannot use the build in dialogs and have to use a standard TPrintDialog. When the TPrintDialog is executed and you click print on the dialog, only one page is sent to the printer. Any help is extremely appreciated. Here's some code, not sure how helpful it'll be.
Thanks
// The dataset for the report is executed prior to this code and does not //change. Once the data is gathered, the report can be run as often as you like
// and the same data will appear in the report.
if (cbxShowForm->Checked){
OverlayBand->Visible = true;
AllowPrint = false;
SctReport1->Prompt = false;//Disables the ACE Reporter
//print destination prompt.
SctReport2->Prompt = false;
ReportPage->PageSetup->PreviewSettings->ModalPreview = mpModal;
if (rbNUCC->Checked){
SctReport1->Run();//First report run, produces several pages
}
else {
SctReport2->Run();
}
if (MessageDlg("Print to pre-printed forms?", mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0) == mrYes){
ReportPage->PageSetup->Destination = destPrinter;
OverlayBand->Visible = false;
if (PrintDialog1->Execute()){//STANDARD TPrintDialog
if (rbNUCC->Checked){
SctReport1->Run();//Second report run should produce several pages
}
else {
SctReport2->Run();
}
}
}
}
The issue turned about to be something with the TQuery supplying data to the report only supplying one record. A simply Query->Close(); Query->Open(); resolved the issue.