web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Having issue with subreports in an SSRS reports. Anyone have any ideas?

(0) ShareShare
ReportReport
Posted on by 2,007

I know adding subreports to an SSRS report in AX is a voodoo art, but at one point in time, I had this working and it has only been since I have made changes to my original report design that it stopped, but from where I sit, I don't think anything significant has changed, so if anyone can see what I'm not, it would be much appreiated.

The scenario: I have a report DP that has four temp tables that it is serving out for this one report. Three of the temp tables are on the main report and for the fourth, we only want to show the values that are in the fourth temp table that match the InventRefTransId that is associated with a particular PmfProdCoBy record. This record populates one of the three temp tables and we need to pass that value to the subreport that is nested inside the tablix that uses that temp table as a data source. In a perfect world I would like to nest a tablix inside the tablix, but when you do that, SSRS forces you to use the parent tablix data set, so that's why we are using a subreport. 

Here's the weirdness--if I add the fourth temp table to the main report and create a tablix using it as the data source, the data appears without issue. However, if I attempt to pass the InventRefTransId to the subreport, I get a blank subreport--I was able to confirm this by putting an error message in the "NoRowsMessage" property of the subreport. 

I have turned off dynamic filters on the subreport and created a parameter to accept the InventRefTransId value, and at one point in time this subreport worked, but now it doesn't and I am at a loss as to why.

If anyone has any ideas at all as to what I am missing here, I would love to hear them.

Thanks.

Brandt

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,805 Most Valuable Professional on at

    Does your subreport work if you call it separately (with parameters that you ultimately want to get from the parent report)?

    Does the subreport work if you keep just some trivial controls there? (E.g. just returning parameter values; that's a useful thing for debugging.)

  • Brandt Fundak Profile Picture
    2,007 on at

    Martin,

    If I run the subreport via Reporting Services and feed it a parameter, the report renders. It doesn't populate any data because I am circumventing the DP and as such there is no data to be rendered.

    When I run the report as a subreport in AX, I get nothing back. I added another Tablix to my main report to see if I could get it to render in a different tablix (the tablix it currently resides in had its dataset changed) and when I do that I get the "Error: Subreport could not be shown."

    I have verified that my main report has the parameter correctly spelled and is passing the proper field from the dataset to the subreport, so at this point I am not certain where I should look.

    Brandt

  • Victor Bui Profile Picture
    30 on at

    To Martin's point, you have test the subreport first, and make sure it works first before calling it from main report. 1 way to test is set your result temp table to Regular table, and populate dummy data.

  • Brandt Fundak Profile Picture
    2,007 on at

    To Martin's point, I did as you suggested and changed the table type and threw some dummy data in there.

    At first, I did not get a result. Then I changed my client settings on the system hosting my visual studio software so that it pointed to the correct company. Once I did that, I could see the dummy data.

    I am assuming that when I disabled the dynamic filters for the subreport, I need to manually set the DataAreaId for the subreport by passing the AX_Company parameter of the main report to the subreport.

    I'll give that a shot and see what happens, but if you have other suggestions in the meantime, I am all ears.

    Brandt

  • Brandt Fundak Profile Picture
    2,007 on at

    So I tried passing all of the parameters from main report to subreport and did not see a change in the behavior. However, I did notice that when running the report through the debugger that when my subreport data source is generated, the DataAreaId on the records is 'DAT' and not the company I am in when I am running the report. Does this make a difference? It doesn't seem to be a problem for the three data sources on my main report, but I could see where a subreport may need the correct AX_Company context, but since this table is being generated by an RDP, I am not sure why I would need that context.

    In addition, I made it so my custom parameter does not need a value and set it to hidden and it still doesn't work.

    Any other suggestions?

    Brandt

  • Victor Bui Profile Picture
    30 on at

    In the past, I have encountering problem preview sub report in VS. Instead I deployed them and run the sub report from AX and it should integrate with the AX_Company.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans