IGxDocument.Preview

Fore Syntax

Preview (Format: IGxImageFormat): IGxImage;

Fore.NET Syntax

Preview [Format: Prognoz.Platform.Interop.Drawing.IGxImageFormat]: Prognoz.Platform.Interop.Drawing.GxImage;

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.

Fore 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.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Tab;
Imports Prognoz.Platform.Interop.Report;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    mb: IMetabase;
    doc: IGxDocument;
    tab: ITabSheet;
    img: GxImage;
    GxImage: GxImageClassClass = New GxImageClassClass();
    GxImageFormats: GxImageFormatsClass = New GxImageFormatsClass();
    Placement: GxRectF = New GxRectFClass();
    obj: ITabObject;
    rep: IPrxReport;
Begin
    mb := Self.Metabase;
    rep := mb.ItemById["REGULAR_REPORT"].Bind() As IPrxReport;
    doc := rep As IGxDocument;
    tab := uiTabSheetNet1.TabSheetUi.TabSheet;
    img := doc.Preview[GxImageFormats.Png];
    Placement.Create(10,10,100,100);
    obj := tab.Objects.Add("PrxPicture",Placement);
    (obj As IPrxPicture).Image:= img;
End Sub;

See also:

IGxDocument