Hi all,
I'm using the following code from Martin's blog to save a report through X++
SrsReportRunController controller = new SrsReportRunController();
SysUserLicenseCountRDPContract rdpContract = new SysUserLicenseCountRDPContract();
SRSPrintDestinationSettings settings;
// Define report and report design to use
controller.parmReportName(ssrsReportStr(SysUserLicenseCountReport, Report));
// Use execution mode appropriate to your situation
controller.parmExecutionMode(SysOperationExecutionMode::ScheduledBatch);
// Suppress report dialog
controller.parmShowDialog(false);
// Explicitly provide all required parameters
rdpContract.parmReportStateDate(systemDateGet());
controller.parmReportContract().parmRdpContract(rdpContract);
// Change print settings as needed
settings = controller.parmReportContract().parmPrintSettings();
settings.printMediumType(SRSPrintMediumType::File);
settings.fileFormat(SRSReportFileFormat::Excel);
settings.fileName(@'\\share\UserLicenseCount.xlsx');
// Execute the report
controller.startOperation();
This code works fine. But when I replace the report, the contract class and the parm method with my objects, the contract class's value doesn't flow to the DP class. I'm not sure what could be the reason.
I have decorated my parm method with the DataMemberAttribute attribute.
My DP class refers to the contract class.
My report uses the DP class as its datasource.
What else can I be missing.
*This post is locked for comments
I have the same question (0)