Crystal report XML file as DataSource

Namespace:
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Web;

Global variable:
CrystalDecisions.Web.Report rpt = new CrystalDecisions.Web.Report();
CrystalDecisions.CrystalReports.Engine.ReportDocument rpt1;

Onbutton or Page Load or any event
rpt.FileName = Server.MapPath(“EventHistory.rpt”);
crdata.Report = rpt;

rpt1 = crdata.ReportDocument;

crp.ReportSource = rpt1;
crp.RefreshReport();

crp.DataBind();

Share