February 9, 2012  
   Login  
Forum  
 
ForumForumEnesys RS Data ...Enesys RS Data ...Support - RS Da...Support - RS Da...Object reference not set to an instance of an object, very strangeObject reference not set to an instance of an object, very strange
Previous Previous
 
Next Next
New Post
 9/16/2009 11:15 PM
 

We had a consulting company write a main report using subreports.Great everything worked (4 months) then the report stopped working..one day to the next.

(Object reference not set to an instance of an object )
 

Initially I thought it was a data error, so I went to my development machine and ran the report using the Production server as the datasource. Same problem.. After messing with the query I got it to work.

Solution

Went back to the original report --> did not work

Added a space to the sql statement (anywhere).. Tadaaa it worked..

Explain that one..

 

New Post
 9/17/2009 5:03 AM
 

Hi,

The reason could be … but let me provide a few information about reports and dataset first.

A report definition contains one or more Dataset + Layout information (using rdl language).

A dataset defines a set of columns (fields) that are mapped to external data retrieved from a datasource using a specific query (you may also have calculated columns that do not rely on external data):

image

Due to the dynamic approach of BIDS while building a report it does not appear clearly that this collection is static. To make the user experience enjoyable, BIDS will automatically discover the columns from the query used in the dataset when the query is changed or when you click on the “refresh fields” icon. When you execute a report, the report engine will expect that all columns defined in the dataset have their counterpart in the external data resulting from the query, even if you don’t use the column in your report’s layout.

I must admit that this is very confusing in BIDS 2005 because it is not always clear when the external data is re parsed. I am persuaded that one reason for the new approach in BIDS 2008 (no more data tab) is to avoid this confusion and the possibility that undesired parsing takes place. When you would like to change your query in BIDS 2008, you will specifically have to open some modal window (dataset properties or query designer) and validate in order to reparse the columns defined in the dataset.

image

This BIDS 2008 approach may initially seem less convenient (agile) but it really helps to clarify the frontier between the dataset column’s definition and the ability to automatically parse the columns resulting from a query in order to set up the column’s definition.

With this information in mind,what could cause a report not to work anymore after some time.

You have a query that returns all fields (or all non hidden fields “*”) from a list.

The report designer will use this query to set the columns definition for the dataset.

Sometimes later (say 4 months:)), some column is being deleted from the SharePoint list (or renamed in case you are using display name).

It doesn’t work anymore…on a query standpoint, it doesn’t really matter but the dataset definition says that the deleted column is mapped.

You open the report with the designer and without any reparse it won’t work either. Now you make some change (even a space) that makes a re parse to take place and because the missing column is not used in the report’s layout … Tadaaa … It works.

That said, I would concede that the error is not very helpful and I will post an issue in our database so that it can be fixed.

If you think that the origin of the problem has nothing to do with this, let me know, we will further investigate.

Regards,


Frederic LATOUR
ENESYS
New Post
 9/17/2009 3:23 PM
 

Thank you for the insight.

It makes sence, but Microsoft could have provided us with a more appropriate error message.

 

 

Previous Previous
 
Next Next
ForumForumEnesys RS Data ...Enesys RS Data ...Support - RS Da...Support - RS Da...Object reference not set to an instance of an object, very strangeObject reference not set to an instance of an object, very strange

 
You need to login for posting to the forums.
If you don't have a login, click here to register.
 
Copyright 2010 Enesys - All rights reserved Terms Of UsePrivacy Statement