SSRS - Report item not linked to a DataSet - reporting-services

I an having an issue in SSRS.
I am using SSDT 2015.
Step 1:
I am using reporting services project.
Created a Report
Added a Data Source
Added a Data Set
Step 2:
I'm adding a parameter/Expression, but if I go to available value and try to add a data set field it is showing me: "Report item not linked to a dataset."
I was working with SSRS previously for 20 days and it didn't happen.

For anyone still experiencing this problem, if you click on the rectangle (the white background, not any of the elements on top of this), and you should see the grey borders appear. If you then right-click on the top-left of the grey borders, and select 'Tablix Properties', you can then link your tablix to your dataset, by changing the 'Dataset name' drop down to the name of your dataset.

You either need to set the parameter to get values from a query, or you can use an aggregate function (e.g. first()) to get the first value from a dataset that the item is not linked to. That would be:
=first(Fields!ActorID.Value, "dtsActor")
Also, yay WiseOwl.

Related

Report Item not linked to a Dataset - tablix in Visual Studio 2015

I am trying to create a Report in SSRS and I have the below Table grouped by Closer -
I am trying to add a Pagename so each tab is separated by the Closer name when exported to Excel. When I go to Pagename in Table properties and click on "Expression" , I get Report Item not Linked to a Dataset for fields. How do I get to see the fields so I can pick it.
Any help would be greatly appreciated.
Thank you!
JHegde
The value for Pagename is set via the Tablix properties of Closer. Expand the "Group", the subgroup "PageBreak" appears, now set the value for the Pagename here.
Pagename can only be used in headers or footers.
Make sure within your Row Group properties of closer you have ticked "set between each instance of a group" - this creates the page tabs when exported to excel.
Click on a row or column header in the tablix and then click the tablix selector handle (4 pointed arrow) in the top left corner. This is just to ensure you have the tablix selected correctly.
Hit F4 and you should the datset property in the properties pane.
Select the correct dataset from the drop down list.
To be honest I'm surprised you are getting this error, as you have fields in the tablix and row groups already setup up. To do this, would mean you almost certainly had the dataset correct at the time. It could be that the setting was accidentally deleted I guess.. Anyway, try this and let us know how you get on.

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

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.

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)

Passing Parameters In SSRS

I have 5 reports, which I need to render on seperate pages of an Excel Workbook, so I have created a Master report and intend to call them as subreports. This works perfectly, but the problem is that I need to control the name of each worksheet, and I believe that the trick here is to use a rectangle, and set the PageName property to the desired name of the worksheet.
The issue is, that as soon as I place the subreports inside a rectangle and add a Page Break or a PageName, when I run the master report, I get an error saying One or more parameters were not specified for subreport _____
The same thing happens if I put the sub report inside a list.
How do I either pass the parameters in via a rectangle, or name the worksheets without the use of a rectangle?
I am using SSRS 2008R2
I have got to the bottom of this, and it appears to be the most bizarre SSRS bug. Once you move the subreport inside a list or rectangle and add a Page Break, SSRS flips the date format of the date parameters, and hence you end up passing in values that SSRS does not recognise as dates.
Even more obscure, If you pass flip the date values so that the report succeeds, the next time you run it, SSRS flips them back the other way, and then then they stay flipped that way until you exit the report.
Go back into the report and repeat the steps above once more. I will raise this on Microsoft Connect.

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.