Attachment Generating Rules

In v3.5.1, a second grid was added to the Configure report attachments form. This grid defines rules for dynamically generating report attachments when the master report is executed.

While Attachment loading rules are used to attach documents that already exist, Attachment generating rules are used to generate attachments during master report execution. For each generating rule, an additional report is executed. The output of the executed report is then attached to the master report as a generated report attachment.

Each line in the grid describes one rule in the following way:

  1. What to generate, i.e. which report format is used to generate the attachment and which format is used for the output. Related fields:
  2. What to do if no document is generated. Related fields:
  3. How to attach the generated attachment to the master report and what to do if the generated report attachment doesn’t have a compatible format for the selected action. Related fields:
  4. How to name the document when it’s attached to the report. Related fields:

Rule fields

Each rule has the following fields:

Generate from

This field defines the report format type to be used for generating the report attachment.  These format types are offered:

  • ER-CBD format: Use this option to generate attachment based on Electronic Reporting (ER) configurations for Configurable Business Documents (CBD). These are usually ER formats with Excel or Word templates (convertible to PDF), but they can also produce XML (for example, ZUGFeRD-compliant XML). They are recognizable by the Tag type property set to Business document type and are applicable only to Print management reports.

    When creating a new rule or editing an existing one (through Edit format menu item), you should also specify the following:

    • Format mapping: provides a list of ER format mapping configurations available for the ER-CBD formats of the report’s Print management document type.
    • File component: provides a list of file components available for the selected Format mapping.

    The combination of these two values is displayed in the read-only Report format field. To modify these values, use the Edit format menu item.

  • ER-eDoc format: Use this option to generate attachment based on ER format mapping that produce Electronic documents. Currently supported are ER formats that can be configured as Electronic documents in Accounts receivable parameters for the following reports: Sales invoice, Free text invoice, Project invoice and Collection letter. Only formats based on the same data source as the master report are applicable. As with the ER-CBD format option, you should also specify the Format mapping from the list of available formats and the corresponding File component. The combination of these two values is displayed in the Report format
  • Docentric report template: Use this option to generate attachment based on a selected Docentric report template ID. All Docentric templates configured for the same Print management document type are available for selection.
  • SSRS report design: Use this option to generate attachment based on a selected SSRS report design. All SSRS report designs configured for the same Print management document type are available for selection. For non-Print management master reports, all SSRS report designs are listed, but only those based on the same data source as the master report are applicable.
The ER configurations must be imported before they can be selected as ER-CBD or ER-eDoc formats.

Report format

Provides a read-only view of the format used to generate the attachment. To modify this value, use the Edit format menu item.

Target output format

Specifies the output format of the generated attachment. The available options depend on the selection in the Generate from field:

Generate from Target output format
ER-CBD format Default (*)
Microsoft Word
Microsoft Excel
PDF
XML
ER-eDoc format Default (*)
Microsoft Word
Microsoft Excel
PDF
XML
Docentric report template Microsoft Word
PDF
TIFF
XML
SSRS report design CSV
Microsoft Excel
HTML4.0
Image
MHTML
PDF
XML
Microsoft Word

(*) Default means that the output type is defined by the ER format configuration.

If not generated

Specifies the action to take if no document is generated based on the rule. You can cancel printing (and raise exception), or continue processing  with or without the warning.

Print as

Specifies how to combine the generated attachment with the master report document. Available options are:

  • Separate attachment: Attachment generated based on this rule is created as separate file alongside the master report document.
    Note: This option is supported for Email and File print destinations and for any file format. For the File print destination, separate attachments are automatically compressed into a ZIP file. For the Email destination, ZIP compression is applied according to the ZIP Settings.
  • PDF attachment: Attachment is embedded into the master report document. This option is applicable only if the output format of the master report document is PDF.
  • Merged attachment: Attachments are merged with the master report into a single document. This option is applicable only when the report output format is PDF. Supported attachment formats include PDF, Word, and Excel, with the latter two being automatically converted to PDF during the merging process.

If not valid output format

Specifies the action to take if the generated attachment doesn’t have a compatible format for the selected Print as option. Available options are:

  • Skip without warning
  • Skip with warning
  • Cancel printing

Display name

Specifies the filename (without the file extension) assigned to the generated attachment. You can use Placeholders to customize the attachment file name. The file extension is determined by the selected Target output format.

Resulting attachment name

Displays the final file name of the generated attachment, including the file extension. This field is read-only and represents the result of Display name and File type.

Rule order

Specifies the processing order of the rules. Rules are processed in the order in which they appear in the grid. Use the Up and Down buttons to change the order.

Placeholders

Placeholders can be used to customize the generated attachment file name specified in the Display name field. You can enter placeholders manually or insert them by using the Insert placeholder button.

In addition to common and report-specific placeholders, you can use @ER_FORMAT_DEFINED_FILENAME@, which represents the file name defined in the ER format configuration.

When inserted using the button, the selected placeholder is added to the end of the currently active Display name field.

Examples

Here are a few examples showcasing possible use cases for generated report attachments.

Example 1: Generate Peppol electronic invoice together with Customer invoice to File print destination

Prerequisites:

  • At least one ER format configuration for e-invoice is imported. Peppol Sales Invoice is used here.

Rule: Generate from ER-eDoc format as a separate attachment.

Result: You get more than one output file from the report execution, so they are saved to file as: (1) ZIP file with the (2) report in PDF format and (3) XML file as separate attachment, in the Attachments sub-folder.

Example 2: Generate ZUGFeRD / Factur-X compliant electronic invoice to Screen print destination

Prerequisites:

  • ZUGFeRD Sales invoice ER format configuration is imported.
  • PDF is used as the Output file format in Print destinations settings
  • PDF/A-3 is set as PDF/A conformance level

Rule: Generate from ER-CBD format as a PDF attachment.

Result: ZUGFeRD / Factur-X compliant report with embedded XML file is created.

Reference: Report format for commonly used reports

The table below illustrates common sources and setup to be used for generating the report attachments. With the exception of Docentric report template column, this is a representative list of standard Microsoft configurations; it does not include all available formats, country-specific reports, or third-party configurations.

See also

Report Attachments >>
Attachment Loading Rules >>
ZIP Settings >>

IN THIS ARTICLE