Skip to Content
Former Member
Feb 14, 2012 at 04:08 PM

VB VS2010 Setting Range Parameters


So my scenario is pretty simple, read a launch file with a list of parameters, set parameters. Now for single or multiple discrete parameters the Report.SetParameterValue function works perfectly. It saves a ton of time versus the way I set parameters in VB6. My question is though, can you not use SetParameterValue for range parameters? I get a error everytime it tells me that the DiscreteOrRangeValueKind is set to Range, so it won't let me set the value using SetParameterValue function. Is there no shortcut such as SetParameterValue for range parameters? Don't know if I'm not searching it correctly on forums, MSDN, and google, but all I ever find is someone giving some convuluted code of going through the datadef parameterfields, then to the items, then checking the kind, then declaring a new rangeparametervalue, adding a value to it, then applying the value. So, you end up with 10-15 lines of code for what the SetParameterValue does in one. It just seems like there would be a shortcut for setting a range parameter or the SetParameterValue would have some sort of optional parameter to specify the parameter type is range and expect a array. Any help would be appreciated.

Edited by: Barry Klein on Feb 14, 2012 5:11 PM

Edited by: Barry Klein on Feb 14, 2012 5:12 PM