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

How to load report by specific path/directory?

1 Answer 232 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
LIOW
Top achievements
Rank 1
LIOW asked on 04 Aug 2011, 11:44 AM

Hi,

For crystal report, we have a function call .Load(...) to load report by specific path,
eg:

 

CrystalDecisions.CrystalReports.Engine.ReportDocument oRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

 

 

 

oRpt.Load(D:\Project Source Code\MCS2011\CRReason.rpt);

Is that any similar function like .Load(...) method for telerik reporting?

 


1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 08 Aug 2011, 02:55 PM
Hi Liow,

We've answered your inquiry in the support thread you have opened. Here is the answer:

Telerik Reports are normal .NET types, thus they are part of assemblies. In order to load the reports you have to use reflection as shown in the following code snippet:

Copy Code
Type reportType = Type.GetType(reportName);
IReportDocument report = (IReportDocument)Activator.CreateInstance(reportType);

However if you prefer to serialize to XML and deserialize the report definition, check out the Serializing Report Definition in XML help article.

Kind regards,
Steve
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
General Discussions
Asked by
LIOW
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or