Summary

General TRichView support forum. Please post your questions here
Post Reply
Marco Azevedo

Summary

Post by Marco Azevedo »

Hi

Do you remember Quick Report summary band ? Well, I need something like that. I want to print the footer just in the end of the text instead to print in the bottom page.

Is it possible with TRichView ?

Thanks
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

At the end of each page?
There is no an elegant solution for this.

Possible solution:
1) Format document for printing (RVPrint.FormatPages)
2) Save each page in new document (RVPrint.SavePageAsRVF - undocumented method). It may be done page by page, not necessary the same pages at once.
3) Prepare footer in another RichView
4) Using the code shown in http://www.trichview.com/forums/viewtopic.php?t=87 , print many documents in one printing job.

Code: Select all

Printer.BeginDoc;
RVPrint1.AssignSource(rvFullDoc);
RVPrint1.FormatPages(rvdoAll);
for i := 1 to RVPrint1.PageCount do
begin
  if i>1 then
    Printer.NewPage;
  Stream := TMemoryStream.Create;
  RVPrint1.SavePageAsRVF(Stream, i);
  Stream.Position := 0;
  rvPage.LoadRVFFromStream(Stream);
  Stream.Free;
  RVPrint2.AssignSource(rvPage);
  RVPrint2.StartAt := 0;
  RVPrint2.FormatPages(rvdoAll);
  RVPrint2.ContinuousPrint; 
  RVPrint2.StartAt := RVPrint2.EndAt;
  RVPrint2.AssignSource(rvFooter);
  RVPrint2.FormatPages(rvdoAll);
  RVPrint2.ContinuousPrint; 
end;
Printer.EndDoc;
In this example
rvFullDoc - TRichView (or editor) containing the whole document
rvPage - hidden TRichView, used to store one page during printing
rvFooter - TRichView (or editor) containing footer
RVPrint1 - TRVPrint used to format the whole document (repaginate it)
RVPrint2 - TRVPrint used for actual printing
Post Reply