Hi There
I have created a report whereby i then call it via the controller when i click the httpost event i then generate my pdf download link but when i open the report no data is showing.
I have created parameter fields and want to link the strings within my controller to send data through to the report
Are there any resolutions or can't i do it that way?
var reportPath = Server.MapPath("~/ReportTemplates/PaymentCertificate.rpt"); var customers = _db.Projects; ReportClass rptH = new ReportClass(); rptH.FileName = Server.MapPath("~/ReportTemplates/PaymentCertificate.rpt"); rptH.Load(); rptH.SetDataSource(customers); Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); return File(stream, "application/pdf");
using (var reportDocument = new ReportDocument()) { reportDocument.Load(reportPath); reportDocument.SetDataSource(students); var response = System.Web.HttpContext.Current.Response; reportDocument.SetParameterValue("ProjectName", Project); reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, response, true, "PaymentCertificate"); } return new EmptyResult();
PLEASE HELP !!!
<div></div>