How to Extend Data Sections of DDSP
We have learned here that a design-time DDSP (Docentric Data Source Package) 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.
A document data source schema comprises a document specific data section called MainData. A report data source schema comprises two report specific data sections called MainData and Parameters. Both document and report data source schemas also contain the general data section called GeneralData which applies to all documents and reports.
How to extend standard data sections of a Data Source Package
The MainData data section contains data defined by business logic from the corresponding Docentric DSP (Data Source Provider) class or query. In other words, we have complete control over MainData data section content.
The Parameters data section contains report parameters and can be extended by overriding the addParameters() method of report DSP (Data Source Provider) class.
The GeneralData data section of a document/report data source contains some useful information related to the current company and worker. It can be extended in two ways:
1. We can add additional data to the CurrrentCompany, CurrentWorker or Misc node of the GeneralData data section by overriding the addGeneralDataSectionBaseCompanyInfo(), addGeneralDataSectionBaseWorkerInfo() or addGeneralDataSectionBaseMiscInfo() method of the DSP (Data Source Provider) class.
2. We can completely change the content of the GeneralData data section by overriding the addGeneralDataSectionBase() method of a DSP (Data Source Provider) class.
If we want to extend the GeneralData data section of a data source of a single document/report, then we have to override some of the above methods of the document/report DSP class.
On the contrary, if we want to extend the GeneralData data section of data sources of all documents/reports in our project, then we should introduce a new custom DSP base class for each of Docentric AX sub-frameworks – SSRS, Word documents (Document Template Libraries) and Basic Reports. A new custom DSP base class should inherit from:
- DocDataSourceProviderSrsReporting, in case of Docentric SSRS Reports
- DocDataSourceProviderMailMerge, in case of Docentric Document Template Libraries (Word documents)
- DocDataSourceProviderBasicReporting, in case of Docentric Basic Reports
Each of your Docentric report or Word document should then inherit from this new custom DSP base class.
See also
Docentric Data Source Packages (DDSP files) Overview >>
How to Write a Data Source Provider Class >>
How to Add Additional Data to a Docentric SSRS Report >>
How to Create a Word Document with DSP Class >>