最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

将报表打印到电子邮件 / Report printed to e-mail

网络文摘 William 1517浏览 0评论

You can easily send a D365FO report in email just by configuring print destination to Email and setting a few properties.

You can do the same from code, where you can also set the body. You must create an instance of SrsReportEMailDataContract class, fill it values and pass it to SRSPrintDestinationSettings.parmEMailContract(). Here is an example:

SrsReportRunController controller = new SrsReportRunController();
 
controller.parmReportName(ssrsReportStr(SysUserRoleInfo, Report));
controller.parmShowDialog(false);
 
SRSPrintDestinationSettings settings = controller.parmReportContract().parmPrintSettings();
 
settings.printMediumType(SRSPrintMediumType::Email);
settings.fileFormat(SRSReportFileFormat::PDF);
settings.fileName('SysUserRoleInfo.xlsx');
 
// Here we configure the email
SrsReportEMailDataContract emailContract = new SrsReportEMailDataContract();
 
emailContract.parmTo("user@example.com");
emailContract.parmSubject("Security report");
emailContract.parmBody("Hi there! Here is your report.");
 
settings.parmEMailContract(emailContract);
 
controller.startOperation();
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址