Report Builder 3.0 Subreports - Error: Subreport could not be shown

  • Hi all,

    So I continue to delve into the bowels of Report Builder 3.0. My last post was asking about how to create a report such that when I run it a number of pages are created, paging between each row of a query. So if I have a class of students, I want one report card printed per student.

    I understand that to do that I have to have a table, and each row of that table will represent a student, and the printing of each row should be followed by a page break. I have done that, and it works with a simple example.

    Now what I need is for each row to contain my report. The report is pretty complex, containing more than one type of item in it. So I can't just copy from the designer when I'm looking at my older rdl file (the one with the working report for one student) and plug that into the single cell of my table that has page breaks by row in my new report.

    So what I am trying to do is to use the first report as a subreport to the second. I have submitted the first report to reporting services, and I have right clicked inside the single cell of my table and created a subreport. I then went to the properties of the subreport and chose the report from reporting services.

    I also made sure that the new report which calls the subreport has all the necessary visible parameters defined as are needed in the subreport.

    When I click on the Run button, I see the parameters, and enter the data that works in the older report when run by itself. I enter the necessary information and click on the View Report button. After chugging for a few seconds, I see the following:

    Error: Subreport could not be shown.

    I assumed that there was a sizing issue, so I made the report space, table cell, and subreport object larger than the subreport would end up being, but when I run it I get the same issue.

    It could be that I haven't tied the outer report's parameter list correctly the subreports parameter list, but I don't see anything obvious for that, and in my reading I haven't come across that. That doesn't mean I didn't miss something mind you.

    Can someone suggest something I'm doing wrong, or not doing? I am going to be researching this further, but I thought at this point it would be very helpful to have some hints.

    Thanks for the help.

  • So I tried to look further into my problem with the "Error: Subreport could not be shown" error message. I created a very small report that has one text box tied to a dataset that just pulls the top id off a given table and then multiplies it by the one parameter defined. I then created a main report that calls this report as a subreport. The size of the main report's body is much larger than the subreports, and the size of the rectangle in which I placed the subreport object is also much larger. I added a parameter with a different name than the subreport's parameter (though far as I know that doesn't matter) and then went to the subreport's properties and tied it to the sub report which I had saved in Reporting Services, and then added a parameter to the properties giving the subreport's parameter name as Name and the main report's parameter name as Value.

    When I ran this report in Report Builder calling the subreport in RS, I got the "Error: Subreport could not be shown" message. I then clicked View Report again, and got a box (since I had surrounded the subreport's body with a border) and the correct content (the id times the report parameter). But starting the first time always gives me this could not be shown message.

    When I saved my main report to RS and tried running that from there, I always seem to either get this error message or just the box (the subreport's body bordering) without the calculated output amount.

    Can anyone tell me what I may be missing? Why would I get this message (seems every time I first run the report in RB, and much more often when run in RS)? And why would I not be seeing the calculated output amount when I run it in RS, though I see it every time the bordered box comes up in RB?

    Thanks for any input.

  • I'm guessing from the silence that no one has seen this particular issue. Does anyone have any suggestions as to what I could try next in figuring this out? RB doesn't give extremely meaningful error messages, so I don't really know at the moment what my next step would be. Any comment right now would be very much appreciated.

    Thanks.

  • Phew, found the problem. Turns out that when I added a parameter definition to the subreport, I put the name of the parameter, without any other treatment, as the value. I had wondered about the name Value for that field, but that's what I did. I had also tried saying @RP1 (RP1 being the name of the mail report's parameter that I wanted tied to the subreport's parameter), thinking that would definitely say it was a variable, but both of these had been giving me that "Error: Subreport could not be shown" message. I went back into the subreport object's properties window, and clicked on Parameters again, and then clicked on the fx (function) button. I went to Category/Parameters and then double-clicked the RP1 parameter I wanted, and in the "Set exporession for: Value" box, it showed "=Parameters!RP1.Value", and when I clicked OK, the Value field then had the text [@RP1], including the square brackets, which I take it means to use @RP1 as a variable and not a string. Without the square brackets it was being treated as a string, and therefore not being passed by value. Just writing this in case some other newbie comes along and misses this key point as well. Not sure why I didn't see any references to this misunderstanding in other posts.

  • Thanks for the post

  • Thanks for this post, very helpful.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply