I have two subreports on my detail band. I need to print second subreport from another page when first fills more then 70% of a page. Can you please suggest something?
You can use the TppSubreport.StopPosition property to define where on the page you would like the subreport to stop printing before moving to the next page.
Thanks for the clairification. There is no built-in feature for ReportBuilder that will do this automatically however it is possible to measure where the last detail band is printed on a page and based on that value, you could toggle the KeepTogether property of the second subreport (essentially telling it whether to break to a new page or start printing below the first subreport. For instance...
Detail Band Subreport1 Subreport2
procedure TForm1.ppDetailBand1AfterPrint(Sender: TObject); begin if (ppChildReport1.Engine.PrintPosRect.Top > 150000) then ppSubreport2.KeepTogether := True else ppSubreport2.KeepTogether := False; end;
Note that the PrintPosRect is calculated in microns. 150000 is a little less than 6 inches so if the first subreport extends beyond 6 inches on the last page, the second subreport will start printing on a new page.
Comments
You can use the TppSubreport.StopPosition property to define where on the
page you would like the subreport to stop printing before moving to the next
page.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks for the clairification. There is no built-in feature for
ReportBuilder that will do this automatically however it is possible to
measure where the last detail band is printed on a page and based on that
value, you could toggle the KeepTogether property of the second subreport
(essentially telling it whether to break to a new page or start printing
below the first subreport. For instance...
Detail Band
Subreport1
Subreport2
procedure TForm1.ppDetailBand1AfterPrint(Sender: TObject);
begin
if (ppChildReport1.Engine.PrintPosRect.Top > 150000) then
ppSubreport2.KeepTogether := True
else
ppSubreport2.KeepTogether := False;
end;
Note that the PrintPosRect is calculated in microns. 150000 is a little
less than 6 inches so if the first subreport extends beyond 6 inches on the
last page, the second subreport will start printing on a new page.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com