Scope: managed applications.
Some catalogs, documents, and other configuration objects provide commands for their printing. Below you can see recommendations for implementation of such commands.
- Rights to read main metadata objects whose data is used to generate print forms (for example, to generate the SalesOrder print form, document read rights are required).
- Rights to execute the command that initiates generation of a print form. If users have access rights to SalesOrder document, all print forms do not automatically become available to them. Access to print forms can be restricted separately using access rights to execute commands.
1.2. If data of other objects related to the main ones is displayed in a print form, make sure that access rights to them do not affect generation of a print form or content of printed information. That is why execute print form generation code in the privileged mode.
For example, to generate the Tax invoice in foreign currency print form, data from the document used to generate a tax invoice and the Currency exchange rates information register is used. Users can generate print forms if they are authorized to read documents and execute the print command. It does not matter whether users can access the Currency exchange rates information register.
See also: Privileged mode
See also: Merging similar queries
Exceptions are the following cases when data selection for multiple objects in a single query:
- Significantly complicates the query development.
- Can result in poor performance. For example, a query accesses virtual tables generated on a specific date. Examples are virtual tables of accumulation register balance, slices of last records of a periodic information register, and other.
3.1. Make sure that print and display forms of objects (catalogs, documents, and other) with tabular sections must have the same content and row sequence in tabular sections. In particular, when outputting to print, do not group tabular section rows.
For example, have a look at print and display document forms with tabular sections of product prices grouped by price types: retail, wholesale, and other price types are displayed in columns for every product. Each tabular section row contains a single price type only.
Exceptions are print forms whose specifics require sorting by another attribute. For example, in a warehouse supervisor job for picking goods from storage bins, the job rows are sorted by the order of iterating through storage bins. The "Row number" attribute value is also displayed in the respective column.
See also: Ordering query results
6.1. Whenever data is displayed in print forms, make sure it is displayed fully and not cut.
7. When you prepare a spreadsheet document on the server, do not set the size of margins smaller than physically restricted printer margins. In particular, null margins are unacceptable.
Generally, we recommend that you do not change the default size of spreadsheet document margins. The exceptions are cases when the margin sizes are regulated. $$$ $$$ $$$ $$$
The restriction applies as client printer margins are unavailable to the application server. If a document with null margins is printed, a text outside a printable area is not printed.
Example of incorrect code:
// Setting default print form parameters
SpreadsheetDocument.TopMargin = 0;
SpreadsheetDocument.LeftMargin = 0;
SpreadsheetDocument.BottomMargin = 0;
SpreadsheetDocument.RightMargin = 0;
8. If a configuration supports editing of a print form layout in the Enterprise mode (for example, using the Print subsystem tools of Standard Subsystems Library), note that any of its parameters can be edited or deleted. To improve reliability of the code used to generate print forms, avoid explicit assignment of parameter values in print areas. Instead, use the FillPropetyValues global method or the Fill method of the TextDocumentTemplateParameters collection.
PrintArea.Parameters.Company= PrintData.Company; // An error occurs if the Company parameter is unavailable in the template
Note: The PrintData variable can have examples Sructure, Map, QueryResultSelection, or any other collection with parameter values.