YOUSEFUL / DELPHI / COMPONENTS

EAtlasPrintError

Exception raised by TAtlasPrintDocument for a missing table, an invalid page geometry or a page index out of range.

Class Unit Atlas.Printing · Inherits Exception · Product Atlas VCL

Description

Raised by every TAtlasPrintDocument method that receives bad input: Prepare (no table or columns, geometry below the minimums, no room for a data row), FirstRow, RowsOnPage, RenderPage and Preview (page out of range, empty bounds) and Print (nothing prepared). Failures inside the Windows print spooler surface as the VCL's own EPrinter exceptions, not as this class.

This type has no members of its own beyond those listed in its description.

Examples

Guard a page index

Requesting a page past the end raises; nothing else changes.

pascal
uses Vcl.Graphics, Atlas.Printing;

procedure ShowPage(Document: TAtlasPrintDocument; Page: Integer);
var
  Bitmap: TBitmap;
begin
  try
    Bitmap := Document.Preview(Page);
    try
      Writeln(Bitmap.Width, ' x ', Bitmap.Height);
    finally
      Bitmap.Free;
    end;
  except
    on E: EAtlasPrintError do
      Writeln('No such page: ', E.Message);   // Page index out of range
  end;
end;

TAtlasPrintDocument

Also in Atlas VCL

TAtlasTable · TAtlasGrid · TAtlasValueEdit · TAtlasTree · TAtlasWorkbook · TAtlasSheetGrid · TAtlasPivot · TAtlasInspector · TAtlasRichEdit · TAtlasSpellChecker · TAtlasChart · TAtlasGauge · TAtlasThemer · TAtlasWizard · TAtlasWorkspace · TAtlasCommandBar · TAtlasActionTile · TAtlasTileBoard · TAtlasNavigation · TAtlasMap · TAtlasGraph · TAtlasDiagram · TAtlasPrintDocument · TAtlasSchedule · TAtlasScheduler · TAtlasTaskPlan · TAtlasGantt · TAtlasPdfDocument · TAtlasPdfViewer