Reporting Service: XML Query and defining columns#

No longer did I finish me last post did I remember another little tidbit that may interest people.  Some of you probably have wondered why you have to define the columns in your Xml query instead of just leaving out the “{}” from the end of your query and get all columns in the Reporting Services Designer Dataset explorer.  This does in fact work but with some very strict rules which is why I define the columns I want.  As an example

<Query xmlns:es="http://test.test.com">
<SoapAction>http://test.test.com/RetrieveOrganizations</SoapAction>
<ElementPath>es:RetrieveOrganizationsResponse{}/es:RetrieveOrganizationsResult{}/es:OrganizationInfo{es:OrganizationId, es:OrganizationName}</ElementPath>
</Query>

will retrieve the OrganizationId and OrganizationName that will show up in the Dataset explorer in the Report Designer.  These are the only two columns that exist in the entity.  The below query should do the same

<Query xmlns:es="http://test.test.com">
<SoapAction>http://test.test.com/RetrieveOrganizations</SoapAction>
<ElementPath>es:RetrieveOrganizationsResponse{}/es:RetrieveOrganizationsResult{}/es:OrganizationInfo</ElementPath>
</Query> 

but it only retrieves the OrganizationId in the Dataset explorer.  Why?  Well this has to do with the implementation of the entity that is being retrieved from the web service.  When the Dataset explorer refreshes it makes a call to the webservice to see what the return type is going to be (with null parameters of course).  If the properties, which represent your columns in RS Dataset explorer, are initialized to null or an empty string they will not show up in the Dataset explorer.  This is unfortunate with the introduction of nullable types in .NET 2.0.

Anyway the easy work around is to just define you columns in your query.

Saturday, May 06, 2006 3:15:08 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview
All content © 2009, John Luif