Thursday, March 29, 2012

Error rendering subreport in table

Hello there.

First some informations:
The Report shows informations about server from our customers. There will be one report per customer. One Customer can have 1 or more servers. I get all servers from a customer with DataSet1. The result is one column with one or more rows (example "Server1", "Server2"...).

Its a really big report so i put all objects in subreport and in the "toplevel"-report i repeat the subreport for each row i get and set the column as parameter (which is defined in subreport).

Heres my problem:
if i put the subreport direct into the report and set a fix value for the server-parameter it works fine. if i put the subreport in table i get the followin error:
"[rsErrorExecutingSubreport] An error occurred while executing the subreport ‘subreport13’: Object reference not set to an instance of an object."

There must be a problem using the table. Funny thing is in this subreport i do the same procedure with another subreport and it works fine. I've "copy&past" the table from the subreport to "toplevel"-report. No chance.

Can someone help me?

Thanks in advance, Tobi

Is this RS 2005 RTM? This sounds like an issue which was solved in RS 2005 SP1 (http://www.microsoft.com/sql/sp1.mspx).

-- Robert

|||

Hi,

We still have the same problem after applying the SP1 on server and client.

Thnx for an yhelp.

Sbastien

|||

If that's the case, then most likely you have a list or table in the main report which contains a subreport. The subreport has not datasets at all and references another subreport.

If this is the case, then try the following workaround: Add a dataset to the subreport. The dataset query can just be as simple as "select 1 as id" - and you don't need to use the dataset anywhere in the subreport. Then delete main and sub reports from the report server and republish - it should work then.

-- Robert

|||Installing the SP1 is not the solution.|||

Please read my previous posting in this thread with a suggested temporary workaround.

-- Robert

|||Now I've found the problem.

I've got two DataSets in the subreport. Both use an period in where-statement (DateFrom and DateThru). The second DataSet caused the parameters to be set as string-parameter.

I can't comprehend why. The fields in the table are declared as DateTime.
I've no idea.

I solved the problem by doing a UNION in the first DataSet. Both have two columns and I use a third colum for identifiing the queries. There are maximum 100 rows in the result set so performance is no problem.

Hope that helps.

Tobi

No comments:

Post a Comment