Wednesday, March 7, 2012

ReportingService.Render

I have some reports with parameters that use queried default values.
I am using them as a workaround to get data from the dataset into the page
header.
They work just fine when I call the report from the SQL Server Reporting
Services web interface. I am having trouble getting them to work when I
call them from the SOAP service.
When I call the ReportingService.Render do I need to pass in the parameter
that is supposed to get its data from the dataset? If I don't, the
ReportingService.Render method throws an exception that says:
This report requires a default or user-defined value for the report
parameter 'pActDesc'. To run or subscribe to this report, you must provide a
parameter value. --> This report requires a default or user-defined value
for the report parameter 'pActDesc'. To run or subscribe to this report, you
must provide a parameter value. --> This report requires a default or
user-defined value for the report parameter 'pActDesc'. To run or subscribe
to this report, you must provide a parameter value.
Is there some special combination of settings I need to use?
Here is an example of the report parameter definition:
<ReportParameter Name="pActDesc">
<DataType>String</DataType>
<Nullable>true</Nullable>
<DefaultValue>
<DataSetReference>
<DataSetName>DataSet1</DataSetName>
<ValueField>ActDesc</ValueField>
</DataSetReference>
</DefaultValue>
<AllowBlank>true</AllowBlank>
</ReportParameter>
Thank you very much for your help!
PaulYou must specify the report parameters when you call the Render method. This
is the fifth argument of the method.
if you have two parameters, for example TerritoryID and Country you can do:
dim paramvalues(1) as ParameterValue
paramvalues(0) = new ParameterValue
paramvalues(0).Name = "TerritoryID"
paramvalues(0).Value = "EMEA"
paramvalues(1) = new ParameterValue
paramvalues(1).Name = "Country"
paramvalues(1).Value = "Germany"
and then you use the array paramvalues as your fifth argument to the Render
method. The error method you are getting is the error method you are supposed
to get if you try to render a report which has parameters without specifying
the parameters.
HTH
Charles Kangai, MCT, MCDBA
"Paul" wrote:
> I have some reports with parameters that use queried default values.
> I am using them as a workaround to get data from the dataset into the page
> header.
> They work just fine when I call the report from the SQL Server Reporting
> Services web interface. I am having trouble getting them to work when I
> call them from the SOAP service.
> When I call the ReportingService.Render do I need to pass in the parameter
> that is supposed to get its data from the dataset? If I don't, the
> ReportingService.Render method throws an exception that says:
> This report requires a default or user-defined value for the report
> parameter 'pActDesc'. To run or subscribe to this report, you must provide a
> parameter value. --> This report requires a default or user-defined value
> for the report parameter 'pActDesc'. To run or subscribe to this report, you
> must provide a parameter value. --> This report requires a default or
> user-defined value for the report parameter 'pActDesc'. To run or subscribe
> to this report, you must provide a parameter value.
> Is there some special combination of settings I need to use?
> Here is an example of the report parameter definition:
> <ReportParameter Name="pActDesc">
> <DataType>String</DataType>
> <Nullable>true</Nullable>
> <DefaultValue>
> <DataSetReference>
> <DataSetName>DataSet1</DataSetName>
> <ValueField>ActDesc</ValueField>
> </DataSetReference>
> </DefaultValue>
> <AllowBlank>true</AllowBlank>
> </ReportParameter>
> Thank you very much for your help!
> Paul
>
>

No comments:

Post a Comment