Image: IGxImage;
The Image property determines an image for header/title part.
Executing the example requires that the repository contains a regular report with the REPORT identifier. The file system should also contain the D:\Files\Logo.png image file.
Add references to the Drawing, Metabase, Report system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Report: IPrxReport;
Sheet: IPrxSheet;
HeadersFooters: IPrxSheetHeaders;
Header: IPrxSheetHeaderBase;
HeaderPart: IPrxSheetHeaderPart;
Img: IGxImage;
Begin
MB := MetabaseClass.Active;
// Get regular report
MObj := MB.ItemById("REPORT").Edit;
Report := MObj As IPrxReport;
// Get the first sheet
Sheet := Report.Sheets.Item(0);
// Get headers and footers
HeadersFooters := Sheet.HeadersFooters;
// Get header
Header := HeadersFooters.Header;
// Set up header for the first sheet
HeaderPart := Header.Left;
HeaderPart.Text := "&[Picture]";
Img := New GxImage.CreateFromFile("D:\Files\Logo.png");
HeaderPart.Image := Img;
HeaderPart.ImageHeight := 10;
HeaderPart.ImageWidth := 10;
// Save changes
MObj.Save;
End Sub UserProc;
After executing the example an image is inserted to the the left part of the header.
See also: