5 Answers, 1 is accepted
You have a couple of options:
- (recommended) Create a typed DataSet from your XML. For more information on the typed DataSets please see here. Once you have the DataSet ready, run the Report Wizard and it will appear in the list of the available data sources; select it and follow the instructions of the wizard.
- Load the XML into a DataSet programatically. Use the DataSet.ReadXml method to load the XML data into a DataSet and then pass it to the Report.DataSource property. The disadvantage of this approach is that the schema of the report's data source won't be available at the design time. This means that the Report Wizard won't be of any help. Anyway you still can create a report without it. You can use the Visual Studio Toolbox to select from the available items. For more information please see Designing Reports.
the Telerik team
Dim reportName As String = Server.UrlDecode(sReportName.ToString)
If Not String.IsNullOrEmpty(reportName) Then
Dim reportType As Type = Type.[GetType](reportName)
Dim report As IReportDocument = DirectCast(Activator.CreateInstance(reportType), IReportDocument)
Me.ReportViewer1.Report = report
Me.Page.Title = "EMK3 Reports - " + ReportTitle.ToString
That is because IReportDocument does not have a DataSource property, only the Report has a DataSource. We have used IReportDocument in our demo reports as one of the examples is a ReportBook and thus it requires the usage of that interface and we do not set DataSource from the calling application.
Anyway you do not need to use that code (which is that complicated as we did not want to hardcode each of the reports available in the classlibrary) for setting a single report to show in the viewer. A code like below is sufficient:
Dim report As Telerik.Reporting.Report = New MyReport()
ReportViewer1.Report = report
the Telerik team