Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI,

using CrystalDecisions.CrystalReports.Engine;

protected void btn_Click( object sender, EventArgs e )
{
try
{
// Get the report document
ReportDocument report = new ReportDocument();

// it was guessed that the .rpt file is under 'Reporting' folder of the project
report.Load( Server.MapPath( "~/Reporting/report1.rpt" ) );

// Stop buffering the response
Response.Buffer = false;
// Clear the response content and headers
Response.ClearContent();
Response.ClearHeaders();

// Export the Report to Response stream in PDF format
report.ExportToHttpResponse( ExportFormatType.PortableDocFormat, Response, false, "My Report");
}
catch( Exception ex )
{
// use any logic to show the error, e.g. label, messageBox..
}
}

What I have tried:

I can load and display crystal report without crystal report viewer. but i am not getting idea to pass parameter ? can any body help me?
Posted
Comments
Vincent Maverick Durano 22-Aug-16 12:02pm    
This has been asked many times before. Have you tried searching the web?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900