【问题标题】:Crystal Report viewer built in Export button problem水晶报表查看器内置导出按钮问题
【发布时间】:2011-01-08 04:46:00
【问题描述】:

我正在使用 VS 2010,带有 .net 4 的 Web 应用程序,

我从微软推荐的网站下载了水晶报表。

我在网页中添加了一个水晶报表,拖动了一个 CrystalReportViewer 和一个按钮。

我在button_click中输入了以下代码:

 ReportDocument cryRpt;
 cryRpt = new ReportDocument();
 cryRpt.Load("C:\\Users\\Yazan\\Documents\\Visual Studio 2010\\WebSites\\WebSite17\\CrystalReport.rpt");
 CrystalReportViewer1.ReportSource = cryRpt;
 CrystalReportViewer1.RefreshReport();  

所以很明显,当点击按钮时,会出现 CrystalReportViewer(显示我已经创建的 Crystal Report)。

单击导出按钮(已存在于 CrystalReportViewer 的工具栏中)时,会弹出一个窗口,让我选择要导出到的格式类型,并指定我想要的报表页面导出。

当我单击导出按钮时,页面被回发,CrystalReportViewer 消失了,我的旧网页(没有 CrystalReportViewer)包含以下消息:

“使用您指定的选项导出失败。请检查您的选项并重试。”

请注意,要导出为(pdf、doc...)的所有类型的文件格式都会发生此错误

请您帮我激活 CrystalReportViewer 的内置导出按钮吗?

谢谢

【问题讨论】:

  • 您是否尝试在控件属性上硬键入 ReportSource,只是为了检查它是否可以通过这种方式工作?
  • 非常感谢...这是我找了几天的解决方案...(我应该从CyrstalReportViewer的属性中修改ReportSourceID,然后问题就会解决)。如果你愿意,我建议你写这个解决方案作为答案,以使其成为答案......

标签: asp.net visual-studio-2010 crystal-reports


【解决方案1】:

在 Crystal Reports 查看器中修改 ReportSourceID

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-21
    • 1970-01-01
    • 2010-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多