SSRS '08 Object reference not set to an instance of an object - reporting-services

Full error from Preview window in Visual Studio '08 (BIDS): "An error occurred during local report processing. Object reference not set to an instance of an object."
There are no further errors/warnings detailed in the Error List or Output windows.
Background: On this report I am using a table to display a sub-report [x] number of times, dependant on the number of related objects that exist in the SQL database. That is to say that the sub-report is set within one of the cells (the only cell) of the table, in a row that repeats for each item returned in a dataset.
Removing the sub-report allows the master report to compile and run, so I feel the issue is related to the arrangement of the sub-report. If the sub-report only displays once, then the master report compiles and runs fine, it is only when a second instance is required that the issue arises.
When testing the sub-report separately, it compiles and runs when given the parameters for each instance it is being asked to render from the master report. So I can rule out the idea that the data for the second instance is causing it to fail (in some div-by-0 type way).
Given the lack of detail from the error and that the sub-report works on it's own, I do not understand why this is happening.
Does anyone have any ideas for debugging or suggested solutions?
Thanks
Brian
tldr: Master report fails when a sub-report repeats more than once.

I figured out a solution. The sub-report is being passed 4 parameters, one of these had a value referring to the value a table-cell on the master report. Changing this parameter to be the value of the expression that was setting that table-cell fixed the issue. I have no idea why this is a solution, but it is.
In more detail: [table_cell_a] had an expression computing it's value.
[parameter_a] for the sub report was set as "=ReportItems("[table_cell_a]").Value", when I changed the expression for [parameter_a] to mirror the expression for [table_cell_a], everything worked again.
This is messed up, and I can't even begin to understand why it behaves like this. If [table_cell_a] was not being computed before the calls were made to the sub-reports, I could understand. But if that was the case, how come the report worked when there was only one sub-report?
If anyone can provide an explanation, I would be most grateful.
Brian

Brian,
I'm having a similar issue with charts imbedded in a Tablix. I found this article that seems to address the issue, although I have not gotten the server upgraded yet to actually test it:
http://support.microsoft.com/kb/2639301
Hope that helps.
G

I was getting the similar error after changing the names of reports in my project even though I changed all the updated report names in the Action property.
An error occurred during local report processing. Object reference not set to an instance of an object.
I found a solution by running the dataset of linked report providing the parameter values manually.
I am not sure what difference it made by running the dataset of linked report manually but it solved my problem and I am no longer getting this error.
Thanks
Yogi

Just sharing. In my case, it was not a sub-report. I had the same message when I was accessing a drill-through-report. Apparently, at the "Action: Go to report" > "Specify a report:", I have wrongly pasted the full name of the report with the extension. Removing the ".rdl" extension solved my problem.
Addendum: If the drill-through report name is part of an expression then the .rdl extension is necessary for it to work when hosted in SharePoint. That prevents it working in preview mode, as you've found. Solution is to code to avoid having to use an expression for the report name.

Copy the Dataset and Queries.
Create new report or copy paste Tablix to new report. You will not get the error again.

I had to remove the SubReport and add it again. Then it worked.

I had the same error when I changed the name of the report I drilled to. I did change the name in the action expression to the new name via the properties > Action > Go to Report > (...) > Expression, but that apparently didn't take. When I opened the text box > Properties dialog window instead of using the Properties pane, and changed the drilled to report name within that window, it solved my issue.

Related

Report showing 'The definition of the report is invalid' in SSDT 2015

