ASP.NET - Crystal Report Viewer 打印按钮在 ASP.NET 中不起作用 [英] ASP.NET - Crystal Report Viewer Print Button Not Working In ASP.NET

查看:12
本文介绍了ASP.NET - Crystal Report Viewer 打印按钮在 ASP.NET 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am using visual studio 2008 and i am having issue with crystal reports. When i clicks on print button it takes me to the popup with no page found. Popup url is

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

我已检查该路径上是否存在 crystalexportdialog.htm 文件:C:WindowsMicrosoft.NETFrameworkv2.0.50727ASP.NETClientFilesCrystalReportWebFormViewer4htmlcrystalexportdialog.htm

I have checked that crystalexportdialog.htm file exists on this path: C:WindowsMicrosoft.NETFrameworkv2.0.50727ASP.NETClientFilesCrystalReportWebFormViewer4htmlcrystalexportdialog.htm

这是我在 page_load 事件上的代码.

This is my code on page_load event.

    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;

谢谢.

推荐答案

我已经解决了这个问题.您还可以在 Crystal Report Viewer 打印/导出按钮在 ASP.NET MVC 应用程序中不起作用

I have solved this issue. you can also see my same comments on this Crystal Report Viewer print/export buttons not working in ASP.NET MVC app

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

Crystal Report uses javascript files to print and its own images that should be included on root directory of the website. I have solved this issue by creating folers on root directory of my website

aspnet_client/system_web/2_0_50727/

aspnet_client/system_web/2_0_50727/

并从此路径复制文件夹 CrystalReportWebFormViewer4

and copied the folder CrystalReportWebFormViewer4 from this path

C:WindowsMicrosoft.NETFrameworkv2.0.50727ASP.NETClientFilesCrystalReportWebFormViewer4

C:WindowsMicrosoft.NETFrameworkv2.0.50727ASP.NETClientFilesCrystalReportWebFormViewer4

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

in 2_0_50727 folder i have created. Now print images and print/export buttons are displayed and also print and export functionality is working fine.

谢谢.

这篇关于ASP.NET - Crystal Report Viewer 打印按钮在 ASP.NET 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