1

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 the SalesInvoiceJournalPost class I have access to the printmedium but not the SalesInvoiceContract
  • In the SalesInvoiceController class I have access to the SalesInvoiceContract but the printsettings are giving me false values

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
);
Kempeth
  • 1,856
  • 2
  • 22
  • 37
  • 1
    Do you have any sample code you're using. In your `controller` class, have you tried retrieving the print settings with `this.parmReportContract().parmPrintSettings();` or the contract with `this.parmReportContract().parmRdpContract(contract);`? – Alex Kwitny Dec 11 '19 at 16:43

1 Answers1

1

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
);
Kempeth
  • 1,856
  • 2
  • 22
  • 37