我使用的是 visual studio 2008,我遇到了 Crystal 报表问题。 当我点击打印按钮时,它会将我带到没有找到页面的弹出窗口。弹出网址是
我检查过此路径中存在 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;
谢谢。
最佳答案
我已经解决了这个问题。你也可以看到我对这个 Crystal Report Viewer print/export buttons not working in ASP.NET MVC app 的相同评论
Crystal Report 使用 javascript 文件打印,它自己的图像应该包含在网站的根目录中。我已经通过在我网站的根目录上创建 folers 解决了这个问题
aspnet_client/system_web/2_0_50727/
并从此路径复制文件夹 CrystalReportWebFormViewer4
C:\Windows\Microsoft.NET\Framework\v2.0.50727\ASP.NETClientFiles\CrystalReportWebFormViewer4
在我创建的 2_0_50727 文件夹中。现在显示打印图像和打印/导出按钮,打印和导出功能也正常工作。
谢谢。
关于c# - ASP.NET - Crystal Report Viewer 打印按钮在 ASP.NET 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6465155/