reportRun.parmReportContract().parmReportServerConfig(SRSConfiguration::getDefaultServerConfiguration());
SrsReportRunService reportRunService = new SrsReportRunService();
reportRunService.parmLocalMode(false);
Microsoft.Dynamics.AX.Framework.Reporting.Shared.ReportingService.ParameterValue[] parameterValueArray;
Map reportParametersMap;
reportParametersMap = reportRunService.createParamMapFromContract(reportRun.parmReportContract());
parameterValueArray = SrsReportRunUtil::getParameterValueArray(reportParametersMap);
SrsReportRunPrinter printer = new SrsReportRunPrinter(reportRun.parmReportContract(), parameterValueArray);
printer.parmSrsProxy().parmReportExecutionInfo(executionInfo);
System.Byte[] reportBytes = printer.parmSrsProxy().renderReportToByteArray(reportRun.parmReportContract().parmReportPath(),
parameterValueArray,
SRSReportFileFormat::PDF,
printSettings.deviceInfo());
System.IO.File::WriteAllBytes("c:\\temp\\test.pdf", reportBytes);
If you need a stream instead, it should be trivial to create one with the byte array using the .net framework.
No comments:
Post a Comment