Docentric Data Source Packages (DDSP) Overview

To design a document or report template with the Docentric AX designer we need a document/report data source saved to a physical file. This file is called design-time Docentric Data Source Package (DDSP file).

Report Data Source Package generation is available as a special print destination - Generate DS.
Data Source Packages for Word documents are generated from the Docentric document types setup form.

A design-time DDSP file contains:

  • The XML schema of a document/report data source.
  • Sample data used for offline document/report preview from within Docentric AX Designer.
  • System data such as languages and label translations used for multilingual preview.

Data Source Packages are generated by Docentric AX Framework using the Data Source Provider (DSP) class or query(ies) of a report or a document.

Document Data Source Packages

A document data source schema consists of a document specific data section called MainData and the general data section called GeneralData which applies to all documents and reports.

The MainData data section contains document specific data provided by Data Source Provider (DSP) class or query(ies). Since a document is always generated in the context of the current record of a particular Primary Table, the root node in MainData hierarchical structure always represents the current record of the Primary Table. It contains all those fields and child records that are defined by the business logic from the corresponding DSP class or query. You can learn more about how to write a DSP class here.

The picture above shows the Data Source pane from Docentric AX Template Designer with the MainData data section of the Preview Purchase Order document data source that has PurchTable as a Primary Table.

Report Data Source Packages

A report data source schema consists of two report specific data sections called MainData and Parameters, and the general data section called GeneralData which applies to all documents and reports.

The MainData data section contains report specific data provided by Data Source Provider (DSP) class. The Parameters data section contains report parameters.

The root node in the MainData hierarchical structure is so called ReportData node. It will contain the ReportCaption field and those child records and fields that are defined by the business logic from the corresponding report DSP class. You can learn more about how to write a DSP class here.

In case we re-use a SSRS report data source, the MainData data section contains those data sets defined by the report data provider as direct child records whereas the Parameters data section contains all report parameters defined by the report data contract.

In the report setup you can also optionally include/exclude hidden report parameters from the data source.

The picture above shows the Data Source pane from Docentric AX Template Designer with the MainData and Parameters data sections for the Docentric SSRS PurchPurchaseOrder.Report report data source.

GeneralData data section

A document or report data source consists of document/report specific data sections (MainData, Parameters), but also contains one general data section called GeneralData which applies to all documents and reports. It contains environment data unrelated to a specific report, such as current company and worker info. These data can be used on every template.

 

We can also set up the Include company logo option for generating the Data Source Package for a document or report that will cause automatic inclusion of a company logo in the GeneralData section.

Changing document or report sample data during design-time

We can also use the built-in XML editor to view and modify the template sample data which is part of a design-time Data Source Package. Sample data is always included in Data Source Package and available for all three data sections (MainData, Parameters, GeneralData). This is particularly useful when we want to test the different aspects of the template, meaning that we can preview a document or report against different and editable data values during design-time.

To edit or view the sample data of a data section select the target data section node in the Data Source pane. Click the View sample data button and the XML editor is shown.

For example, let's change the value of the SalesId attribute to ‘99999’.

After clicking the Preview button again, we see the result of this change in the generated document.

Learn about Multilingual Preview and how to work with labels on templates >>

Run-time Data Source Packages

On the other hand, a run-time Data Source Package is produced when a document is generated from its template in the context of a record of the document’s Primary Table or when a report is printed to a selected print destination. In this case a data source package contains the run-time data that is provided by using the same business logic which is used to provide sample data for the design-time Data Source Package. Which data should be included as run-time data also depends on the current execution context, and in case of a report it depends on the report parameter values as well.

Run-time Data Source Packages contain only run-time data without data schema because data schemas are only needed at template design time. The run-time Data Source Packages also contain some system data such as language which affects data formatting.

See also

How to Extend Standard Data Sections of Data Source Package >>
How to Write a Data Source Provider Class >>
How to Make Multilingual Reports and Documents >>
How to Set Up Reports >>
How to Create a Word Document with DSP Class >>

IN THIS ARTICLE