Use the PreProcess report to handle the huge data and time out issue for SSRS reports in Dynamics AX 2012 R3
- Extends the DP class from SrsReportDataProviderPreProcessTempDB:
[
SRSReportParameterAttribute(classStr(ClassNameContract))
]
class ClassNameDP extends SrsReportDataProviderPreProcessTempDB
{
TableNameTmp tableNameTmpList;
}
- Write the processReport method:
public void processReport(){ClassNameContract contract = this.parmDataContract() as ClassNameContract;
RecordInsertList dataRecordInsertList = new RecordInsertList(tableNum(TableNameTmp), // table idfalse, // skip insertfalse, // skip database logfalse, // skip eventsfalse, // skip aos validationfalse, // skip RLS validationtableNameTmpList); // buffer where records will be inserted
fromDate = contract.parmFromDate();toDate = contract.parmToDate();
tableNameTmpList.setConnection(this.parmUserConnection());
while select *from orginalTablewhere orginalTable .TransDate>= fromDate&& orginalTable .TransDate <= toDate{
tableNameTmpList.clear();tableNameTmpList.Id = orginalTable .Id;tableNameTmpList.Name = orginalTable .Name;dataRecordInsertList.add(tableNameTmpList);
}
dataRecordInsertList.insertDatabase();}
- Compile CIL
- Refresh dataset in SSRS design.
- Deploy report.
Comments
Post a Comment