Hello,
Is it possible to pass an XML document as a string parameter to a Reporting Services 2005 report and use this report as a data source for the report?
I know you can source from a web service, the problem is that the effort needed to convert what I have into a web service will be more than we would like to take on. Instead, I am trying to pass an XML structure as a string parameter to a report and then setting the Command Text like so:
<Query><XmlData>Parameters!XmlData.Value</XmlData><ElementPath>MyRootElement</ElementPath></Query>
TIA!!!
Hi Brian-
Yes, it is possible to do this. You will need to make the entire query string an expression, so that report processing will construct the query string first, then pass it to the data provider. For your example it would look like this:
="<Query><XmlData>" & Parameters!XmlData.Value & "</XmlData><ElementPath>MyRootElement</ElementPath></Query>"
Note that this will not execute in the designer data tab (It will show an error loading the query string). Ignore this error and manually add the data set values in the layout tab. This can be done by right clicking the your xml dataset in the DataSets pane and selecting add. The report will execute successfully through the preview pane and after publishing on the server.
Thanks, Jon
|||Why does this not run in the designer? Why do you have to publish it to get it to work?|||
It will run in the designer preview or a published report. However, the report designer query window/data tab does not have the ability to parse report parameters and will thus execute an invalid query.
-JonHP
No comments:
Post a Comment