I have a SSRS 2008 project with some reports, and recently we update the version, now I open the project with the SQL Server Data Tools 2015, and all is fine, I can deploy, edit, update all fine.
The problem comes when I want to create a new report, when I add a DataSet to the report, the preview tab says:
An error occurred during local report processing
The definition of the report 'Report Name' is invalid
and nothing more happens, I can't preview the report anymore.
Does anyone know if it is a issue of upgrade/open a SSRS 2008 solution with SSDT 2015?
After some research... I couldn't find anything.
So I tried to create the report in Reporting Services 2008, and when trying to preview the report after adding a DataSet it show me the same error:
An error occurred during local report processing
The definition of the report 'Report Name' is invalid
But now, it has an aditional line:
The shared dataset definition is not valid. details the required
attribute 'name' is missing
And after enter the first search result in Google, it looks like the problem was that my DataSet was a Shared DataSet, JoannaK found the same problem and also found a workaround:
Found a workaround for now: Create the data set as embedded> Convert
to Shared Data set Looks like the Name property is set when you start
with embedded. report runs and can data sets can be uploaded to the
report server
This solves my problem. Hope it helps someone in the future.
Source: JoannaK from SQL Server Data Tools Preview update for April 2016
SSDT is generating a broken dataset definition. To fix it:
Open up the shared dataset's .rsd file in a text editor.
In the xml therein find the <DataSet> opening tag.
Add the attribute Name (case-sensitive) to that tag, e.g: <DataSet Name="SomeDataSet">
Probably should set the Name to be the same as the filename but doesn't seem to make any difference as far as I can see.
Thanks to the existing answer as without that I never would have got it to work at all.
VS2015 / SSRS2012
I experienced similar error. It mostly occurs as of change in 'SHARED DATASET'.
Check for query fields in 'Shared Database Properties', if no fields are there , simply add fields you have included in your query.
Check for database connection
Check for 'Stored Procedure' and it's result if you have used stored procedure.
One can delete old dataset and re-create with same name.
As a last option, one can create 'New Dataset' (another one) and bind the new one with the report(take care to map all fields again once you choose to create new dataset.

Error after renaming SSRS linked report names

I have changed the SSRS report names in my reporting server projects. I have four reports and four linked reports in this projects. The linked reports are being called by an action setup on a column value where the parameters are being passed to the linked reports. After renaming all the report names I have made similar changes in the Action property in order direct the parameters to the changed report name. I have also saved the changes and re-built the project and have not got any errors. All the four main reports are working fine but the linked reports are trowing the following error while running the reports using preview options in MS Visual Studio 2010
An error occurred during local report processing. Object reference not set to an instance of an object.
I have deployed this to my local report server and on browser I getting the following error
The item '/Unit Reports/OLDREPORTNAME' cannot be found. (rsItemNotFound)
Here you can see that it is still trying to locate it to the old report name not the new changed one.
I have clean, built and deployed the project several times but still getting these errors
Please let me know if I need to make changes in any other files to avoid this error.
Thanks
Within the .rdl search for "OLDREPORTNAME" and replace with "NEWREPORTNAME"...
Take a backup first :-)
I have noticed that when I implement the Action property on the report field, it automatically set-up the same Action property of that text box where the field was defined.
I have found that the text box Action property was still pointing to the old report. I have changed text box Action property to point it to the new report and now my linked reports are working absolutely fine.
Thanks
Yogesh

SSRS Dataset Field Refresh not updating for Tablix

I have updated the SP for the attached dataset that the tablix is using. The refresh worked fine and I can see my new fields in the shared data set when I look in the Fields tab. My problem is the tablix itself is not giving me access to the new fields. There is a disconnect somewhere and I cannot figure out hot to get the tablix to see the updated fields available in the dataset. I run into this problem frequently and hope I can get a good answer here to return to in the future as I am sure I will need to. I have googled and looked through the suggested questions here and I cannot find one that is directly related to this issue.
I will also know note that the report project is in TFS source control as I read that has some adverse side affects. I have marked the whole project for edit and also went to the folder structure and made sure everything was unset to read only.
I am using SSRS 2008 in VS 2010.
Just found it... I don't understand the need for hidden menus like this..
Click the report itself, then go up to View on the menu and at the very bottom there is "Report Data". From here you can select your dataset and go to its properties and refresh the reports attached dataset's fields. What a pain in the butt.
Here is a link that helps better explain it.
http://blog.dontpaniclabs.com/post/2012/01/26/Developings-Reports-for-SQL-Server-Reporting-Services
You can also delete the .data file if you still can't get it to refresh.
Go into the file folder where the .rdl file exists
Next to it, there should be a file with the same name with the
.rdl.data extensions. Delete this file.
It appears to force the refresh probably because it has to recreate the file.
Here's a less invasive way but may not always work:
In the Report Data windown, right click on you dataset and click
Dataset Properties like so:
Click Refresh Fields near the bottom right of the Dataset Properties
window:
After changing the Stored Procedure code, without changing the name and number of fields returned, I could only get the report to seemingly call the new format of the stored procedure by clicking the Refresh button in the report's Preview tab.
Go into your solution folder, where the rdl's are stored and delete .rdl.data file for your report.
Next time you'll run the report, new rdl.data file will be created and it will have all the new fields from the updated SP.
ok, this maybe an older thread, but I kept running into the same problem on occasion. The absolutely easiest way to fix this is adding the following line of code to the beginning of the stored procedure that produces your dataset for the report:
SET FMTONLY OFF;
Happy coding :)
I ran into a very similar issue:
Added a new field to an existing SQL table function
(With some difficulty) added the new field to the existing dataset in SSRS
Spent some time unsuccessfully trying to add the new fields to the table (tablix?) in design mode.
This didn't work for me so eventually I opened the particular report file [filename].rdl in a text editor and surprise surprise it was XML. It was easy enough to add the missing field manually, and visual studio then prompted me to refresh the report.
<DataSets>
<DataSet Name="DataSet1">
...
<Fields>
<!-- add new field at this level -->
<Field Name="[newfield]">
<DataField>Email</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
</DataSet>
</DataSets>
I am having exact same issue in VS 2012. The stored procedure used as a query will not allow to refresh fields. When the button is pressed nothing happens.
The only solution I found is to flip the Query Type to Text and provide the parameter values on the exec call to the SP.
Why do we have to put up with these obvious show stopper bugs?
Had the same issue and I was able to resolve it by renaming my dataset in properties, creating a new dataset with the original name, and then hitting the refresh button.
Old thread, but I ran into this using VS 2015 and SSMS 2016. I was certain it was an issue with VS. When I went back to SSMS and tried executing my stored procedure, however, I found that passing certain parameter values would cause the query to fail. Interestingly, I was able to ALTER the stored procedure without encountering any errors. (Perhaps because some combinations of parameters wouldn't result in a failure?)
Anyways, at the end of the day it was faulty coding in my sproc that was causing the fields in SSRS not to refresh. When I went back and corrected the issues with my code, everything worked as expected in VS.
I am working in Visual Studio 2015 and none of the above answers worked for me. If you are getting the data from a stored procedure, you need to open the .xsd file and right click on the data model. Select Configure, and the correct values from the procedure should appear on the right of the window.
Then refresh your dataset from the Report Data tab.
I had the same issue.
I installed SP1 so that .rdl.data file would get generated which inturn also fixed the data refresh issue.
Reference: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/e2b199df-bc1b-4211-9110-85a0c63454b8/why-does-ssrs-not-create-a-rdldata-file-when-previewing-a-report?forum=sqlreportingservices
I was trying to use an ODBC driver for the datasource that connected ok, but wouldn't show Fields in VS 2015 SSRS report. I went back and used a datasource based on SQL Server driver (it's in the choices when designing a datasource) and it worked perfectly.
I had this same issue but the cause was different from the other answers at the time of this writing.
In my case, the stored procedure used as the data source was returning multiple data sets (due to some debugging code that I had left in there).
SSRS was "seeing" the fields in the first dataset, whereas I was expecting it to see the fields in the second dataset.
Removing the extraneous datasets fixed the issue and SSRS was able to see the fields that I intended.
Clearing reportviewer's datasources works for me.
this.(reportviewername).LocalReport.DataSources.Clear();
Open the Visual Studio 2008 reports solution
Open (double click) your report (.rpt file) on left pane
Press Ctrl + Alt + D to open the Report Data panel
Expand the DataSets folder
Find the report's main data set and right click the "DataSet Properties" menu
Click the "Refresh Fields" button on the popup window.
Deleting .data no work for me. Deleting Dataset and adding again worked. And I had previously configured VS/SSRS to NOT cache.
refresh and deleting .data did not work for me. So I just manually added the fields.

