Documentation
Back to website >

Set print job title programmatically (Pascalscript)

The name of the print job can be set dynamically via Pascalscript, i.e. depending on the document data. It is conceivable, for example, to name an invoice with the invoice number.

The document name is set using the PrinterSetup subobject with the Document Name property. The Report object is the main object.

The name can then be set as follows:

Report.PrinterSetup.DocumentName:=
  'Invoice: '+ RechnungsKopf['Rechnungsnummer'];

This script should be placed in the event BeforePrint of the report object of the main report.

Druckjob-Titel

If script commands already exist there, put this command before the line end;

Since all data sources depend on the report used, the possible fields in the toolbox are listed under Data under the respective data sources.

You can set the print job name statically using the page setting.