cancel
Showing results for 
Search instead for 
Did you mean: 

Error "One or more arguments are invalid." when setting range parameter val

Former Member
0 Kudos

I have a report template which has a field of type Date. It has the following settings-

Allow Custom Values=true

Allow Multiple Values = true

Allow Discrete Values=true

Allow Range Values=true

I set the range value using the code as following-

ReportParameters reportParameters = report.ReportParameters;

foreach (ReportParameter reportParameter in reportParameters)
{
    ReportParameterRangeValue reportParameterRangeValue = reportParameter.CreateRangeValue();
    ReportParameterSingleValue fromParameter = reportParameterRangeValue.FromValue;
    fromParameter.Value = "2009-12-31";
}

However, this throws the foll. exception at the line fromParameter.Value = "2009-12-31";-

"One or more arguments are invalid."

" at CrystalDecisions.Enterprise.Desktop.ISReportParameterSingleValue.set_Value(String pbstrVal)\r\n at CrystalDecisions.Enterprise.Desktop.ReportParameterSingleValue.set_Value(String value)

Any ideas why? I am really perplexed as to why this should throw an exception. Is there another way to set Date type params?

Accepted Solutions (0)

Answers (1)

Answers (1)

ted_ueda
Employee
Employee
0 Kudos

Is it a Date type? If so, why not use a Date type? Like "Date(2005,02,04)".

Sincerely,

Ted Ueda

Former Member
0 Kudos

Ya thanks a lot Ted. That worked.