We are using an Object-relational tool called N-Hibernate with the hope of having our developers program against objects and not SQL. Sounds like a good thing to do but we are having a problem with how to handle reporting. Reporting services will handle object input but only simple types and we have many subclasses within subclasses so this will not work. The fallback is to serialize the objects and their associated instance data and feed that XML into RS , however the XML handling in RS seems a little weak unless we are missing the obvious. If for example one has an XML file that looks like :
< xml version="1.0" encoding="utf-8" >
<Custs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="cust.xsd">
<Cust ID="1">
<Name>Bob</Name>
<Orders>
<Order ID="1" Qty="6">Chair</Order>
<Order ID="2" Qty="1">Table</Order>
</Orders>
<Returns>
<Return ID="1" Qty="2">Chair</Return>
</Returns>
</Cust>
<Cust ID="2">
<Name>Aaron</Name>
<Orders>
<Order ID="1" Qty="10">Chair</Order>
</Orders>
</Cust>
</Custs>
The ReportViewer seems to prefer working with datasets unless this is an Object source but the real question us how to get the XML file into a .Net Dataset . I could not see a nice IDE way to do this as in the case of SQL and wrote some code to populate and save what I think is a dataset:
XmlDataDocument doc = new XmlDataDocument();
String rootPath = Server.MapPath("~") + "/Cust.xsd";
DataSet dataset1 = new DataSet();
doc.DataSet.DataSetName = "XYZ";
doc.DataSet.ReadXmlSchema(Server.MapPath("~") + /app_data/Cust.xsd");
doc.Load(Server.MapPath("~") + "/app_data/Cust.xml");
StreamWriter writer = null;
String mySaveSchema = Server.MapPath("~") + "/app_data/custDS.xsd";
writer = new StreamWriter(mySaveSchema);
doc.DataSet.WriteXmlSchema(writer);
It is really hard to find much info on this subject so am not sure if this is all one needs to do but things then looked better as I could view the schema for my dataset in the IDE and the dataset appeared as a reporting data source something like the following :
Custs
Cust
Name
Orders
Return
Orders
. . .
At least the definition of the report looked promising so I dropped Name unto the Report as a test and then went to add my reportviewer object to the aspx page and here is where things broke down. The data source for Name was generated as follows:
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt"
Height="400px" Style="z-index: 100; left: 332px; position: absolute; top: 0px"
Width="400px">
<LocalReport ReportPath="Report.rdlc">
<DataSources>
<rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="Custs_Cust" />
</DataSources>
</LocalReport>
</rsweb:ReportViewer>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetData"
TypeName="CustsTableAdapters."></asp:ObjectDataSource>
And when I run the app I get the following :
- An error has occurred during report processing.
- The type specified in the TypeName property of ObjectDataSource 'ObjectDataSource1' could not be found.

xml files as data sources
Idizz
Larry Aultman
Reporting services will handle object input but only simple types and we have many subclasses within subclasses so this will not work.
</quote>
It is not impossible to use nested objects. See: http://www.gotreportviewer.com/objectdatasources/index.html