i want to add reporting runtime capabilities to my software and have decided to go with RDL and local report viewer (WinForms)
I have been reading several good HOW TOs (MSDN and gotreportviewer) and articles and i have successfully done the following:
Converted the latest scheme with XSD (http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition) and at runtime generated an rdl file that is shown in the repot viewer.
The problem is that because i am not using the Server and there isn’t any actual connection in the local mode since the dataset is delivered at runtime the data isn’t persistent.
i want to embed the data in such a way that the only thing required is the RDL (actually it is an RDLC since it is in local mode).
i have discovered that there is an XML embedded way:
[from:StockChartsRS2008R2.rdl]
…
<DataSet Name="AWDataSet"> <Query> <DataSourceName>AdventureWorksOffline</DataSourceName> <CommandText><Query> <ElementPath>Root /Stock {@High (Float), @Low (Float), @Close (Float), @Open(Float), @StockPriceDate(Date)} </ElementPath> <XmlData> <Root> <Stock High="30.4113833868661" Low="29.9705661418443" Close="30.2016959908158" Open="30.2323120165209" StockPriceDate="2008-01-13T00:00:00"/>
...
The problem is that when i use the local report viewer i need to regenerate the dataset From the embedded data- and i don’t know how to do that:
_reportViewer.LocalReport.DataSources.Add(new ReportDataSource(???))
if successful it assures me that both working with server mode and client my data will always be available and the report displayed
also is there is a better way than XML embedded to persist the data?
Thanks, mosh.