arvind

arvind

  • NA
  • 0
  • 3.6k

how to create common HTML form to display multiple crystal?

Aug 12 2015 7:07 AM
I have various crystal report rpt files and displaying as a popup if click on report button in html form.
my code is on main form
CrystalDecisions.CrystalReports.Engine.ReportDocument theReport = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
theReport.Load(MapPath(".") + "\\Reports\\WCS_ConsignmentAdvice.rpt");
//theReport.SummaryInfo.ReportTitle = "Account Transaction Details ( per Transaction ) Inquiry";
dstemp.Tables[0].TableName = "ConsignmentAdvice";
theReport.SetDataSource(dstemp);
Session["exporttopdf"] = theReport; 
 
I am sending this report document object to html popup form and in my popup form code is
theReport = ( CrystalDecisions.CrystalReports.Engine.ReportDocument ) Session["exporttwopdf"];
System.IO.MemoryStream m;
m = (System.IO.MemoryStream)theReport.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat );
theReport.Close ();
this.Response.ClearContent();
this.Response.ClearHeaders();
this.Response.AddHeader("Title", "Report");
this.Response.ContentType="Application/pdf";
this.Response.Buffer=true;
this.Response.BinaryWrite (m.ToArray());
this.Response.Flush();
this.Response.End ();
Session["exporttwopdf"] = null;
 
I dont want to store reportdocument object in session. is there any way
and I have 1000 reports so I dont want to create all seperate html popup form to display individual report.