Numeration pages is mistaken
Hi
i'm using D7+Reportbuilder 9.01+TExtraDevices 2.92
when i try to combine several report into one i use the example code found
at Welar site (http://www.waler.com/textradevices_faq.htm#faq5)
--------------------------------------
uses ppSubRpt, ppTypes;procedure TForm1.Button1Click(Sender: TObject);var
I: Integer; SubList, RptList: TList; MasterRpt: TppReport; SR:
TppSubReport;begin SubList := TList.Create; RptList := TList.Create;
RptList.Add(ppReport1); // Add your own reports here!
RptList.Add(ppReport2); MasterRpt := TppReport.Create(Self);
MasterRpt.CreateDefaultBands; MasterRpt.RemoveBand(MasterRpt.HeaderBand);
MasterRpt.RemoveBand(MasterRpt.FooterBand); for I := 0 to RptList.Count -
1 do begin SR := TppSubReport.Create(Self); SR.Band :=
MasterRpt.DetailBand; SR.SetReportProperty(TppReport(RptList[I]));
SR.PrintBehavior := pbSection; SR.Report.PassSetting := psTwoPass;
SR.ResetPageNo := False; SubList.Add(SR); end;
MasterRpt.TextFileName := 'MASTER.PDF'; MasterRpt.AllowPrintToFile :=
True; MasterRpt.ShowPrintDialog := True; MasterRpt.DeviceType :=
'PDFFile'; MasterRpt.Print; for I := 0 to SubList.Count - 1 do begin
TppSubReport(SubList[I]).SetReportProperty(Nil);
TppSubReport(SubList[I]).Free; end; RptList.Free; SubList.Free;
MasterRpt.Free;end;--------------------------------------
...... but the numeration of the pages is mistaken .....
for example pag 1 of 5 it becames ----> pag 1 of 1
pag 2 of 5 it becames ----> pag 2 of 2
pag 3 of 5 it becames ----> pag 3 of 3
pag 4 of 5 it becames ----> pag 4 of 4
pag 5 of 5 it becames -----> pag 5 of 5
this in preview and print.
Can you help me .....
Sorry for my orrible english ..... thanks in advance
Roberto
i'm using D7+Reportbuilder 9.01+TExtraDevices 2.92
when i try to combine several report into one i use the example code found
at Welar site (http://www.waler.com/textradevices_faq.htm#faq5)
--------------------------------------
uses ppSubRpt, ppTypes;procedure TForm1.Button1Click(Sender: TObject);var
I: Integer; SubList, RptList: TList; MasterRpt: TppReport; SR:
TppSubReport;begin SubList := TList.Create; RptList := TList.Create;
RptList.Add(ppReport1); // Add your own reports here!
RptList.Add(ppReport2); MasterRpt := TppReport.Create(Self);
MasterRpt.CreateDefaultBands; MasterRpt.RemoveBand(MasterRpt.HeaderBand);
MasterRpt.RemoveBand(MasterRpt.FooterBand); for I := 0 to RptList.Count -
1 do begin SR := TppSubReport.Create(Self); SR.Band :=
MasterRpt.DetailBand; SR.SetReportProperty(TppReport(RptList[I]));
SR.PrintBehavior := pbSection; SR.Report.PassSetting := psTwoPass;
SR.ResetPageNo := False; SubList.Add(SR); end;
MasterRpt.TextFileName := 'MASTER.PDF'; MasterRpt.AllowPrintToFile :=
True; MasterRpt.ShowPrintDialog := True; MasterRpt.DeviceType :=
'PDFFile'; MasterRpt.Print; for I := 0 to SubList.Count - 1 do begin
TppSubReport(SubList[I]).SetReportProperty(Nil);
TppSubReport(SubList[I]).Free; end; RptList.Free; SubList.Free;
MasterRpt.Free;end;--------------------------------------
...... but the numeration of the pages is mistaken .....
for example pag 1 of 5 it becames ----> pag 1 of 1
pag 2 of 5 it becames ----> pag 2 of 2
pag 3 of 5 it becames ----> pag 3 of 3
pag 4 of 5 it becames ----> pag 4 of 4
pag 5 of 5 it becames -----> pag 5 of 5
this in preview and print.
Can you help me .....
Sorry for my orrible english ..... thanks in advance
Roberto
This discussion has been closed.
Comments
That type of page numbering requires a two pass report.
Try adding a line of code to set the Report.PassSetting to psTwoPass...
Example:
uses
ppTypes;
MasterRpt := TppReport.Create(Self);
MasterRpt.PassSetting := psTwoPass;
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Thank and Heppy New Year !!!!!!!!!!!!!!!!!!!!