Friday, February 5, 2021

Extension class for SrsReportDataContract used to run custom design of reports instead of standard in Dynamics 365 finance and operations

In implementation projects its very common requirement to have generate custom report in place of standard reports, hence we need to duplicate the report design and extend controller class to print custom report. its one way of doing it . but there other way we can do by extending SrsReportDataContract class /parmReportName method. 

Please find below example for your reference.

/// <summary>
/// Extension class for SrsReportDataContract. used to run custom design of reports instead of standard.
/// </summary>
[ExtensionOf(classStr(SrsReportDataContract))]
final class JPSrsReportDataContract_JP_Extension
{
    public SRSCatalogItemName parmReportName(SRSCatalogItemName _reportName)
    {
        SRSCatalogItemName reportName;

        reportName = next parmReportName(_reportName);

        if(reportName == (ssrsReportStr(InventSettlementAdjustment, Report)))
        {
            reportName = ssrsReportStr(JPInventSettlementAdjustment, Report);
        }
      
        return reportName;
    }

}


This would be effective and simple to change the report design. hope this helps. I will come up with another interesting blog soon!

 



No comments:

Post a Comment