简体   繁体   中英

Can Crystal Reports be exported as pdf and excel independently on button click in Winforms

I have to export my database records into pdf and excel.Exporting option i need to perform on separate button clicks ie if i click export2Excel button excel file should be generated with OpenWithSaveAs Dialogue box and vice versa.I know that in web its possible but have no idea in Windows Form Application. Is this possible in windows form application using C# .Please help me.

You can try this code:

Response.Buffer = false;
Response.ClearContent();
Response.ClearHeaders();
oRpt.ExportToHttpResponse(ExportFormatType.PortableDocFormat,Response,true,"COUNTRIES");

Also check references here and here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM