Show a message to the user instead of blank report [duplicate] - reporting-services

I am building an SSRS 2005 report using BIDS. My report filters on date. When the selected date returns no data rows the report is blank, just the title is displayed, no table or column heading.
How can I change this to display a message like No data available. or Report is empty.?

You could set the property NoRowsMessage available on the report's table control like this:
Select the Tablix control and press F4 to view the Properties pane.
Find the NoRowsMessage property and set the value to whatever message you'd like.
You can also to format the message using the Font and TextAlign properties.
Here are some examples of what the report will look like under various settings:
Further Reading: Here is a Technet article on how to Set a No Data Message for a Data Region

Avoid NoRowsMessage and build your own conditional empty row
One problem (or feature if that's what you want) with NoRowsMessage is that it'll literally replace the entire table with just a plain old message string.
Which provides a relatively counter-intuitive end user experience in my opinion. Normally when no data is found by a system, we'd like to know something about what data was being looked for and what it would have looked like.
Instead, based off how to keep the structure of the Tablix when there is no data to show, you can do the following:
Insert New Header Row, outside the group and above the details record.
Right click on the side of the new row and Set Row Visibility
Set Visibility to the following expression which will count the rows inside the current Tablix and only set Visibility to True if there is no data.
=CountRows() > 0
Optionally, merge the cells and add your own message or just display an empty row
Here's a comparison of how the various options will render: (pick whichever look you think best fits your data and use case)

Right-click on whatever databound element(s) you are using in the report and there should be a property NoDataMessage There are a host of options there but the Caption is the first element I would look at.

Related

SSRS: Suppressing hidden row groups on Tablix when exporting to Excel

Can Excel render only the visible row groups on a report?
I have a report [SSRS 2017] that has nested row groups on the Tablix.
The child groups are hidden by default, toggled by a report field. When you run the report, the default view displays just the summary rows.
Folks naturally try to export this to Excel (to work with just the summary rows) and of course When they export to Excel (collapsed or not) they get the grouped child rows:
Is there any way for SSRS to suppress hidden row groups when exporting to Excel (while still having a working toggle on the web version of the report)?
My fallback is to duplicate the report, remove the child row groups altogether, and just link to the "simplified" version of the report for that purpose.
thanks!
I haven't done this before but I have seen the theory for this once.
You would want to add an extra column and use it as the Toggle Item. Then set the visibility for the new column based on whether it's an EXCEL export.
=IIF(Globals!RenderFormat.Name="EXCEL" or Globals!RenderFormat.Name="EXCELOPENXML", True, False)
I haven't seen it work, so I don't know if will work the way you want.
The solution above does not work if you want to hide detail rows shown by drilling down.
For this case there's another way:
Create a boolean parameter to "suppress details" for example ExcelHide.
Create a copy of the tablix you want to hide the details from.
Set visibility parameter of the ORIGINAL tablix to the value of the parameter. This will HIDE this tablix when the parameter is true.
Set visibility parameter of the COPIED tablix to the negated value (not ExcelHide) of the parameter. This will SHOW this tablix when the parameter is false.
On the COPIED tablix, hide all elements you do not want to export to Excel.
When the report is run you set the parameter so you can show the details for regular operation and hide elements to allow successful export to Excel.
Almost there! I achieved this by setting the DataElementOutput property in my Tablix to "NoOutput", then prefixing the following to any fields in the rows I wished to exclude from my CSV export:
=IIf(Globals!RenderFormat.Name="CSV",Nothing,[YourValue])
Hope this helps folk and thanks [#Hannover Fist].

How can I append the results of additional queries to an SSRS report?

I am generating an SSRS report whose results are displayed like so:
I need to append similar query results (same exact query, one different parameter value) to the right of this data, so that one additional result set of data (from a 2nd query) would look something like this (but with different data, of course - this is just copied-and-pasted to show what's needed):
How can I add multiple of these similar-but-distinct result sets so that they can be read from left to right as shown above?
Solution: COLUMN GROUPING
If I have understood your question correctly, you are expecting to show those 3 columns repeatedly for different set of values. All you need to do is put those 3 columns in a group (Column Group) and Group by on whatever "Field/Parameter" you want to it repeat. Let me know how it goes!!
Based on what is written here, this is how I accomplished this:
I created a new report based on the existing one, and then added a Subreport and then dragged the existing (original) report onto it (I dragged "VariancePricebyProduct_Facelift.rdl" onto the subreport in "VariancePricebyProduct_Facelift_WithSubreports.rdl"). Then I selected the context menu item "Subreport Properties" and added a parameter ("Unit"), providing it with a "hard-coded/baked-in" value ("CHOPHOUSE") different from the one to be provided by the user for the main report.
Then, since I want to keep the same date values from the existing report, I added two more parameters to the subreport and set them to use the same values for the date range as those used there in the main report by selecting the "formula" ("fx") button and 2-clicking the appropriate parameter to be used as the passed-in (tramp) value:
That works. Just to make it plainer, here is how it looks at design time:
The mess at the top is "VariancePricebyProduct_Facelift.rdl"; the bit below is a Textbox/Label for the subreport and then the subreport itself.
And here is how the data looks where the original/base report finishes and the subreport begins:

Show a Customized Text in the Prompt List

Goal:
Display the text "All State-Province" instead of "All geographies" at the prompt list in SSRS
Problem:
I tried googling around and in the end I don't know how to solve it.
Information:
*Im using SQL server 2012
I don't use Report Server 2012, but in 2008 the following applies.
It depends on how you're populating your parameter,
If you're declaring the values in a list
Right click on the parameter, and change the label text.
or.....
If you're populating from a query then you need to ensure that the value you're using to populate the label returns "All State-Province" instead of "All geographies".
One way round this would be to set up a calculated field on the query used to populate the dataset
something like
=iif(Fields!LabelText.Value="All geographies","All State-Province",Fields!LabelText.Value)
Then use that field as the label.
I see your update..
What I believe you need to do, is set up a new calculated field on your GeographyStateProvince dataset
Call it NewLabelText.
Then use the expression
=iif(Trim(Ucase(Fields!ParameterCaptionIndented.Value))="ALL GEOGRAPHIES","All State-Province",Fields!ParameterCaptionIndented.Value)
Then as shown in my previous screen print, use the new calculated field instead of ParameterCaptionIndented
You can see your datasets on the left of this picture.

Need help on SQL Server report

I have a question on SQL Server Reporting Services. In fact, I want to know about how to make a particular logic work.
I have a main report which has one sub-report inside it. The report takes an input parameter test_id and accordingly displays the data in tabular form.
When the test_id has a valid value that's matching, it displays the data.
But, when test_id doesn't have a valid value and hence it doesn't match, I get the empty table as below.
TESTNAME TESTDETAIL
Sub-report
TESTPARENTID PARENT DETAILS
I want to know how to display a message "No details found for the test_id" INSTEAD of displaying any empty tables. Only title and subtitle should display.
Objects like Tablix in SSRS have a property NoRowsMessage.
You can set this to display a message if there are zero rows.
Another option is to go into the tablix properties. Under Visibility, select Show or hide based on an expression. You can write an expression here to hide the entire tablix. Just change the name of the field to match yours:
=iif(Count(Field1)=0,True,False)

How do I display 'No data available.' when there are no rows to show on the report?

I am building an SSRS 2005 report using BIDS. My report filters on date. When the selected date returns no data rows the report is blank, just the title is displayed, no table or column heading.
How can I change this to display a message like No data available. or Report is empty.?
You could set the property NoRowsMessage available on the report's table control like this:
Select the Tablix control and press F4 to view the Properties pane.
Find the NoRowsMessage property and set the value to whatever message you'd like.
You can also to format the message using the Font and TextAlign properties.
Here are some examples of what the report will look like under various settings:
Further Reading: Here is a Technet article on how to Set a No Data Message for a Data Region
Avoid NoRowsMessage and build your own conditional empty row
One problem (or feature if that's what you want) with NoRowsMessage is that it'll literally replace the entire table with just a plain old message string.
Which provides a relatively counter-intuitive end user experience in my opinion. Normally when no data is found by a system, we'd like to know something about what data was being looked for and what it would have looked like.
Instead, based off how to keep the structure of the Tablix when there is no data to show, you can do the following:
Insert New Header Row, outside the group and above the details record.
Right click on the side of the new row and Set Row Visibility
Set Visibility to the following expression which will count the rows inside the current Tablix and only set Visibility to True if there is no data.
=CountRows() > 0
Optionally, merge the cells and add your own message or just display an empty row
Here's a comparison of how the various options will render: (pick whichever look you think best fits your data and use case)
Right-click on whatever databound element(s) you are using in the report and there should be a property NoDataMessage There are a host of options there but the Caption is the first element I would look at.