如何根据打印介质类型设置报表参数?
How can I set a report parameter based on the print medium type?
我需要根据生成报告的印刷媒体切换我的 SSRS 报告中的某些演示文稿。
我必须为一堆报表(SalesInvoice、SalesConfirm、SalesQuotation)执行此操作。
问题是我找不到可以访问这两种东西的访问点:
- 在 SalesInvoiceJournalPost class 我可以访问印刷媒体但不能访问 SalesInvoiceContract
- 在 SalesInvoiceController 中 class 我可以访问 SalesInvoiceContract,但打印设置给我错误的值
在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
);
我需要根据生成报告的印刷媒体切换我的 SSRS 报告中的某些演示文稿。
我必须为一堆报表(SalesInvoice、SalesConfirm、SalesQuotation)执行此操作。
问题是我找不到可以访问这两种东西的访问点:
- 在 SalesInvoiceJournalPost class 我可以访问印刷媒体但不能访问 SalesInvoiceContract
- 在 SalesInvoiceController 中 class 我可以访问 SalesInvoiceContract,但打印设置给我错误的值
在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
);