Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
a_f:a:print_document [2022/09/01 01:23] – removed - external edit (Unknown date) 127.0.0.1a_f:a:print_document [2023/05/09 01:43] (current) sean
Line 1: Line 1:
 +{{tag>Index Action Action_List Process Documents}}
 +====== PRINT DOCUMENT ======
 +
 +This action is very similar to the DISPLAY DOCUMENT action, but instead of displaying the document on the screen, it sends the document to the printer of the server. The action has two variations:
 +
 +''PRINT DOCUMENT'' AttributeIdentifier() [ ''TO'' ArithmeticExpression()] [ <INTEGER> ''COPIES''
 +
 +The action written in this format prints the contents of the attribute of the specified business object, provided that this attribute is of the Document type. Whatever document is stored in the attribute will be printed – no document processing is performed. For example,
 +
 +<code aim>PRINT DOCUMENT Statement.StatementDocument </code>
 +
 +The ''TO'' keyword indicates the name of the network server where the document will be sent for printing. If it is omitted the document will be sent to the default printer.
 +
 +If number of copies is specified the specified number of documents will be printed, otherwise one copy will be printed.
 +
 +<callout type="primary" icon="true" title="note"> Files corresponding to known document types only will be printed.</callout>
 +
 +Example:
 +
 +<code aim>PRINT DOCUMENT StaffReport 5 COPIES </code>
 +
 +<code aim>PRINT DOCUMENT StaffReport TO 'Network Printer 1' 5 COPIES  </code>
 +
 +  * ''PRINT DOCUMENT'' (Id() | StringLiteral()) [ ''TO'' ArithmeticExpression()] [ <INTEGER> ''COPIES'' ]
 +
 +where Id() or StringLiteral() is the name of the document template to be printed. 
 +
 +Before the document template is printed the action will calculate and fill in attribute values used inside tags in the template (see also the “[[:docs:2000_concepts:0900_prod_feats:0200_working_with_docs_reports:0200_doc_gen|Document Generation]]” section. 
 +
 +Consider the following rules:
 +
 +<code aim>FIND Person WHERE Person.Name='John Smith'
 + PRINT DOCUMENT AccountOpeningLetter </code>
 +
 +where ''AccountOpeningLetter'' is the name of the document template. If this template has the following line 
 +
 +<code>Dear <<Person.Name>>,  </code>
 +
 +it will be replaced with the line 
 +
 +<code>Dear John Smith  </code>
 +
 +when the template is printed.