cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Value cannot be null. Parameter name: inputString

Former Member
0 Likes
1,198

Hello,

I'm using CR 2008 and VS 2008 (ASP.NET 3.5),

I have a small problem with one report. It's located on the page where except for the report viewer there are some other fields that the user can update.

When the user opens this page, the report is displayed OK, no errors.

After he updates some fields , the report is reloaded OK, but on top of the report there is a message from the viewer:

"Value cannot be null. Parameter name: inputString".

If the user updates the page again, then the error disappears and everything works fine.

So everything actually works, I'm just trying to find out where this error message is coming from and how to get rid of it.

I would appreciate any suggestions.

Thank you,

Peter

View Entire Topic
Former Member
0 Likes

I'm not sure what you mean by; "After he updates some fields ".

However the behavior sounds like it may be related to some sort of a timing issue. E.g.; the updated fields are not committed when you ask the engine to run the report or something along those lines. Also, make sure you have SP 3 for CR 2008.

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Former Member
0 Likes

Thanks Ludek.

The fields update simply reloads the page, databinds and opens report again.

Former Member
0 Likes

Still sounds like some sort of a timing issue, perhaps sessions or post back?

Before reloading the page are you using .Close and .Dispose on the report object?

Ludek

Former Member
0 Likes

Yes, I'm using this:

protected void Page_Unload(object sender, EventArgs e)

{

if (rpt != null)

{

rpt.Close();

rpt.Dispose();

GC.Collect(); // forces garbage collection

}

}

I'm not using any session objects.

Former Member
0 Likes

OK. So what I understand, these would be the steps in the app:

1)

Load a report

set parameters

logon to db

view report

unload form and report

2)

Load a report

set parameters

logon to db

view report

Error re parameters.

3)

unload form and report

Load a report

set parameters

logon to db

view report

report now works

Is th above the correct flow?

Former Member
0 Likes

Yes, this is correct.

Actually report always works, just on the stage 2 the error message is displayed.

Former Member
0 Likes

If it's not already, place the vieweru2019s reportsource in page_init and see if that helps.

Ludek

Former Member
0 Likes

It is already there.

Former Member
0 Likes

Without seeing this app, this is getting hard to troubleshoot.

Musings and assumptions and guesses;

If the vieweru2019s reportsource is set in whatever event is being fired when changing the value on one of the formu2019s controls. If the formu2019s control value (ie if he has a dropdown or textbox) is being used as one of the parameter values, then the page_init wonu2019t have that value in viewstate yet. The event needs to fire first which is one of the last things to happen in a webformu2019s lifecycle.

But like I said guesses and all that...

Ludek

Former Member
0 Likes

Thank you. Tried everything - no luck so far.

It's OK, since the report still works, I can leave with this error message.

Peter