Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Suggested answer

Print Bank Reconciliation Summary in PDF

Posted on by
Hi,
I'm trying to print the Bank Reconciliation Summary in pdf and save it in a specific path when I clicked the reconciliation buttom. When I use the print buttom, it shows a dialog where I select some parameters. I will like to know if its possible to set the values of the dialog by code and save the report in a path:
 
 
Categories:
  • Martin Dráb Profile Picture
    Martin Dráb 225,672 Super User on at
    Print Bank Reconciliation Summary in PDF
    Here is an example of such code, including a parameter and a file path:
    SrsReportRunController          controller = new SrsReportRunController();
    SysUserLicenseCountRDPContract  rdpContract = new SysUserLicenseCountRDPContract();
    SRSPrintDestinationSettings     settings;
     
    // Define report and report design to use
    controller.parmReportName(ssrsReportStr(SysUserLicenseCountReport, Report));
    // Use execution mode appropriate to your situation
    controller.parmExecutionMode(SysOperationExecutionMode::ScheduledBatch);
    // Suppress report dialog
    controller.parmShowDialog(false);
     
    // Explicitly provide all required parameters
    rdpContract.parmReportStateDate(systemDateGet());
    controller.parmReportContract().parmRdpContract(rdpContract);
     
    // Change print settings as needed
    settings = controller.parmReportContract().parmPrintSettings();
    settings.printMediumType(SRSPrintMediumType::File);
    settings.fileFormat(SRSReportFileFormat::Excel);
    settings.fileName(@'\\share\UserLicenseCount.xlsx');
     
    // Execute the report
    controller.startOperation();
    When thinking about the location, don't forget that server code doesn't execute on client's machine, there usually are multiple AOS servers, the process must have permissions to write to the location and so on.
  • Anton Venter Profile Picture
    Anton Venter 9,687 Super User on at
    Print Bank Reconciliation Summary in PDF
    The parameters can be set by accessing a reference of the data contract of the controller class using the getDataContractObject method.
     
    MyContactClass contract = controller.getDataContractObject(); // Change contract class to your type.
     
  • Print Bank Reconciliation Summary in PDF
    Hi Martin, I'm using AX2012. I'm kind of new to this and I have printed reports before but, in this case, is different because in my past reports I dont need to fill parameters and now I have to. If there was a way to print the report and fill all the parameters by code it will be amazing. The process that I do in AX to print manually the report is the following:
     
    1. I click the print button:
     
    2. I fill the parameters and click the Ok button:
     
    The classes that the system is using are this:
  • Anton Venter Profile Picture
    Anton Venter 9,687 Super User on at
    Print Bank Reconciliation Summary in PDF
    Hello,
     
    The thread below has a code example which seems to be working I believe.
     
     
     
  • Martin Dráb Profile Picture
    Martin Dráb 225,672 Super User on at
    Print Bank Reconciliation Summary in PDF
    Which version of AX are you using?

    Fill in parameters in code is possible (maybe you don't even need a dialog if you want to set everything automatically).
     
    How you can handle the path depends on whether you're talking about an on-premises deployment or a cloud deployment.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,420 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,672 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans