IGxDocument.OwnMultiCopiesPrint

Syntax

OwnMultiCopiesPrint: Boolean;

OwnMultiCopiesPrint: boolean;

Description

The OwnMultiCopiesPrint property determines whether instance number is automatically specified in marking stamp text on report print or export.

Comments

The property is relevant for use if:

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

If the value is True for automatic setting of instance number in marking stamp text, the report print is started as many times as many copies are set in print dialog box. If five copies are selected for print, the print is successively started five times. On report export value of the &[COPYNUMBER] substitution will be equal to one.

Starting of the report print N times has the following features:

Starting of the report print N times is available only in the desktop application for express reports, regular reports and time series analysis workbooks.

The property is set to False by default.

The property value is saved with the report.

Example

Executing the example requires that the repository contains a regular report with the REPORT identifier and a form containing a button with the Button1 identifier and the DocumentPrinter component with the DocumentPrinter1 identifier. For the Fore.NET example, instead of the Fore components use the Fore.NET analogs.

The example is a handler of the OnClick event for a button.

Add links to the system assemblies:

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    mb: IMetabase;
    doc: IGxDocument;
    MObj: IMetabaseObject;
    Security: IMetabaseSecurity;
    Stamps: IGxStamps;
    Stamp: IGxStamp;
    Lic: Object;
Begin
    
// Get current repository
    MB := MetabaseClass.Active;
    
// Get feature
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    
// Get report
    MObj := MB.ItemById("REPORT").Edit;
    Doc := MObj 
As IGxDocument;
    
// Include the use of printing instance number in stamp
    Doc.OwnMultiCopiesPrint := True;
    
// Get collection of report stamps
    Stamps := Doc.Stamps;
    
// Determine stamp settings located at the right bottom of page 
    Stamp := Stamps.RightBottom;
    
// Set position on the first page
    Stamp.Appearance := GxStampAppearance.FirstPage;
    
// Set indent 0 mm from the left and 10 mm from the top
    Stamp.Offset := New GxSizeF.Create(010);
    
// Set stamp 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 Copy &[CopyNumber] from &[TOTAL_COPIES] \par Page: &[Page] from &[Pages] \par}";
    
// Display the report for preview
    DocumentPrinter1.Document := Doc;
    DocumentPrinter1.PrintPreview(
0NullTrue);
    Lic := 
Null;
End Sub Button1OnClick;

Imports System.Windows.Forms;
Imports Prognoz.Platform.Forms.Net;
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.ForeSystem;
Imports Prognoz.Platform.Interop.Metabase;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    mb: IMetabase;
    doc: IGxDocument;
    MObj: IMetabaseObject;
    Security: IMetabaseSecurity;
    Stamps: IGxStamps;
    Stamp: IGxStamp;
    Offset, Size: GxSizeF = 
New GxSizeFClass();
    Lic: Object;
Begin
    
// Get current repository
    MB := Self.Metabase;
    
// Get feature
    Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
    
// Get report
    MObj := MB.ItemById["REPORT"].Edit();
    Doc := MObj 
As IGxDocument;
    
// Include the use of printing instance number in stamp
    Doc.OwnMultiCopiesPrint := True;
    
// Get collection of report stamps
    Stamps := Doc.Stamps;
    
// Determine stamp settings located at the right bottom of page 
    Stamp := Stamps.RightBottom;
    
// Set position on the first page
    Stamp.Appearance := GxStampAppearance.gsaFirstPage;
    
// Set indent 0 mm from the left and 10 mm from the top
    Offset := Stamp.Offset;
    Offset.Create(
010);
    
// Set stamp size - 40x30 mm
    Size := Stamp.Size;
    Size.Create(
4030);
    
// Set stamp text
    Stamp.Rtf := "{\rtf1\ansi\ansicpg1251\deff0\deflang1049{\fonttbl{\f0\fnil\fcharset240 Cambria;}}\viewkind4\pard\sa200\sl276\slmult1\lang9\b\f0\fs22 Copy &[CopyNumber] from &[TOTAL_COPIES] \par Page: &[Page] from &[Pages] \par}";
    
// Display the report for preview
    DocumentPrinterNet1.Document := Doc;
    DocumentPrinterNet1.DocumentPrinterUi.PrintPreview(
0New IWin32WindowForeAdapter(Self), True);
    Lic := 
Null;
End Sub;

After executing the example the marking stamp, which is displayed regardless of other settings on export or print, is set for the report. The marking stamp displays printing instance number and page number from the total number of pages in the document. The report will be displayed for preview.

See also:

IGxDocument