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!!!I figure out how to do what I am looking to do.
1. Create a new report and specify a sample XML file as your data source.
This way you get all the DataSet <Field> elements you need automatically.
2. Create a new blank report (without the wizard using Add > New Item >
Report).
3. Create a string report parameter to hold your XML data structure for the
new report. I give it a default value of my sample XML used to create the
report in step 1 for testing purposes.
4. Create a new DataSet (Data tab > <New DataSet...> from DataSet dropdown).
5. Name the DataSet (like "XmlSource").
6. Select XML from the Type dropdown.
7. Specify your connection string like so (use the appropriate parameter):
="<Query><XmlSource>" & Parameters!XmlSource.Value & "</XmlSource></Query>"
8. Go to your report you created in Step 1 in "Code View" and copy the
<Fields> element from your <DataSet> element. Now paste this <Fields>
element into the new report's <DataSet> element.
9. Using the fields, drag and drop to complete the layour of your report.
This is sort of a hack to specifying a web service as the datasource, but it
seems to work! I wouldn't recommend this if you have a really large data
structure, but might be useful if you don't have the resources (i.e. web
servers, developers, TIME) to create a web service out of some existing XML
structure.
Hope this helps!!
"brianpmccullough" wrote:
> 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!!!
>|||Sorry...Correction...In step 7, do not specify a connection string...instead
leave it empty and instead this value should be used in the Query String!
"brianpmccullough" wrote:
> I figure out how to do what I am looking to do.
> 1. Create a new report and specify a sample XML file as your data source.
> This way you get all the DataSet <Field> elements you need automatically.
> 2. Create a new blank report (without the wizard using Add > New Item >
> Report).
> 3. Create a string report parameter to hold your XML data structure for the
> new report. I give it a default value of my sample XML used to create the
> report in step 1 for testing purposes.
> 4. Create a new DataSet (Data tab > <New DataSet...> from DataSet dropdown).
> 5. Name the DataSet (like "XmlSource").
> 6. Select XML from the Type dropdown.
> 7. Specify your connection string like so (use the appropriate parameter):
> ="<Query><XmlSource>" & Parameters!XmlSource.Value & "</XmlSource></Query>"
> 8. Go to your report you created in Step 1 in "Code View" and copy the
> <Fields> element from your <DataSet> element. Now paste this <Fields>
> element into the new report's <DataSet> element.
> 9. Using the fields, drag and drop to complete the layour of your report.
> This is sort of a hack to specifying a web service as the datasource, but it
> seems to work! I wouldn't recommend this if you have a really large data
> structure, but might be useful if you don't have the resources (i.e. web
> servers, developers, TIME) to create a web service out of some existing XML
> structure.
> Hope this helps!!
> "brianpmccullough" wrote:
> > 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!!!
> >
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment