2011-06-24 64 views
2

我正在使用visual studio 2008,我遇到了水晶報表的問題。 當我點擊打印按鈕,它將我帶到沒有找到任何頁面的彈出窗口。彈出的網址是ASP.NET - 水晶報表查看器打印按鈕在ASP.NET中不工作

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

我已經檢查了crystalexportdialog.htm文件存在此路徑:C:\ WINDOWS \ Microsoft.NET \框架\ 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; 

謝謝。

回答

2

我已經解決了這個問題。你也可以看到我對這個Crystal Report Viewer print/export buttons not working in ASP.NET MVC app

Crystal Report使用JavaScript文件打印和應該包含在網站的根目錄中的自己的圖像。我已經在我的網站

aspnet_client/system_web/2_0_50727/

的根目錄下創建folers解決了這個問題,並從該路徑

ç複製的文件夾CrystalReportWebFormViewer4:\ WINDOWS \ Microsoft.NET \框架\ v2.0.50727 \ ASP.NETClientFiles \ CrystalReportWebFormViewer4

在我創建的2_0_50727文件夾中。現在打印圖像和打印/導出按鈕顯示,並且打印和導出功能正常工作。

謝謝。

相關問題