Margins Problems
Hi I'm using Delphi 7 + RB 9.03
To combine several reports into one i' m using this code :
-----
MasterRpt := TppReport.Create(nil);
MasterRpt.PassSetting := psTwoPass;
MasterRpt.CreateDefaultBands;
MasterRpt.RemoveBand(MasterRpt.HeaderBand);
MasterRpt.RemoveBand(MasterRpt.FooterBand);
for i := 0 to RptList.Count -1 do begin
SR := TppSubReport.Create(nil);
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 := 'PIMUS';
MasterRpt.AllowPrintToFile := True;
MasterRpt.ShowPrintDialog := True;
MasterRpt.PreviewFormSettings.WindowState := wsMaximized;
MasterRpt.OutlineSettings.Visible := False; //
MasterRpt.Print;
for s := 0 to SubList.Count -1 do begin
TppSubReport(SubList[s]).SetReportProperty(Nil);
TppSubReport(SubList[s]).Free;
end;
------
It's work fine (preview is ok) but if i change the page margins (left or
right) at design-time and i send it to printer, the margins not changes.
Can You Help me please ???
Thank's in advances.
Roberto
PS.: Sorry for my orrible English !!!!!!!
To combine several reports into one i' m using this code :
-----
MasterRpt := TppReport.Create(nil);
MasterRpt.PassSetting := psTwoPass;
MasterRpt.CreateDefaultBands;
MasterRpt.RemoveBand(MasterRpt.HeaderBand);
MasterRpt.RemoveBand(MasterRpt.FooterBand);
for i := 0 to RptList.Count -1 do begin
SR := TppSubReport.Create(nil);
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 := 'PIMUS';
MasterRpt.AllowPrintToFile := True;
MasterRpt.ShowPrintDialog := True;
MasterRpt.PreviewFormSettings.WindowState := wsMaximized;
MasterRpt.OutlineSettings.Visible := False; //
MasterRpt.Print;
for s := 0 to SubList.Count -1 do begin
TppSubReport(SubList[s]).SetReportProperty(Nil);
TppSubReport(SubList[s]).Free;
end;
------
It's work fine (preview is ok) but if i change the page margins (left or
right) at design-time and i send it to printer, the margins not changes.
Can You Help me please ???
Thank's in advances.
Roberto
PS.: Sorry for my orrible English !!!!!!!
This discussion has been closed.
Comments
For each suport, after setting it to pbSection, then set ParentPrinterSetup
to False. I would do that prior to setting the report property.
for i := 0 to RptList.Count -1 do begin
SR := TppSubReport.Create(nil);
SR.Band := MasterRpt.DetailBand;
SR.PrintBehavior := pbSection;
SR.ParentPrinterSetup := False; // *** add this line ****
SR.SetReportProperty(TppReport(RptList[i]));
SR.Report.PassSetting := psTwoPass; SR.ResetPageNo := False;
SubList.Add(SR);
end;
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com