【问题标题】:Can Crystal Reports be exported as pdf and excel independently on button click in WinformsCrystal Reports可以在Winforms中单击按钮独立导出为pdf和excel吗
【发布时间】:2014-03-13 14:08:42
【问题描述】:
我必须将我的数据库记录导出为 pdf 和 excel。我需要在单独的按钮单击时执行导出选项,即如果我单击 export2Excel 按钮 excel 文件应该使用 OpenWithSaveAs Dialogue box 生成,反之亦然。我知道在web 可能,但在 Windows 窗体应用程序中不知道。
这在使用 C# 的 Windows 窗体应用程序中是否可行。请帮助我。
【问题讨论】:
标签:
c#
winforms
excel
pdf
crystal-reports
【解决方案1】:
你可以试试这个代码:
Response.Buffer = false;
Response.ClearContent();
Response.ClearHeaders();
oRpt.ExportToHttpResponse(ExportFormatType.PortableDocFormat,Response,true,"COUNTRIES");
还要检查引用 here 和 here。