I need to toggle some presentation in my SSRS Report based on the print medium the report will be generated on.
I have to do this for a bunch of reports (SalesInvoice, SalesConfirm, SalesQuotation).
The problem is I can't find an access point where I have access to both things:
In SalesInvoiceJournalPost.init
I try:
printSettings = SysOperationHelper::base64Decode(chainFormletterContract.parmPrintersettingsFormletter());
printDestinationSettings = new SRSPrintDestinationSettings(printSettings);
if (printDestinationSettings.printMediumType() == SRSPrintMediumType::Email)
{
// Can't access Report Parameter from here
}
In SalesInvoiceController.main
I try:
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
);
Turns out you can get the SRSPrintDestinationSettings from the controller after all with a few degrees of separation. This is SalesInvoiceController.outputReport
:
PrintMgmtPrintSettingDetail printSettingDetail;
SRSPrintDestinationSettings printDestinationSettings;
printSettingDetail = formLetterReport.getCurrentPrintSetting();
printDestinationSettings = printSettingDetail.parmPrintJobSettings();
salesInvoiceContract.paramMyValue(
printDestinationSettings.printMediumType() == SRSPrintMediumType::Email
);