cancel
Showing results for 
Search instead for 
Did you mean: 

Missing parameter values - mystery solved

Former Member

I've tracked down why I was getting this error to the refresh method of the ReportDocument object.

The sequence of execution is as follows;

load report

get/set parameter values

set database location

refresh report

export report

The refresh step clears all the parameter values and defaults. I can't believe that this is correct behavour but hey ho, I'll try and work around it by saving all the parameter values to local storage when I open the report and then reset them after the refresh.

Is this correct?

Steve

Accepted Solutions (1)

Accepted Solutions (1)

former_member184995
Active Contributor
0 Kudos

No, that is exactly how the refresh is supposed to work actually.

The reportdocument.refresh call removes saved data. That includes any parameters set on the report.

99% of people who call reportdocument.refresh do not have a need to do so to be honest.

If you are using an empty report template (ie a report that does not have saved data) then you should not need to call it at all.

If you want to call it just to make sure, do it before you do anything else, then pass any information you need to the report object.

Jason

Former Member
0 Kudos

Thanks Jason, but I'm still a little surprised that after a refresh the default values are cleared. I can appreciate that the values collection would be trashed, but not the default values entered at design time.

I think that most people would call the refresh method - the only reason why they wouldn't is if either the report doesn't have any saved data or they haven't changed any parameter values. Otherwise, they are always foing to get the saved data out.

Steve

former_member184995
Active Contributor
0 Kudos

I am not understanding what you mean by it blows out the default values?

The only thing that setting a default value does is make it the top of any lists of parameters or automatically select it for you if you allow the report to prompt for parameters.

If my memory serves me correctly you should still have to actually pass a parameter to the report at runtime if you are assigning them via code and not letting the report itself prompt the user. It does not just use the default value if no value is passed, it will fail with a missing parameter value.

Jason

Former Member
0 Kudos

Wasn't there a fix in SP2 that says you have to set the IsNoValue=true on a parameter and it will force CR to use the default?

That thread is to do with optional parameters but I thought they were parameters that have a default. I'm probably wrong.

Steve

Edited by: SteveO on Aug 3, 2009 7:18 PM

Answers (0)