Wednesday, March 7, 2012

Reporting Server Project 2005 - xml datasource - Querying the data

The way I create the report is I use VS2005 to create the RDL programmatically on the fly. The problem is querying the data when I use XML as a data source (changing the data source is not an option).

I can connect to the XML data source, I enter a basic query in the data tab in VS 2005 and what happens is for some reason or another the above element in XML gets concatenated onto the column name in the result set.

So what I have to do is manually modify the RDL file to accept the new names and then the report works. There has to be a way to not have this happens. Any advice on where I can find information on how to do this would be greatly appreciated. Examples are always welcome.

See below for an example of what I did and an example of the XML data.

XML File Example:
<data>
<Table>
<iss_id>Test Data1</issu_id>
<issue_nm>Test Data1</issue_nm>
</Table>
<Table>
<iss_id>Test Data2</issu_id>
<issue_nm>Test Data2</issue_nm>
</Table>
<data>

XML Query: (I enter this in the data tab in VS 2005)
data/Table

Result:

Table_iss_id Table_issue_nm <--Column Headers
Test Data1 Test Data1
Test Data2 Test Data2

I think it has to do with the webservice web method, and how it needs to be set-up for serializing the parameters correctly to work with the XML data Source. I am having a similar problem which I am documenting here

http://forums.microsoft.com/MSDN/User/MyForums.aspx?SiteID=1

J. C.

No comments:

Post a Comment