OwnMultiCopiesPrint: Boolean;
OwnMultiCopiesPrint: Boolean;
The OwnMultiCopiesPrint property determines whether instance number is automatically specified in marking stamp text on report print or export.
The property is relevant for use if:
The mandatory access or security level based access is enabled.
The document marking on export and print is enabled.
Marking stamp text is set via IGxStamp.Rtf by means of the &[COPYNUMBER] substitution.
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:
A print dialog box is not displayed again.
Copy print is performed successively.
Only one record about document print will be made in access protocol.
On batch print, the print is started N times by M copies of each report version.
It is not available to control the Collate Copies setting because it will be always active by default.
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.
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(0, 10);
// Set stamp size - 40x30 mm
Stamp.Size := New GxSizeF.Create(40, 30);
// 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.
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(-1, True, New IWin32WindowForeAdapter(Self));
End Sub;
See also: