How to Speed up Report Writing in Dynamics AX SSRS with the Duplicate Report Trick Part 2A

How to Speed up Report Writing in Dynamics AX SSRS with the Duplicate Report Trick Part 2A

Rapid Report development with Dynamics AX SSRS is all about minimizing the amount of code that you have to write. Remember this tactic: find an existing report in AX that contains data that is similar to what your users want, then duplicate it, and modify the duplicate to suit your needs. If you take the expense of duplicating reports in AX upfront, you will save drastic amounts of reporting time later.

And as you will see – changing the look of a report is not that hard.

Now, here is a checklist for duplicating reports

Type of ItemHow to do it
The Report RDL FileXPO Import/Export Trick, notepad find/replace
Query (if applicable)Right-click in MorphX and hit duplicate, then rename
Temp TablesRight-click in MorphX and hit duplicate, then rename
X++ ClassesXPO Import/Export Trick, notepad find/replace, manual verification
.NET project Dll’sAdd references to the DLL’s
Menu itemsRigh-click in MorphX and hit duplicate than rename, change classes in properties

In Part 2A, let’s start by using the RDL Import/Export trick, notepad find/replace tactic:

  1. Open up Visual Studio 2010
  2. Click File à New à Project
  3. Choose ReportModel and give it any name you want than click OK.

  4. Choose the “Add” option and choose Report.

  5. Now rename your report. One way to do this is to go to the properties pane and change the name. Another way to just right-click on the report and choose rename. Very important: give it some small name followed by an “_”, followed by the original report name. In this case, I’m naming it brandonahmad_VendInvoice. Remember, keep the _vendinvoice part. It will become abundantly clear why this helps later.

  6. Now, save your report project

  7. Now, right-click on it and click Build, followed by Deploy

  8. Now, open up the Dynamics AX client and go to the development screen. Expand SSRS Reports à Reports and find the brandonahmad_vendinvoice report (or whatever you called it).

  9. Right-click on the picture and click Export.

  10. Export it to some location that you can remember and click Save on the dialog box. Make sure that click “OK” at the next screen.

  11. Repeat the exact same procedure as above for exporting the VendInvoice report. When all is said and done, you should have a report folder that looks like this with two exported reports.

  12. Now, there is even more. I didn’t say it was easy to duplicate reports! But remember, it will save you a lot of time overall. Open up each of the reports in Notepad, kind of like in this side by side “dealy” like the picture below.

  13. For the report with the XPO based on the original, titled SSRSReport_VendInvoice in the picture above, delete it’s Origin and replace it with whatever Origin was in your blank SSRS report.

  14. Now, remember when I said that it is really good to use the _ naming sequence. Here is why. Most of the temp tables and queries are named closely with their reports. Using an original name with a beginning underscore makes it really easy to replace the table. Click Edit à Replace. Here, let’s replace VendInvoice with brandonahmad_vendinvoice. After it finishes, save your notepad file and close it. You can save both of them if you like, but we will only be using the one with the replace all(despite the name of the file not changing, it will overwrite the blank duplicate report with the original report data). Note: the only that you need to manually change here if you follow the way that I showed you, and that is only sometimes, is the name of the temp table. Sometimes, the temp tables break the convention, forcing us to do more, but not here.

  15. Open the client up again. Click Command à Import

  16. Browse to the location where you saved the file and click OK.

  17. Right-click on your newly imported version of the report. Click on Compile followed by Deploy Element.

    Done.. You’ve just partially duplicated the report, but it will generate errors if you bring it up now because we haven’t done the other steps referenced in the table above. We will continue in Part 2B.

    Please hang with me!! I promise that it will be worth your while to do this tutorial, not just for your own development, but for what you will be able to deliver to your company at the end of these tutorials.