I am using C#,ASP.NET,.NET FRAMEWORK 2.,crystal reports 9.
I have used a style class in crystal report.
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;
}