Showing posts with label array. Show all posts
Showing posts with label array. Show all posts

Sunday, February 19, 2012

CreateSubscription parameter array problem

I'm using the CreateSubscription method and having a problem with the
parameter values getting rejected. I am wondering if I am experiencing a
type conflict because my report parameters are all integers but from the
samples it looks like I may need to define them as strings. Is there a
limitation on using this web service method that your report parameters must
all be strings?
The error I am getting is not that helpful:
The value of parameter 'Parameters' is not valid. Check the documentation
for information about valid values. --> The value of parameter 'Parameters'
is not valid. Check the documentation for information about valid values.
I am building the parameter array like this:
Dim parameters(4) As ParameterValue
parameters(0) = New ParameterValue()
parameters(0).Name = "PriorMonthEndAsOfDateDimensionId"
parameters(0).Value = "353"
parameters(1) = New ParameterValue()
parameters(1).Name = "MonthEndAsOfDateDimensionId"
parameters(1).Value = "419"
parameters(2) = New ParameterValue()
parameters(2).Name = "StrategyDimensionId"
parameters(2).Value = "98"
parameters(3) = New ParameterValue()
parameters(3).Name = "FundDimensionId"
parameters(3).Value = "847"
I get the same error if I assign the values without the quotes.
Thanks,
SimonI'm an idiot.
I was defining the array incorrectly. When I change it to: Dim
parameters(3) As ParameterValue
it works.
Sorry.
"Simon Schmidt" wrote:
> I'm using the CreateSubscription method and having a problem with the
> parameter values getting rejected. I am wondering if I am experiencing a
> type conflict because my report parameters are all integers but from the
> samples it looks like I may need to define them as strings. Is there a
> limitation on using this web service method that your report parameters must
> all be strings?
> The error I am getting is not that helpful:
> The value of parameter 'Parameters' is not valid. Check the documentation
> for information about valid values. --> The value of parameter 'Parameters'
> is not valid. Check the documentation for information about valid values.
> I am building the parameter array like this:
> Dim parameters(4) As ParameterValue
> parameters(0) = New ParameterValue()
> parameters(0).Name = "PriorMonthEndAsOfDateDimensionId"
> parameters(0).Value = "353"
> parameters(1) = New ParameterValue()
> parameters(1).Name = "MonthEndAsOfDateDimensionId"
> parameters(1).Value = "419"
> parameters(2) = New ParameterValue()
> parameters(2).Name = "StrategyDimensionId"
> parameters(2).Value = "98"
> parameters(3) = New ParameterValue()
> parameters(3).Name = "FundDimensionId"
> parameters(3).Value = "847"
> I get the same error if I assign the values without the quotes.
> Thanks,
> Simon