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

Ssrs 2008 如何根据打印介质类型设置报告参数?,ssrs-2008,axapta,dynamics-ax-2012,Ssrs 2008,Axapta,Dynamics Ax 2012,我需要在我的SSRS报告中根据生成报告的打印介质切换一些表示 我必须为一系列报告(SalesInvoice、SalesConfirm、SalesQuotence)执行此操作 问题是我找不到一个可以同时访问以下两种内容的访问点: 在SalesInvoiceJournalPost类中,我可以访问打印介质,但不能访问SalesInvoiceContract 在SalesInvoiceController类中,我可以访问SalesInvoiceContract,但是printsettings给了我错误

我需要在我的SSRS报告中根据生成报告的打印介质切换一些表示

我必须为一系列报告(SalesInvoice、SalesConfirm、SalesQuotence)执行此操作

问题是我找不到一个可以同时访问以下两种内容的访问点:

  • 在SalesInvoiceJournalPost类中,我可以访问打印介质,但不能访问SalesInvoiceContract
  • 在SalesInvoiceController类中,我可以访问SalesInvoiceContract,但是printsettings给了我错误的值
SalesInvoiceJournalPost.init
中,我尝试:

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

if (printDestinationSettings.printMediumType() == SRSPrintMediumType::Email)
{
    // Can't access Report Parameter from here
}
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
);
SalesInvoiceController.main
中,我尝试:

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

if (printDestinationSettings.printMediumType() == SRSPrintMediumType::Email)
{
    // Can't access Report Parameter from here
}
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
);

您是否有正在使用的示例代码。在
controller
类中,是否尝试使用
this.parmReportContract().parmPrintSettings()检索打印设置
或与
this.parmReportContract().parmRdpContract(合同)签订的合同