Wednesday, May 21, 2014

Sub Reports within AX SSRS Reports

​So while trying to add a subreport (no parms) to an existing report I discovered some goofy things that need to be followed in order for a sub report to work within AX.



1. Put both reports within the same project (model project within Visual studio)

2. Right Click on the sub report and choose properties. You have to manually type in the report name you want to use instead of being given a dropdown like normal SSRS

3. Include the design name (ReportName.Report, ReportName.PrecisionDesign1, etc...) within the report name mentioned in step 2.

4. Deploy the report to the same folder on the SSRS server (you may need to "move" your report into StaticReports> language> folder)



5. Previewing of subreports does not work within visual studio for AX sub reports. Once you follow steps 1-4 you should be able to add the model to the AOS. Then deploy your modified report and the subreport should show up correctly whenever you call the report from AX.





I sure do hope microsoft has some big enhancements for SSRS in 2015.

10 comments:

  1. Hi Adam,

    Can you explain how to to "move" your report into StaticReports> language> folder?
    I'm trying to make a report with sub-report in AX, but still can't make it.
    I have made both report within the same project in VS, but still got an error "The sureport could not be found at the specified location"
    Can you give me suggestions?

    Thank you in advance,
    Esther

    ReplyDelete
  2. Chuurippu,

    What you do is go to the AX SSRS instance via a web browser. Ex: http://axdevsqlbox/Reports_AXDEV/ Then browse into the "dynamicsax" folder. Once there find the report you want to move, hover the mouse over it. You should see a little arrow appear. Click on that arrow and choose "move". Then just simply choose the folder you want to move it to in the tree structure and click ok.

    If you need to move multiple reports the best way to do this is to click the "details view" (its in the ssrs toolbar on the webpage) and click the check box on each report you want to move then choose the "move" option in the title bar and select which folder you would like to move it to and then click ok.

    That's all there is to it. Let me know if you run into any issues.

    ReplyDelete
  3. Hi Adam,

    Thank you very much for the reply.

    When I go to AX SSRS instance via web browser, I saw that my report is deployed in the same folder, so I'm not moving my report anywhere.

    What I've done is:
    -. Creating main report
    -. Creating subreport in the same project as main report in VS
    -. Adding subreport control in main report
    -. In the subreport control properties, I put the subreport name and design name that I want to use so it's look like this "Subreport1.PrecisionDesign1"
    -. Deploy both report in VS and in AX

    But when I open my report in AX, I still got an error "Subreport could not be shown".
    Can you give me any suggestions how to make the subreport works?

    Thank you,
    Esther

    ReplyDelete
  4. Hmm Do you have any parameters set on the subreport? also is this in the main dynamics ax folder or the static reports folder? What is the name of the report as well? One thing that is good to know is previews of subreports for AX never work in VS they will only work in AX

    ReplyDelete
  5. Hi Adam.

    I found out that my parameters at the subreport causing the sub report not showing in AX. I've deleted the parameters and the subreport running well.
    Thank you for pointing it out. :)

    I wonder though, how to add the parameters to use in the subreport? Can you give me any example?

    Thank you very much,
    Esther

    ReplyDelete
  6. No problem, I honestly have yet to try this with ax. But if its anything like normal SSRS all you do is pass the parm to the main report. Then right click on the subreport and go to properties then parameters. Here is a small how-to from TechNet about it http://technet.microsoft.com/en-us/library/ms160348(v=sql.100).aspx

    ReplyDelete
  7. Hi Adam,

    Thank you very much for your help. I can run the subreport with parameter in AX now. :)

    ReplyDelete
    Replies
    1. How did you get this to work? I'm getting the same error you were getting. I think it's my parameters causing the issue. I have a contract class with parm methods for my parameters on the subreport and I set the Parameters info on the subreport control on my main report. Not sure why it's not working.

      Delete
    2. hey hi Amber,

      Did you get solution for this ?

      I am getting the same error .

      Help would be grateful.

      Delete
    3. i can't remember what exactly resolved it. It was so long ago now. Sorry!

      Delete