FirstPageHeader: IPrxSheetHeader;
FirstPageHeader: Prognoz.Platform.Interop.Report.IPrxSheetHeader;
The FirstPageHeader property returns parameters of the first page header.
To get parameters of the first page footer, use the IPrxSheetHeaders.FirstPageFooter property.
Executing the example requires that the repository contains a regular report with the REPORT identifier.
Add links to the Metabase, Report system assemblies.
Sub UserProc;
Var
Metabase: IMetabase;
Report : IPrxReport;
Sheet: IPrxSheet;
Headers: IPrxSheetHeaders;
Param: IPrxSheetHeader;
Begin
Metabase := MetabaseClass.Active;
Report := Metabase.ItemById("REPORT").Edit As IPrxReport;
Sheet := Report.Sheets.Item(0);
Headers := Sheet.HeadersFooters;
// Set up header and footer margins for the first page
Param := Headers.FirstPageHeader;
Param.Margin := 30;
Param := Headers.FirstPageFooter;
Param.Margin := 30;
// Consider settings for the first page
Headers.DifferentFirstPageHeaderFooter := True;
Debug.Writeline("Margin of the first page header: " +
Headers.FirstPageHeader.Margin.ToString);
Debug.Writeline("Margin of first page footer: " +
Headers.FirstPageFooter.Margin.ToString);
(Report As IMetabaseObject).Save;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Report;
…
Public Shared Sub Main(Params: StartParams);
Var
Metabase: IMetabase;
Report : IPrxReport;
Sheet: IPrxSheet;
Headers: IPrxSheetHeaders;
Param: IPrxSheetHeader;
Begin
Metabase := Params.Metabase;
Report := Metabase.ItemById["REPORT"].Edit() As IPrxReport;
Sheet := Report.Sheets.Item[0];
Headers := Sheet.HeadersFooters;
// Set up header and footer margins for the first page
Param := Headers.FirstPageHeader;
Param.Margin := 30;
Param := Headers.FirstPageFooter;
Param.Margin := 30;
// Consider settings for the first page
Headers.DifferentFirstPageHeaderFooter := True;
System.Diagnostics.Debug.Writeline("Margin of first page header: " +
Headers.FirstPageHeader.Margin.ToString());
System.Diagnostics.Debug.Writeline("Margin of first footer: " +
Headers.FirstPageFooter.Margin.ToString());
(Report As IMetabaseObject).Save();
End Sub;
After executing the example margin parameters for first page headers and footers are determined. The console window displays information about header and footer margins.
See also: