SSRS throwing an error when subreports have no data - reporting-services

I have an SSRS master report which includes multiple sub reports (with few parameters passed from Main report, sub reports have graph and tablix)
One of the combination of parameter's on sub reports results in no results in dataset on sub-reports. I have set no data message on these individual sub reports.
The problem is that when i run the main report with this combination it doesn't display this no data message but instead throws "An internal error occurred on the report server. See the error log for more details. (rsInternalError)" message
When I run these individual reports with same combination of parameters, I get the no data message displayed correctly.
I tried my best to find solution online, but couldn't find any.
Any help would be useful. Thanks in advance!!

My sub report was not having a data-set and as a result it was throwing an error on main report.
I added a dummy data set in my sub-reports, using an existing data-source with query.
SELECT ' ' AS DUMMY
and then added text box in my sub-report to display this dummy field.
=First(Fields!DUMMY.Value, "DUMMY")
and it worked after that. Basically I am forcing SSRS to display sub-report even if there is no data.

Related

Problem with changing order of parameters in a SSRS Report

Adding a new parameter between parameters or reordering parameters in a ssrs report breaks it.
Using text only, can't upload any images... (Failed to upload image; an error occurred on the server)
I created a report that works using the cube "Analysis Services Tutorial".
Parameters: City, State-Province.
Table: State Province, City, Internet Sales Count
This report works fine, but when I change the order of parameters to:
State-Province, City
Then I get that error when previewing the report:
An error has occurred during report processing.
The Value expression for the query parameter 'CustomerCity' contains an error: The expression references the parameter 'CustomerCity', which does not exist in the Parameters collection. Letters in the names of parameters must use the correct case.
One solution that I currently see is modifying the content of the rdl-file.
Hope anyone has any other ideas/solutions what I can do...
Ah well only need to change the order of the parameters in the DataSet and with the context menu on right click I can also move the parameter up/down.

SSRS (Sequel Server Reporting Services) subreports returning "Error: Subreport could not be shown.""

I am using SSMS 18.5 (fully patched).
I have a report with three (parameter selections; date which is used to select from a list of available items in the second parameter, which in turn is used to make a selection from the 3rd parameter. This report works! When I call it as a subreport from a master report (using the insert subreport), if there IS data found based on the three (03) parameters I pass it, I get the intended results. If no data is found, I receive the "Error: Subreport cannot be shown." Error. THIS IS OK.
My intent is to call this subreport multiple times with different parameters to list out the different result sets.
My question is how do I condition the subreport call in the master report to not show the error message?
Psuedo code for the visibility option:
(IIF(returned value = error message), true, false)
I have tried this directly in the subreport properties (Visibility). I have tried putting the subreport call in a rectangle and I have tried putting it in a table / matrix.
There is NO "field" to reference or rowcount that I am aware of. SSMS only allows reference to items at the same level or higher and not lower (the subreport).
A specific expression ( IIF() ) with an explanation would be appreciated. I have read numerous articles and tried them all with no results.

MS Access: Chart in report blank when underlying query has a parameter

I have a report in MS Access 16 with a chart in the Report Footer. The chart and the report have the same data source - a query ("Pipeline Query"). One of the criteria in Pipeline Query refers to a Combo Box on a form (Qtr = forms![Main Form]![Choose_Pipeline]).
The report and the chart at the bottom look great, however I get a popup saying
"The Microsoft Access database engine does not recognize 'forms![Main
Form]!Choose_Pipeline' as a valid field name or expression."
To fix that, I set a Parameter on the query for forms![Main Menu]![Choose_Pipeline]. This does eliminate the error message, but now the chart is blank! The query still returns the correct data and the data sections of the report work just fine.
Is there something with query parameters that interfere with charts in reports? Is there a workaround?
Update: When I wrote this I could have sworn the chart looked fine if the form reference was in the criteria but not the parameter. Now I can't replicate that and any time the query is dynamic and refers to the form at all, the chart is blank.

To suppress whole main report when sub report has no data

I have a SSRS 2005 report with 4 sub reports embedded.I have a situation where when all the sub reports have empty data the main report is still getting displayed . The main report has a header with header name coming from main data set,so i am getting only report header with empty page.I am using data driven email subscription to deliver the report.
Is there any way wherein the whole main report can be suppressed when all the sub reports has no data either during report generation stage or while rendering the reports by email subscription or in any other way?
Put the 4 sub reports inside a List container. Tie the list container to a new dataset you create that will return either one row if there is going to be data in the 4 subreports, or no rows if there will be no data. Set the no data returned behavior of the List to whatever you want.

