ASP.NET - Crystal Report Viewer 打印按钮在 ASP.NET 中不起作用

ASP.NET - Crystal Report Viewer Print Button Not Working In ASP.NET(ASP.NET - Crystal Report Viewer 打印按钮在 ASP.NET 中不起作用)
本文介绍了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 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)