Currently I’m working on a reporting website in VS 2010 using ASP.Net 4.0 and the 2010 RDLC designer. The report I’m building is similar to a Master-detail report, but I’m trying to do it with nested tables.
My issue is that I’m trying to pass a field value from my main report to a sub report. The table setup looks something like this:
2 Tables
First Table: [RecordID, Name, Date,]
Second Table: [RecordID, Description, DueDate]
What I want to do is a table like this:
-------------------
| Name | Date |
------------------------------------
| Description1 | DueDate |
------------------------------------
| Description2 | DueDate |
------------------------------------
| Name2 | Date2 |
-----------------
With the entries for Description and DueDate bieng part of the sub report.
When I try to pass the RecordID in to the subreport as a parameter, which I have to manually define in the XML of the subreport because I can’t find anywhere in the designer UI that will allow me to add report parameters to RDLC files, I get an error from the main report that says:
An error occurred during local report processing.
Value cannot be null. Parameter name: value
So it appears to be erroring out before it ever reaches the point where it does the subreport loading.
I am getting data sent to the main report just fine, and if I remove the parameter from the subreport the data comes through. But if I add the parameter the report throws the error.
Does anyone have any ideas on what might be causing this?
I actually ended up figuring this out.
If you’re using Visual Studio 2010 you need to go into the report definition file and make sure the Report Data window is open.
If you can’t find it go to View and click on Report Data.
Once you have the window open right click on the Parameters folder and add the parameter there.
In the parameter declaration box make sure you select Allow Null Value and Allow Blank Value if it’s a Text type. This should stop that error from happening.
For some reason, even though I always had a value, with local reporting it initializes the report parameter with null causing it to throw that error if you do not allow nulls/blanks.