SSRS Object reference not set to an instance of an object

I'm working on a complex SSRS report that contains a number of subreport, with a total of five levels of nested sub-reports. This is a lot, but necessary due to the complicated nature of the top level report.
I've encountered an odd error with the last subreport I've added:
Warning 1 [rsErrorExecutingSubreport] An error occurred while executing the subreport 'ThingRateQuotaWrapper' (Instance: T0R0S0S1T0R0x0S0): Object reference not set to an instance of an object. C:\Users\mmxxxxxxx\Documents\Visual Studio 2012\ThingsReporting\ThingsReporting\Thing 2014 Consolidated Report.rdl 0 0
The problem here is that when I run the second level report (one of the reports contained in the top level "consolidated" report), everything works fine. But in the top level report, I get this unepected error.
The specific subreport mentioned is four levels down from the top report, so I would expected the second level report to fail if there was an issue, however as just mentioned that works perfectly.
In addition, the RDL and line number mentioned in the error message tells me nothing useful.
I've tried everything I can think of to solve this problem, including deleting, saving, re-inserting and configuring all the subreports from the ThingRateQuotaWrapper upwards. At this point I can think of nothing else to try that makes any sense.
How can a report fail because of a sub report four levels down, when other reports in between work correctly?
Anyone got any ideas or tips? I'm using SQL Server 2012 Business Intelligence and Visual Studio Premium 2012.
I've solved this problem, however I don't entirely understand the solution so I welcome any comments which might expand on it.
My approach was to look through each expression in the set of reports and subreports that make up my consolidated report, looking for any that might fail for any reason. I discovered that the visibility expression for the tablix row which contains the ThingRateQuotaWrapper subreport had the dreaded red squiggly line beneath it.
I believe the cause of the field warning is that the visibility expressed used a dataset other than the primary dataset of the tablix. I reworked the tablix dataset to contain the required column to determine visibility of the subreport, then updated the visibility expression to use the new column in the primary dataset. This fixed the problem.
This issue still impact SSRS in Visual Studio 2017 when renaming a sub-report.
Delete all the object in the \bin\ folder and VS will rebuild it without the error.
In my case, sub report's name had been changed (params and everything were correct) just name had been changed. Lead to this error.
This tends to happen when you change the names on reports. I accomplished this by deleting the .data files in my project directory as this stores the cached data of your reports. Then restart visual studios and the problem should be resolved.
In short:
Delete .DATA files in directory
Restart Visual Studios
Hope this helps.
Thanks
Gavin
To anyone coming to this old thread, I had the exact same error message with the following configuration:
Main report (top parent level report) calls 5 sub report hierarchy deep
The sub report is crashing only when generating from the Main report. Everything is fine when calling from each sub report level (all!) including the sub report itself
Pre-requisite explanation
The business wants me to show either a Bar chart OR a textbox on a dedicated condition.
To avoid empty spaces produced by a ReportItem (my subReport outputing a bar chart) that is hidden, I usually put them inside a Tablix and manage the Row visibility. Like that, no empty spaces is generated !
Old structure causing issue
I have one tablix with two rows :
The first one contains my sub report outputting a bar chart
The second one contains a simple TextBox
The tablix's dataset is a dataset containing the Textbox's text value (and that's the key of the problem !)
New structure fixing the issue
I have now 2 tablix :
One tablix with a dummy dataset ("SELECT 1 as 'Dummy') associated to the tablix. This tablix calls the bar chart's sub report
A second tablix with the same dataset as before (containing the Textbox's text value)
UPDATE 29.06.2022
The solution described above worked without RowVisibility condition. As soon as I've added my expression it fails again :
=IIF(RowNumber("myDataSetName")=0, True, False)
Solution: replace by this condition instead :
=IIF(Count(Fields!MyFieldName.Value) = 0, True, False)
This produces the same : When there the SQL query returns no row, I want to hide it.
It's very strange that SSRS doesn't tell my expression is wrong somehow, and last but not least, it's very weird that the expression works in all report levels except from the Main report. Either an expression is wrong or not.
Looks like a bug in SSRS (SQL Server 2017...maybe it's fixed in SQL Server 2019)