PRINT operator
The PRINT operator creates an action that opens a form in print view.
Syntax
PRINT name
[CLIENT | SERVER]
[OBJECTS objName1 = expr1, ..., objNameN = exprN]
FILTERS ...
[formActionOptions]
formActionOptions - additional options for this action. There are several possible option syntaxes in this operator:
printFormat [SHEET sheetProperty] [PASSWORD passwordExpr] [TO propertyId]
[PREVIEW | NOPREVIEW] [syncType] [TO printerExpr]
MESSAGE [syncType] [messageType]
[TOP (topExpr | (topGroupId1 = topPropertyExpr1, ..., topGroupIdT = topPropertyExprT))]
[OFFSET (offsetExpr | (offsetGroupId1 = offsetPropertyExpr1, ..., offsetGroupIdF = offsetPropertyExprF))]
Description
The PRINT operator creates an action that prints the specified form. When printing a form in the OBJECTS block you can add additional filters for form objects to check these objects for equality to the values passed.
Parameters
-
nameForm name. Composite ID.
-
CLIENT|SERVERKeywords. Specify whether to perform the action on the client (
CLIENT) or on the server (SERVER). By default, the action is performed on the client. -
objName1 ... objNameNNames of form objects for which additional filters are specified. Simple IDs.
-
expr1 ... exprNExpressions whose values determine the filtered (fixed) values for form objects.
-
FILTERS ...Adds fixed filters to the form. Syntax of the fixed filters block.
Additional options
-
printFormatThe print format is specified by one of these keywords:
PDF– the form will be exported to a PDF file.XLS,XLSX– the form will be exported to a file in one of the specified EXCEL formats.DOC,DOCX– the form will be exported to a file in one of the specified WORD formats.RTF– the form will be exported to an RTF file.HTML– the form will be exported to an HTML file.
-
sheetPropertyThe ID of the property whose value is used as the name of the sheet in the exported file. The property must not have parameters. It is used for
XLSandXLSXprint formats. -
passwordExprAn expression whose value determines the password that sets the read-only mode for the exported file. Used for
XLSandXLSXprint formats. -
propertyIdProperty ID to which the generated file will be written. The property must not have parameters. If a property is not specified, the generated file is sent to the client and opened by the operating system
-
PREVIEWKeyword. If specified, the form is displayed in preview mode. This mode is used by default if no other modes/formats are specified.
-
NOPREVIEWKeyword. If specified, the form is immediately (without preview) sent for printing.
-
printerExprAn expression whose value determines the name of the printer to which the print job will be sent. If no printer with the specified name is found (or specified), the default printer is selected.
-
MESSAGEKeyword. If specified, the form displays data to the user in message mode.
-
syncTypeDetermines when the created action should be continued:
-
WAIT- after the client completes the action (closes the preview/message form). Used by default. -
NOWAIT- after preparation of the information for sending to the client (form data is read). -
messageTypeMessage type. Specifies how the message will be displayed on the screen. Specified by one of the keywords:
-
LOG- message in theSystem.logwindow. -
INFO- information message. -
SUCCESS- success message. -
WARN- warning message. -
ERROR- error message. -
DEFAULT- plain message. This value is used by default.
-
-
-
TOP (topExpr | (topGroupId1 = topPropertyExpr1, ..., topGroupIdT = topPropertyExprT))Print only first
nrecords, wherenis value of expressiontopExprortopPropertyExprTfor group objecttopGroupIdT. -
OFFSET (offsetExpr | (offsetGroupId1 = offsetPropertyExpr1, ..., offsetGroupIdF = offsetPropertyExprF))Print only records with offset
m, wheremis value of expressionoffsetExproroffsetPropertyExprFfor group objectoffsetGroupIdF.
Examples
FORM printOrder
OBJECTS o = Order
PROPERTIES(o) currency, customer
OBJECTS d = OrderDetail
PROPERTIES(d) idSku, price
FILTERS order(d) == o
;
print (Order o) {
PRINT printOrder OBJECTS o = o; // printing
LOCAL file = FILE ();
PRINT printOrder OBJECTS o = o DOCX TO file;
open(file());
//v 2.0-2.1 syntax
LOCAL sheetName = STRING[255]();
sheetName() <- 'encrypted';
PRINT printOrder OBJECTS o = o XLS SHEET sheetName PASSWORD 'pass';
//v 2.2 syntax
//PRINT printOrder OBJECTS o = o XLS SHEET 'encrypted' PASSWORD 'pass';
}