Report references are templates that define how Ventoo Document Merger finds and includes related documents from other Business Central tables. They enable cross-document lookups, such as including shipment notes when printing an invoice.
When to use report references
Use report references when you want to include a report from a related record, not from the document itself. Common scenarios:
|
Scenario |
Description |
|---|---|
|
Shipment notes with invoices |
When printing a sales invoice, include the shipment note(s) for all related shipments. |
|
Invoices with reminders |
When printing a reminder, include the outstanding invoice PDFs. |
|
Purchase receipts with purchase orders |
When printing a purchase order, include related receipt documents. |
Open the report references list
Choose the Search icon (Alt+Q), enter Doc. Merge Report References, and then choose the related link.
Alternatively, open the Doc. Merge Setup page and choose the Report References action.
Create default templates
Ventoo Document Merger includes six pre-configured templates for common scenarios. These templates are automatically created during installation by the Install Codeunit.
If the templates are missing (for example, after a data migration), you can recreate them manually:
-
On the Doc. Merge Report References page, choose the Create Default Templates action.
-
The system creates the default templates listed below.
|
Template code |
Description |
Source |
Target |
|---|---|---|---|
|
SHIP-TO-INV |
Shipments to Invoice |
Sales Invoice Line → Shipment No. |
Sales Shipment Header |
|
INV-TO-REM |
Invoices to Reminder |
Issued Reminder Line → Document No. |
Sales Invoice Header |
|
SHIP-TO-ORDER |
Shipments to Sales Order |
Sales Shipment Line → Order No. |
Sales Shipment Header |
|
INV-TO-ORDER |
Invoices to Sales Order |
Sales Invoice Line → Order No. |
Sales Invoice Header |
|
RCPT-TO-P.ORDER |
Receipts to Purchase Order |
Purch. Rcpt. Line → Order No. |
Purch. Rcpt. Header |
|
CUST-DUE-POST |
Customer Due Posting |
Customer → No. |
Customer Aging Report |
Note Default templates are marked with Is Template = Yes and are read-only. To customize a template, create a copy with a new template code.
Create a custom report reference
-
On the Doc. Merge Report References page, choose New.
-
On the Doc. Merge Report Ref. Card, fill in the fields as described below.
General fields
|
Field |
Description |
|---|---|
|
Template Code |
A unique code identifying this template (for example, |
|
Description |
A descriptive name for the template. |
|
Reference Type |
Determines how the system finds related records. Choose Line Reference to look up via document lines, or Header Reference to look up via header fields. |
Source configuration
The source configuration defines where the system finds the link to the related record.
|
Field |
Description |
|---|---|
|
Source Table ID |
The table containing the link field. For line references, this is typically the document line table (for example, Sales Invoice Line). |
|
Source Filter Field No. |
The field used to filter source records. Typically the Document No. field (default: field 3). |
|
Source Link Field No. |
The field containing the value that links to the target record (for example, Shipment No. on the Sales Invoice Line). |
Target configuration
The target configuration defines what the system looks up and renders.
|
Field |
Description |
|---|---|
|
Target Table ID |
The table containing the related records (for example, Sales Shipment Header). |
|
Target Match Field No. |
The field in the target table to match against the source link value (typically the No. field). |
|
Target Report ID |
The report to render for each matched target record (for example, report 208 for Sales Shipment). |
Configure report filters
You can pre-configure report request page options and filters for the target report:
-
On the report reference card, choose the Configure Report Filters action.
-
The standard Business Central report request page opens.
-
Set the desired options and filters.
-
Choose OK to save the configuration.
The filter configuration is stored as XML and applied automatically whenever the report is rendered during merging.
Tip Use report filters to exclude specific columns, set date ranges, or configure report-specific options that should always apply when the report is included via this reference.
How report references work at runtime
When a global or partner rule uses a report reference, the following happens during document list building:
-
The system reads the source document lines (or header) filtered by the current document number.
-
For each source record, it extracts the link field value (for example, Shipment No.).
-
It looks up matching records in the target table.
-
For each unique match, it creates a document list entry with the target report.
-
Duplicate target records are automatically excluded.