IGxDocument.OwnMultiCopiesPrint

Fore Syntax

OwnMultiCopiesPrint: Boolean;

Fore.NET Syntax

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.

Fore Example

Executing the example requires that the repository contains a regular report with the REGLAMENT_STAMPS identifier and a form containing the button with the Button1 identifier and the DocumentPrinter component with the DocumentPrinter1 identifier.

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

Add links to the Drawing, Metabase system assemblies.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    mb: IMetabase;
    doc: IGxDocument;
    MObj: IMetabaseObject;
    Security: IMetabaseSecurity;
    Stamps: IGxStamps;
    Stamp: IGxStamp;
Begin
    
// Get current repository
    MB := MetabaseClass.Active;
    Security := MB.Security;
    
// Set stamp use regardless of settings
    Security.Policy.AlwaysPrintDocumentLabel := True;
    
// Apply selected policy settings
    Security.Apply;
    MObj := MB.ItemById(
"REGLAMENT_STAMPS").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}";
    MObj.Save;
    DocumentPrinter1.Document := Doc;
    DocumentPrinter1.Print;
End Sub Button1OnClick;

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 sent for print.

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

Imports Prognoz.Platform.Interop.Drawing;

...

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Security: IMetabaseSecurity;
    Doc: IGxDocument;
    Stamps: IGxStamps;
    Stamp: IGxStamp;
    Size1,  Size2: GxSizeF = New  GxSizeF();
Begin
    
// Get current repository
    MB := Self.Metabase;
    Security := MB.Security;
    
// Set stamp use regardless of settings
    Security.Policy.AlwaysPrintDocumentLabel := True;
    
// Apply selected policy settings
    Security.Apply();
    MObj := MB.ItemById(
"REGLAMENT_STAMPS").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
    Size1.Create(0,  10);
    Stamp.Offset := Size1;
    
// Set stamp size - 40x30 mm
    Size2.Create(40,  30);
    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 Copy &[CopyNumber] from &[TOTAL_COPIES] \par Page: &[Page] from &[Pages] \par}";
    MObj.Save();
    DocumentPrinterNet1.Document := Doc;
    DocumentPrinterNet1.DocumentPrinterUi.Print(-
1TrueNew IWin32WindowForeAdapter(Self));
End Sub;

See also:

IGxDocument