Показать сообщение отдельно
Старый 12.10.2018, 15:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
goshoom: Printing reports from code in D365FO
Источник: http://dev.goshoom.net/en/2018/10/pr...ode-in-d365fo/
==============

A comment below my blog post Printing reports from code in AX2012 asked me to provide an example for D365FO. Here is it.

The code is virtually identical. Only writing a file to a shared folder doesn’t make a good sense in cloud, therefore I changed the code to return the file to user for download.

SrsReportRunController controller = new SrsReportRunController();SysUserLicenseCountRDPContract rdpContract = new SysUserLicenseCountRDPContract();SRSPrintDestinationSettings settings; // Define report and report design to usecontroller.parmReportName(ssrsReportStr(SysUserLicenseCountReport, Report));// Use execution mode appropriate to your situationcontroller.parmExecutionMode(SysOperationExecutionMode::Synchronous);// Suppress report dialogcontroller.parmShowDialog(false); // Explicitly provide all required parametersrdpContract.parmReportStateDate(systemDateGet());controller.parmReportContract().parmRdpContract(rdpContract); // Change print settings as neededsettings = controller.parmReportContract().parmPrintSettings();settings.printMediumType(SRSPrintMediumType::File);settings.fileFormat(SRSReportFileFormat::Excel);settings.fileName('UserLicenseCount.xlsx'); // Execute the reportcontroller.startOperation();








Источник: http://dev.goshoom.net/en/2018/10/pr...ode-in-d365fo/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.