rvico TRichView Reference | TRVReportHelper

RVReportHelper TRVReportHelper

Properties   Methods   Events

Top  Previous  Next

This component is similar to TRVPrint, but:

it can be used to draw on any Canvas (not only on the printer's canvas) pages of any size (not limited to printer page sizes);

it contains a document, not a reference to it.

Unit RVReport;

Syntax

TRVReportHelper = class(TCustomRVPrint)

Hierarchy

TObject

TPersistent

TComponent

TCustomRVPrint

How to Use

1.Load document in RVReportHelper.RichView.

2.Initialize formatting (Init). Specify the page width and canvas.

3.Format the document page by page (FormatNextPage). Pages may have different heights.

4.Draw pages on canvas (DrawPage or DrawPageAt). If you need to know positions of hyperlinks and checkpoints, use OnDrawHyperlink and OnDrawCheckpoint events.

Example (drawing document in metafile)

procedure TForm1.DrawToMetafile(rvh: TRVReportHelper;

  wmf: TMetafile; Width: Integer);

const VERYLARGEVALUE = $FFFFFFF;

var Canvas: TMetafileCanvas;

begin  

  rvh.IgnorePageBreaks := True;

  rvh.Init(Self.Canvas, Width);

  while rvh.FormatNextPage(VERYLARGEVALUE) do;

  wmf.Width := Width;

  wmf.Height := rvh.GetLastPageHeight;

  Canvas := TMetafileCanvas.Create(wmf, 0);

  rvh.DrawPage(1,Canvas,True,rvh.GetLastPageHeight);

  Canvas.Free;

end;

Demo projects

Demos\Delphi\Assorted\Graphics\ToImage\

Demos\Delphi\Assorted\Printing\ReportHelper\

(for C++Builder demos, change "Delphi" to "CBuilder" in the paths above)


TRichView © trichview.com