This is a migrated thread and some comments may be shown as answers.

Create telerik reporting using xml data

5 Answers 122 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
saroja
Top achievements
Rank 1
saroja asked on 27 Aug 2009, 03:42 AM
hai!

How to create telerik reporing using xml data.....can anyone help me?...... 

thanks,
N.Devi

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 27 Aug 2009, 02:56 PM
Hi saroja,

You have a couple of options:
  1. (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.
  2. 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.

Best wishes,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
saroja
Top achievements
Rank 1
answered on 02 Sep 2009, 05:58 AM
thank you very much steve....
0
David Copp
Top achievements
Rank 1
answered on 27 Jan 2010, 05:34 PM
I am converting some Crystal Reports to telerik reporting.  We use XML that is stored in a database as the datasource and already use the readxml method to load a dataset.  That works fine.  I am using the following code to instantiate the report viewer, I got this from the samples included with the trial download.  It works and I get the report on screen.  My problem is that I don't find a 'DataSource' property suggested in your option 2 on any of the objects below in which to assign my dataset.  I'm sure that I'm missing something simple, but have looked for several hours and haven't found it.  Can you help?

 

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

 

 

End If

 

 

0
Steve
Telerik team
answered on 28 Jan 2010, 02:42 PM
Hi David Copp,

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

Regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
David Copp
Top achievements
Rank 1
answered on 28 Jan 2010, 02:59 PM
How do you then specify which report to use?  We will have hundreds of reports that will be displayed from the same reportviewer page.  
Tags
General Discussions
Asked by
saroja
Top achievements
Rank 1
Answers by
Steve
Telerik team
saroja
Top achievements
Rank 1
David Copp
Top achievements
Rank 1
Share this question
or