Shared dataset appears for selection even after deleting from report server report builder3.0

I created a Shared Dataset in report builder 3.0 a week ago and stored in my "My Reports" folder on report server.I removed it the other day; however, when I go to create a new Dataset today...it's still listed as an option. When you attempt to select it from the list you receive an error message that it's no longer available. Below is the error which I am getting :
"The shared dataset cannot be loaded from the server".
Please help if anyone has faced a similar issue and know the reason for it. Thanks in Advance !!!
Ren is more or less correct, Report Builder is caching a list of items you've recently used. It does not bother to check if the items it's caching actually exist or not, which is why you're getting the error you do when you try to use one.
To clear the list, click the big icon in the top left (or alt + F), then click the Options button at the bottom of the dialog that appears.
In the options window you can clear your recent item lists, along with change some of the rules for how those are kept.
I don't believe there's any way to make Report Builder automatically remove broken/missing references

SQL Server Reporting Services Default Values From Query not working in deployed report

In order to populate a textbox in a page header I am setting up a parameter (as you cannot use Fields) and referencing this in the textbox. The parameter has the Default Value set to "From Query" and the Dataset and Value Field are set accordingly. This works a treat in developmentt in Visual Studio 2005. Once I have deployed the report and am viewing the report in the ReportViewer control I get the error:
"Parameter validation failed. It is not possible to provide valid values for all parameters. (rsParameterError)".
If I remove the parameter, the report works fine.
(Strange thing is that I thought I had this working earlier).
You've probably checked, but has the default value copied over? I've had issues in the past with reporting services where the default values were lost when I moved a report from one box to another.
Thanks for the answer - it has pointed me in the right direction...I have been using my own program to deploy multiple reports so rarely look at them via the Report Manager website. Anyway - I just deployed the report on my home PC and it worked fine....looking at the report in Report Manager on both PCs I found that "Prompt User" on the PC that wasn't working was not ticked...go figure. Ticking this resolved the problem.
I am liking the results that I am getting from SSRS, but I am quite new to it and am finding some things (like this) a little frustating...mouse and keyboard are lucky to not find themselves thrown out the window!