【问题标题】:ASP.NET - Crystal Report Viewer Print Button Not Working In ASP.NETASP.NET - Crystal Report Viewer 打印按钮在 ASP.NET 中不起作用
【发布时间】:2012-06-29 12:34:54
【问题描述】:

我使用的是 Visual Studio 2008,但水晶报告有问题。 当我单击打印按钮时,它会将我带到没有找到页面的弹出窗口。弹出网址是

http://localhost/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer4/html/crystalexportdialog.htm

我已检查该路径上是否存在 crystalexportdialog.htm 文件:C:\Windows\Microsoft.NET\Framework\v2.0.50727\ASP.NETClientFiles\CrystalReportWebFormViewer4\html\crystalexportdialog.htm

这是我在 page_load 事件中的代码。

    ReportDocument rptDoc = new ReportDocument();

    ReportProjectProperties ds = new ReportProjectProperties();// .xsd file name
    DataTable dt = DbUtility.GetProjectWorksheets(15);
    ds.Tables[0].Merge(dt);
    // Your .rpt file path will be below
    rptDoc.Load(Server.MapPath("../Reports/report1.rpt"));
    //set dataset to the report viewer.
    rptDoc.SetDataSource(ds);
    CrystalReportViewer1.ReportSource = rptDoc;

谢谢。

【问题讨论】:

    标签: c# asp.net crystal-reports


    【解决方案1】:

    我已经解决了这个问题。你也可以在这个Crystal Report Viewer print/export buttons not working in ASP.NET MVC app看到我相同的cmets@

    Crystal Report 使用 javascript 文件进行打印,其自身的图像应包含在网站的根目录中。我已经通过在我网站的根目录上创建文件夹解决了这个问题

    aspnet_client/system_web/2_0_50727/

    并从此路径复制文件夹 CrystalReportWebFormViewer4

    C:\Windows\Microsoft.NET\Framework\v2.0.50727\ASP.NETClientFiles\CrystalReportWebFormViewer4

    在我创建的 2_0_50727 文件夹中。现在显示打印图像和打印/导出按钮,打印和导出功能也正常工作。

    谢谢。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多