Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 461
pedram Avatar asked Oct 28 '15 07:10

pedram


People also ask

How do you create a sub report?

In the Navigation Pane, right-click the report to which you want to add a subreport, and then click Design View. In the menu that appears, ensure that Use Control Wizards is selected. Open the Controls Gallery again, and then click Subform/Subreport. On the report, click where you want to place the subreport.

What is a sub report?

A Subreport is a report item that displays another report inside the body of a main report. It is basically used to embed a report within a report. Any report can be used as a Subreport. We can pass the parameter into Subreport from Main report.


2 Answers

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.

like image 133
RRaj Avatar answered Oct 12 '22 07:10

RRaj


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.

like image 34
Oceans Avatar answered Oct 12 '22 05:10

Oceans