如何根据打印介质类型设置报表参数?

How can I set a report parameter based on the print medium type?

我需要根据生成报告的印刷媒体切换我的 SSRS 报告中的某些演示文稿。

我必须为一堆报表(SalesInvoice、SalesConfirm、SalesQuotation)执行此操作。

问题是我找不到可以访问这两种东西的访问点:

SalesInvoiceJournalPost.init我尝试:

printSettings = SysOperationHelper::base64Decode(chainFormletterContract.parmPrintersettingsFormletter());
printDestinationSettings = new SRSPrintDestinationSettings(printSettings);

if (printDestinationSettings.printMediumType() == SRSPrintMediumType::Email)
{
    // Can't access Report Parameter from here
}

SalesInvoiceController.main我尝试:

printDestination = formLetterController.parmReportContract().parmPrintSettings();
salesInvoiceContract = formLetterController.parmReportContract().parmRdpContract() as SalesInvoiceContract;
salesInvoiceContract.paramMyValue(
    // this is always false because printMedium is always Screen
    printDestination.printMediumType() == SRSPrintMediumType::Email
);

事实证明,您可以从控制器获取 SRSPrintDestinationSettings,毕竟有几度的分离。这是 SalesInvoiceController.outputReport:

PrintMgmtPrintSettingDetail printSettingDetail;
SRSPrintDestinationSettings printDestinationSettings;

printSettingDetail = formLetterReport.getCurrentPrintSetting();
printDestinationSettings = printSettingDetail.parmPrintJobSettings();
salesInvoiceContract.paramMyValue(
    printDestinationSettings.printMediumType() == SRSPrintMediumType::Email
);