IGxDocument.Stamps

Fore Syntax

Stamps: IGxStamps;

Fore.NET Syntax

Stamps: Prognoz.Platform.Interop.Drawing.IGxStamps;

Description

The Stamps property determines a set of marking stamps of the document.

Comments

To convert stamp text into the RTF format, use the ITextConverter.Export method.

Displaying conditions of marking stamps are given in IGxStamp.

TIP. To display marking stamp whatever mandatory access or access be security levels is applied, set the IMetabasePolicy.AlwaysPrintDocumentLabel property to True.

Fore Example

Executing the example requires a regular report with the REGULAR_REPORT identifier.Add links to the Metabase, Drawing system assemblies.

Sub UserProc;
Var 
    MB: IMetabase;
    MObj: IMetabaseObject;
    Doc: IGxDocument;
    Stamps: IGxStamps;
    Stamp: IGxStamp;
Begin
    // Get metabase object
    MB := MetabaseClass.Active; 
    // Get regular report
    MObj := MB.ItemById("REGULAR_REPORT").Edit;
    // Cast obtained object to IGxDocument 
    Doc := MObj As IGxDocument;
    // Get collection of report stamps
    Stamps := Doc.Stamps;
    // Set up marking stamp displayed bottom left
    Stamp := stamps.LeftBottom;
    // Set stamp position on the first page 
    Stamp.Appearance := GxStampAppearance.FirstPage;
    // Set offset 30 mm to the left and 20 mm from the top
    Stamp.Offset := New GxSizeF.Create(3020);  
    // Set size 40x30 mm
    Stamp.Size := New GxSizeF.Create(4030);  
    // Set stamp text
    Stamp.Rtf := "{\rtf1\ansi\ansicpg1251\deff0\deflang1049{\fonttbl{\f0\fnil\fcharset240 Cambria;}}\viewkind4\uc1\pard\sa200\sl276\slmult1\lang9\b\f0\fs22 Page: &[Page] of &[Pages] \par}";
    MObj.Save;
End Sub UserProc;

After executing the example the bottom left marking stamp, which is displayed on report export or print, is set for the report. The marking stamp displays page number from the total number of pages. Displaying conditions of marking stamps are given in IGxStamp.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example. The specified procedure is an entry point for the .NET assembly.

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

...

Public Shared Sub Main(Params: StartParams);
Var 
    MB: IMetabase;
    MObj: IMetabaseObject;
    Doc: IGxDocument;
    Stamps: IGxStamps;
    Stamp: IGxStamp;
    Size1, Size2: GxSizeF = New GxSizeF();
Begin
    // Get metabase object
    MB := Params.Metabase;
    // Get regular report
    MObj := MB.ItemById["REPORT_OT"].Edit();
    // Cast obtained object to IGxDocument 
    Doc := MObj As IGxDocument;
    // Get collection of report stamps
    Stamps := Doc.Stamps;
    // Set up marking stamp displayed bottom left
    Stamp := stamps.LeftBottom;
    // Set stamp position on the first page 
    Stamp.Appearance := GxStampAppearance.gsaFirstPage;
    // Set offset 30 mm to the left and 20 mm from the top
    Size1.Create(3020);
    Stamp.Offset := Size1;
    // Set size 40x30 mm
    Size2.Create(4030);
    Stamp.Size := Size2;
    // Set stamp text
    Stamp.Rtf := "{\rtf1\ansi\ansicpg1251\deff0\deflang1049{\fonttbl{\f0\fnil\fcharset240 Cambria;}}\viewkind4\pard\sa200\sl276\slmult1\lang9\b\f0\fs22 Page: &[Page] of &[Pages] \par}";
    MObj.Save();
End Sub;

See also:

IGxDocument