Wednesday, 18 April 2018

Multiple design calling in the SSRS Report using controller class in Ax2012

Multiple designs calling in the SSRS Report using controller class in Ax 2012 

·      1. Select DetailSummary enum or Create an enum based on your requirement.
·      2. Create a contract class and use enum parameter.
3. After creating a contract class lookup enable look like below figure.

·        4. Create a RDP Class and implement your logic in the class.
·         5. Now create a controller class like below code.


Class
 
class SampleController  extends SrsReportRunController
{

}

// This method works based on the your input parameter
protected void preRunModifyContract()
{
//contract class initalization
    SampleContract   dataContract;

    dataContract = this.parmReportContract().parmRdpContract() as SampleContract;

// checking parameter value
    if (dataContract.parmReportType() == DetailSummary::Detail)
    {
            // calling report design
        this.parmReportContract().parmReportName(ssrsReportStr(ReportName, DesignName));
    }
    else
    {
// calling report design based on the report parameter
        this.parmReportContract().parmReportName(ssrsReportStr(ReportName, DesignName));
    }
    super();
}


// This main method use for calling default design and run controller class.

public static void main(Args _args)
{
    SampleController       controller;

    controller = new SampleController ();

    //pass the caller args to the controller
    controller.parmArgs(_args);
    controller.parmReportName(ssrsReportStr(ReportName, DesignName));

    //execute the report
    controller.startOperation();
}

No comments:

Post a Comment

Step-by-Step Guide to Restore a SQL BACPAC File - Microsoft dynamics D365 Fin & Ops

 Restore steps for bacpac file in to SQL server - Microsoft dynamics D365 Fin & Ops. Log in to LCS and navigate to the asset library. On...