How to Write a Data Source Provider Class

When a new SSRS report design is registered in Docentric report setup, the Docentric Default DSP class is set to be used with this report by default. This class is a part of Docentric AX Framework, and enables reusing of existing SSRS report data sets that are filled by built-in RDP classes or queries.

When to use a custom DSP class

You will create and use a custom Docentric DSP class when you want to:

No matter if you are using Free or Full Edition, we recommend to install an additional model with Docentric SSRS Replicas. It contains custom DSP classes for common reports in D365FO such as Customer invoice and Purchase order. These classes provide report specific placeholders for use in print destinations and also fill Docentric archive contract, so you will fully benefit from improved Print archive. Learn more >>

Assign a custom DSP class to report in Docentric report setup

If you create a custom DSP class for your report (e.g. the DocFreeTextInvoiceReportDSP class for the Free text invoice report), you have to select this class for the report in Docentric report setup.

How to create a custom DSP class

Custom DSP class is an extended class of the Docentric Default DSP class (DocDataSourceProviderSrsReporting) that overrides particular methods. We prepared Visual Studio templates of custom DSP classes for different scenarios.

So, you don’t have to worry about extending the proper base DSP class and implementing (overriding) the proper methods. The VS template will do this for you. Basically, there is only a couple of methods you will deal with:

Check out the Visual Studio templates for DSP classes >>

Docentric AX APIs

For example, to add additional data to a report data source in generateXmlDataSource() method, you will use the DocXmlRecordBuilder class and its methods to quickly add table buffers with all or only particular data fields, field groups, display methods, etc.

We explained this and other classes in detail in the corresponding how-to manual for the AX 2012 product version. Learn on how to use Docentric AX APIs to add additional data >>
Docentric AX APIs didn’t change for the D365FO product version, which means that Docentric DSP classes written for AX 2012 projects are 100% compatible with the new Dynamics 365 for Operations platform. Since Docentric templates are also platform neutral, you can count on almost effortless migration from AX 2012 to the new platform.

You can also explore Docentric replicas of commonly used SSRS reports such as Customer invoice and Purchase order. This way you can learn about designing practices as well as techniques of using Docentric custom DSP classes.

DSP classes can serve not only for adding/removing data to/from an existing report data source but also for reshaping it. For example, you can restructure fields of a data table into hierarchical groups, move ‘header fields’ from a data table for report lines to a header table, break one data table into multiple tables, e.g. into a report header and lines tables.

See also

Docentric Training for Writing Custom DSP Classes >>
How to Use Docentric AX APIs >>
Docentric Data Source Packages (DDSP) Overview >>
Visual Studio Templates for DSP Classes >>