SSRS Detail members can only contain static inner

2019-04-08 18:49发布

问题:

I am developing an RDL in SSRS 2008 and am trying to move a subreport table directly into a main report so that I instead run this subreport in the same stored proc as my main report.
However, I'm having trouble hooking this up. I got the stored proc to run successfully. But now when I try to copy this table into the main report I get the following errors:

Error   1   [rsInvalidDetailDataGrouping] The tablix ‘table2’ has a detail member with inner members. Detail members can only contain static inner members. \\operations\userfiles\R15D\Documents\Visual Studio 2008\Projects\Test\Test2\DischargePlan.rdl  0   0   

Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope

How do I do this? I have tried various workarounds I found on the internet but none have worked. I have tried moving the table into the group level and deleting the details grouping. I have removed sorting elements, etc. But the only way I got this error to disappear is to delete all of the groupings for this table and all textbox values.

回答1:

If these are being returned from the same SP, then you should only have one Detail group (and one tablix).

The detail group (on your outer tablix) will be repeated once for each row returned by your dataset. A tablix contained within that row for the same dataset doesn't make sense: what would it repeat?

It sounds like you need to combine your two tablixes into one, not nest one in the other.

The easiest approach is probably to add a group to the parent tablix which will take the place of the former detail group. It will probably group by whatever field you joined to your old subreport dataset (or something similar.)

Then put your old subreport fields in the detail rows.