IGxDocument.Preview

Syntax

Preview (Format: IGxImageFormat): IGxImage;

Parameters

Format. Image format for report preview.

Description

The Preview property returns the image that is used to preview reports.

Comments

A preview as an image of the first page that is available for reports created by means of the Dashboards, Analytical Queries (OLAP), Reports, and Time Series Analysis tools.

Example

Executing the example requires a form that contains the Button component with the Button1 identifier, the TabSheetBox component with the TabSheetBox1 identifier and the UiTabSheet component with the UiTabSheet1 identifier. Specify the UiTabSheet1 data source for the TabSheetBox1 component.

The example is a handler of the OnClick event for the Button1 component.

Add links to the Metabase, Drawing, Report system assemblies.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    mb: IMetabase;
    doc: IGxDocument;
    tab: ITabSheet;
    img: IGxImage;
    Placement: IGxRectF;
    obj: ITabObject;
    rep: IPrxReport;
Begin
    mb := MetabaseClass.Active;
    rep := mb.ItemById("REGULAR_REPORT").Bind As IPrxReport;
    doc := rep As IGxDocument;
    tab := UiTabSheet1.TabSheet;
    img := doc.Preview(GxImageFormats.Png);
    Placement := New GxRectF.Create(10,10,100,100);
    obj := tab.Objects.Add("PrxPicture",Placement);
    (obj As IPrxPicture).Image:= img;
End Sub Button1OnClick;

After executing the example an image that corresponds to the first page of report with the REGULAR_REPORT identifier.

See also:

IGxDocument