Sub report could not be shown. Sub report works separately - Not with Main Report
Asked Answered
M

9

10

I've one main report with 5 sub reports.

Sub report contains more than 10 parameters. (With 10 Multi valued parameters - So I've used Join method to pass value from Main report to Sub Report)

I've also tested Sub report separately and it is all working fine, showing data and everything.

I've tried by making another main report and tried to put that sub report in this newly created main Report but still no success.

I've also checked each and every parameter values and datatypes all are correct as per my store procedure.

I've tried by removing multivalued parameter one by one from Sub report properties to check weather issue is due to this multivalued parameter or what!

When we supply value from main report to sub reprot by using sub report properties - here when I clicked multivalued parameter it comes up with

=Parameters!ParameterName.Value(0) -- (0)

So it is okay or not? As I'm using it as multi selected values.

I'm stuck with this issue and I'm getting below error,

Error: Subreport could not be shown.

Any help please, Thanks in advance.

Please Note:

I've checked this, but No success

I've also checked this, but No success

Getting below error on main Report page,

enter image description here

I've also tried by uploading the all reports on SSRS-2012 but no success.

Meatman answered 28/10, 2015 at 7:24 Comment(1)
Possible duplicate of Sub-Report giving error: Report cannot be shownGosse
C
4

I believe you've actually already found the cause of your problem.

I've also checked this, nut no success

The post you're refering to has the following accepted answer by lethaljd:

This is a known defect in SSRS 2008. I'm not sure if it has been patched yet, but it has been fixed in SSRS 2012.

As you have found, the workaround is to use separate datasets.

https://connect.microsoft.com/SQLServer/feedback/details/648560/subreport-with-shared-dataset-throws-error

If you check the source that lethaljd has provided, it shows that this hasn't been patched either and probably never will be as it is no longer an issue in the newer versions.

This means that you should probably use a newer version of SSRS or think of a workaround. I'd like to help you think of a different approach but as I've stated in my original comment, you'll need to give a lot more information.
As the question is written now, I do not posses enough details to give you any well founded advice other than using a different version.

That being said, I do not wish this answer to come over as nonconstructive or negative. I just merely want to help you on the right track.

Cankerworm answered 27/11, 2015 at 15:35 Comment(5)
I've tried everything, even reports uploaded on SSRS 2012 - issue is still there. And the other thing is that, I am converting all the crystal reports to ssrs reports - and I must need to pass all the parameter's value by query-string. Thanks for the help.Meatman
A few days ago you commented that you would edit your question and add more details. I see you've removed that comment but you still haven't added the necessary information for me to help you further. - Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example.Cankerworm
whatever I have written in my question is what I am doing, I could not provide you more details in that, if you can't provide the help then it's fine. thank you so much for your help and time. I really appreciate it. I am also accepting that I have commented before to provide you more details but somehow it is no possible to provide you whole design, reports data and the code also. so sorry for that. :(Meatman
really thanks. Today I worked on the same and issue has been fixed with changing report server. Even I've tried before by changing the report server but somehow I've not focused on one thing and that is I must need to hide all parameters in all reports Main Report as well as Sub report. Before I've not checked this things and all changes I have made by opening Edit Report Builder of SSRS 2012. It only worked with SSRS-2012 - 2008 has some issue. Thanks a lot. I'm so happy today... I'm accepting your answer as well. ;-) BTW sorry for secretive about what exactly I'am making :D ThnkzMeatman
also after made changes in SSRS-2012 - I've uploaded the same report on SSRS-2008 and it is working fine now with SSRS-2008 also :)Meatman
N
3

Apart from checking the obvious steps as above... (Some might say this is obvious too...) I had to make sure that the parameters' datatypes (in the subreport) matched the columns they match in the main report.

When you have done that and you are still getting an error...

I am assuming you are using VStudio like I am. This is how I clean out the VStudio cache...

Unload the Report Close VStudio Go to the report folder in WinExplorer. Backup the solution folder Now go to the Project folder underneath the Solution folder Notice there are 3 types of files: - .rdl <-- This contains the Report definition... Don't touch this... - .rdl.data <-- Contains the cached data for the report executuion - .rds <-- This is your datasource definition... No need to touch it - .rptproj <-- This contains your project definitions... Don't touch it - .rptproj.user <-- Do not touch this... It contains the credentials for your data source Then you have a bin folder with 3 sub-folders... Debug, Release, and Debuglocal

Here is what you do: Remove all the .rdl.data files Remove all files under bin/Debug/* and repeat for DebugLocal and Release.

This should clean up the VStudio environment. Now open the solution... Reload the solution in VStudio and try again.

This fixed a number of these pesky data cache issues.

Narrative answered 27/4, 2016 at 20:1 Comment(0)
P
1

You should check this:

  • multiple parameters must be defined as multivalue on main report and on subreport (define on subreport to allow multiple values)
  • when you passing multiple parameter to subreport you should pass it like [@param] and not like =Parameters!ParamName.Value(0)

On this blog is explained how to send multiple values to subreport.

Perpetuity answered 4/12, 2015 at 8:38 Comment(2)
I've already checked your first point, about second point - when you set parameter value it will show you like [@param] on UI but inside expression it will be =Parameters!ParameterName.Value(0)Meatman
Try this: edit the expression and make sure it doesn't have a (0) at the end. =Parameters!ParamName.Value is correct, not =Parameters!ParamName.Value(0)Perpetuity
K
1

I've just had the same error, (though I'm not using multi valued parameters) I've added 2 new parameters to the subreport and set the parameter values in the main report.

It turned out to be the parameters in the subreport! My 2 new parameters are for datetime but when these were created by the wizard they were set as Text, once changed to Date/Time everything is working fine.

Kurth answered 23/1, 2019 at 14:27 Comment(0)
H
1

In my case the issue was not passing any Parameter from Main report to Sub report. It was solved once I added the parameter.

Holland answered 27/7, 2021 at 14:42 Comment(0)
N
0

Right click on the dataset, and click Dataset Properties. Go to the tab Parameters. Delete parameter that is not in the right format (i.e. parameter without @).

Napkin answered 6/3, 2018 at 23:29 Comment(0)
C
0

The subreport object path data may be corrupted (this happened to me). Fix was to copy the subreport object in the main report. Then in the main report, reassign the path to the location of the subreport.

Confect answered 22/9, 2020 at 16:50 Comment(0)
S
0

My problem was caused by the local user having admin permissions to see all reports, while the SSRS account used on deployment only had permission to view the parent report and did not have permissions to view the subreports.

The solution was to grant the SSRS account permissions to view the subreports via the SSRS Web Portal Url.

The SSRS Web Portal URL can be found in the Report Server Configuration Manager.

Sellers answered 11/1, 2021 at 16:6 Comment(0)
G
0

If you are running a parameter with date, and the date is set as future date, the report will fail with same error so sometimes, just checking the parameters is enough

Gorgoneion answered 6/8, 2021 at 14:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.