using CrystalDecisions.Web; using CrystalDecisions.Reporting; using CrystalDecisions.CrystalReports; using CrystalDecisions.CrystalReports.Engine; using CrystalDecisions.Shared; using System.IO; string qryStr = Request.QueryString["report"].ToString(); //I get the filename based on the querystring of the URL e.g EmployeeNo902706 ReportDocument rpt = new ReportDocument(); string rptPath = "../Reports/SampleReportPicture.rpt"; rpt.Load(Server.MapPath(rptPath)); string a = "C:\\inetpub\\wwwroot\\ISMPayroll_Reports\\" + qryStr + ".bmp"; crParameterDiscreteValue.Value = a; crParameterFieldDefinitions = rpt.DataDefinition.ParameterFields; crParameterFieldDefinition = crParameterFieldDefinitions["PicturePath"]; crParameterValues = crParameterFieldDefinition.CurrentValues; crParameterValues.Clear(); crParameterValues.Add(crParameterDiscreteValue); crParameterFieldDefinition.ApplyCurrentValues(crParameterValues); Page.Response.Clear(); Page.Response.Buffer = true; MemoryStream os = (MemoryStream)rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); Page.Response.ContentType = "application/pdf"; Page.Response.BinaryWrite(os.ToArray()); Page.Response.End(); rpt.Close(); rpt.Dispose();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)