Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pass crystal report object to Report Document not physical file

How can I pass crystal report class name to ReportDocument dynamically.

E.g.

ReportDocument rpt;
rpt = new ReportDocument();
rpt.Load(filepath);

but I need to use

ReportDocument rpt;
rpt = new CrystalReport1(); // CrystalReport1 is report name

But I need to pass "CrystalReport1" as dynamically, so dynamically it create Report object. How can I do that ?

like image 481
Lajja Thaker Avatar asked Nov 30 '12 08:11

Lajja Thaker


1 Answers

I got the answer by my own , please check below..

CrystalReport obj = new CrystalReport();
ReportDocument rpt = (ReportDocument)obj;
like image 178
Lajja Thaker Avatar answered Oct 21 '22 03:10

Lajja Thaker