简体   繁体   English

在Winforms中单击按钮时,Crystal Reports可以独立导出为pdf和excel吗?

[英]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. 我必须将数据库记录导出到pdf和excel中。导出选项我需要在单独的按钮单击上执行,即如果我单击export2Excel按钮,则excel文件应使用OpenWithSaveAs Dialogue box生成,反之亦然。 Windows窗体应用程序中不知道。 Is this possible in windows form application using C# .Please help me. 是否可以在Windows窗体应用程序中使用C#。请帮帮我。

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 . 还要在这里这里检查参考。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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