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

How do i Load Telerik Report Definition File in MVC

2 Answers 217 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John North
Top achievements
Rank 1
John North asked on 21 Aug 2012, 03:04 PM
I would like to save the report in XML format to a database and load them in to ReportViewer control at run time.

2 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 22 Aug 2012, 01:07 PM
Hello,

With the introduction of the XML report definition the reports can exist not only as CLR types and objects in the memory but as XML markup stored in different ways (file, database, etc.). As we do not want to limit the users to work with only objects or files the need for a unified way for referencing reports in the applications emerged - Report Sources.

To show a report created with the standalone designer (.trdx file), you can use UriReportSource:
Copy Code
Copy Code
protected void Page_Load(object sender, EventArgs e)
{
            if (!IsPostBack)
            {
                Telerik.Reporting.UriReportSource uriReportSource = new Telerik.Reporting.UriReportSource();
 
                // Specifying an URL or a file path
                uriReportSource.Uri = @"C:\MyWebApplication\Reports\Barcodes Report.trdx";
                this.ReportViewer1.ReportSource = uriReportSource;
            }
}

If you have saved the xml to your database, then you can utilize XmlReportSource directly.

If you prefer to work with CLR types and objects, you can deserialize the xml report definition as shown in the Serializing Report Definition in XML help article and proceed from there like you would normally do following the basic concepts of the programming language and the .NET platform.

Kind regards,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
John North
Top achievements
Rank 1
answered on 22 Aug 2012, 05:33 PM
Thank you very much Steve , That is the exactly what I am look for and appreciate the tip on Xml serialization classes.
Tags
General Discussions
Asked by
John North
Top achievements
Rank 1
Answers by
Steve
Telerik team
John North
Top achievements
Rank 1
Share this question
or