Response.Buffer = false; // Clear the response content and headers Response.ClearContent(); Response.ClearHeaders(); try { // Export the Report to Response stream in PDF format and file name Customers myReport.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, "OperationalResultsStandard"); // myReport.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, ""); // There are other format options available such as Word, Excel, CVS, and HTML in the ExportFormatType Enum given by crystal reports } catch (Exception ex) { Console.WriteLine(ex.Message); ex = null; }
Response.Buffer = false; // Clear the response content and headers Response.ClearContent(); Response.ClearHeaders(); //Response.ContentType = "application/pdf"; //Response.AddHeader("content-disposition", "inline;filename=report.pdf"); try { // Export the Report to Response stream in Excel format and file name Customers myReport.ExportToHttpResponse(ExportFormatType.Excel, Response, false, "OperationalResultsStandard"); // myReport.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, ""); // There are other format options available such as Word, PDF, CVS, and HTML in the ExportFormatType Enum given by crystal reports } catch (Exception ex) { Console.WriteLine(ex.Message); ex = null; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)