Playing with SSRS report in dynamics ax 2012

here is the simple code that i have created to print the SSRS report in dynamics ax 2012 from different scenarios.

How to print the SSRS report in dynamics ax 2012 from code.

    SrsReportRun srsReportRun;

    // initiate the report.
    srsReportRun = new SrsReportRun ("InventTruckTransactionReport.PrecisionDesign1");
    // set parameters name, value.
    // suppress the dialog

    if( srsReportRun )
        // run the report 

How to save the SSRS report to PDF/HTML through code in dynamics ax 2012.

    SrsReportRun srsReportRun;

    srsReportRun = new SrsReportRun("InventTruckTransactionReport.PrecisionDesign1");


    // Print to a file named ReportExample in HTML/PDF format.

    if( srsReportRun )

14 Responses to Playing with SSRS report in dynamics ax 2012

  1. Wim Van hoorde says:

    Hi Amir,

    This works fine as long as you don’t want to show data from another company. The X++ code takes the data from the company which is defaulted in your user options.

    How can I pass the company info so that the data from the correct company is shown. Passing the company parameter wasn’t succesfull in my case (maybe I messed it up myself :)).



  2. luca dallari says:

    Do you know how to save SSRS report that use FormLetter framework (for example SalesInvoice) to file?

  3. Hathout says:

    My reports were created in 2008 , it has no design name. How can I call from this codemy report name just “TDPInv “

  4. Hathout says:

    I Solve my Problem … Just add to the Report name PrecisionDesign1 , it will just read Correctly

  5. oslebeto says:

    hi, thanks for this method but, how is the process if i want to set a value in a report in a field of a query but not in a parameter own of the report?

    This question is because i have to generate a report automatically with a number of vendors inserted into a table and this field “AccountNum” is in a query of button to select of form to report parameters

      • oslebeto says:

        Thank for your answer,

        In this moment, i doing the test, I want send automatically a report by mail and i want take the mail of the customer that is set in the query, but this process is by code, because the user set a range of customer and system have to send a report to which one of the customers parametrized in the query, where I can change this functionality for to send the email?

        thanks very much…you know that the change between Ax 2009 and AX2012 is very large in reports!!

  6. aslam says:

    I am knew to AX,Can you tell me about what is the mean of Financial dimension
    why we use it ..base leval not in ax general words
    If anyone can help me understand this linking I would greatly appreciate it. I will check back for any replies or you can email me at Thanks

  7. MadPro says:


    I need email reports PDF by button. Can you give idea ” how manage bundle of report PDF at run time and email it email id ” like employees salary slip pdf to email.

  8. Eduardo Cabrera says:

    Hi !!, I have a problem beacuse when I wrote the code works very well, because I am a Administrator but for user can´t run the report, Do you know why ????

  9. raju says:

    how to create item in ax 2012

  10. David says:

    Hello, I have this output error message while runing:

    SRSReportParameter object not initialized.


    SRSReportRun report = new SRSReportRun(“report.Design”);



  11. Knight says:

    hello, how can i change the payslip pdf output default name from “payslip_0001_01-04-2016_30-04-2016” to show only 0001 , “0001” is the id.

    in other words, i have 950 employees , when i go to Payroll + Inquiries + Employee payslip
    and then generate all active payslips then I press “more options” and save.

    all payslips names as “payslip_id_paydate_endpaydate”.pdf

    i want it to save only the ID.

    any help please

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: