0
votes

I have a report containing 3 different subreports (each accepting a different set of parameters), and only displaying one of them depending on the value of a parameter.

When I choose to display any one of them, it gives me the following error:

Error: Subreport could not be shown

I need to have this visibility parameter let me decide which subreport I wanna see, then have the ability to pass the right parameters to that chosen subreport. Is there any way of doing this ?

Here are some screenshots: https://imgur.com/a/n8bKny8

1
Yes, you can do this. What is the criteria for hiding the subreport and what are the parameters used by the subreport? - Harry
@Harry The subreport visibility is based on the value of the main report's parameter which takes a value from 1 to 3 and displays the corresponding subreport. Each subreport is an meta-analysis of the database, so for example, on of the subreports displays column data, and you can specify whether you only want Dimensions or Fact Tables, or if you want to display nullable or non nullable columns, etc. If I open the subreport, it gives me the choice to give it the parameter value, but if I open it as a conditional visibility subreport, it gives me the error I specified. - Random it guy
You would normally get this error if the parameters passed to the subreport are incorrect. How do the parameters get passed to each report? Maybe a screenshot of the report design and parameter settings would be useful. - Alan Schofield
@AlanSchofield oh so I think this is what I'm doing wrong. I didn't know I had to pass parameters to the subreport, I thought the main report displaying it would also give me the scrolling list of different values the parameter can take, like it's the case when I open the subreport on its own. Is there any way to integrate this parameter choice by the user like it would be the case if it were opened alone? - Random it guy
It's probably best if you edit your question and show your report design. Also include details of what parameter(s) the subreports accept and where you expect these values to come from. I suspect this is very simple to resolve but a couple of images will make it much easier to fully understand your issue - Alan Schofield

1 Answers

1
votes

OK, I understand how you have structured the report now. I think the approach is a little wrong. It's like you are mixing two appraoches.

If you are trying to make this like a "Wizard", step-by-step approach, then you could simply change your main report to have 3 text boxes, one for each report, with a "Go to Report" action set. This will simply open the 'subreport' (it won't technically be a sub-report now) and then you can select parameters as normal. Optionally, format the textbox and make it look more like a button.

The other approach if you want to do this all in a single step would be to change the main report have all the parameters that are required across all subreports and allow the user to set them there (in the main report). These parameters can then be passed to the subreport via the subreport properties (parameters tab).

It really depends on the user experience you want to achieve but the simplest option would be the first option.

If this does not help, I'll try to post an example later tonight.