本文介绍了Crystal Reports未出现在生产服务器,Windows上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在使用c#在asp.net上使用Crystal Reports。



在测试n调试模式时,它运行良好。



但是在我发布我的web应用程序之后,在生产服务器上运行它。它没有查看我的报告。



我的c#代码:

Hi guys,

I was working on Crystal Reports in asp.net using c#.

In testing n debugging mode, it was running good.

but after i published my web application n run it on production server. Its not viewing my reports.

my c# code:

protected void GetReport()
       {
           try
           {
               String ReportPath = "";

               ReportDocument cryRpt = new ReportDocument();

               TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();

               TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();

               ConnectionInfo crConnectionInfo = new ConnectionInfo();

               Tables CrTables;

               ReportPath = Server.MapPath("\\dept.rpt");
               lblrpt.Text = ReportPath;
               cryRpt.Load(ReportPath);


               crConnectionInfo.ServerName = "ITACS";

               crConnectionInfo.DatabaseName = "ITAccessories";

               crConnectionInfo.UserID = "sa";

               crConnectionInfo.Password = "123456";



               CrTables = cryRpt.Database.Tables;



               foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
               {

                   crtableLogoninfo = CrTable.LogOnInfo;

                   crtableLogoninfo.ConnectionInfo = crConnectionInfo;

                   CrTable.ApplyLogOnInfo(crtableLogoninfo);

               }



               CrystalReportViewer1.ReportSource = cryRpt;
               CrystalReportViewer1.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None;
               //cryRpt.PrintToPrinter(1, false, 0, 0);
           }
           catch (Exception ee)
           {

           }
       }





Plzzz ......伙计们,帮助我。



我的经理在我的头上完成这个。



谢谢



Plzzz... guys, help me.

My manager is on my head to complete this.

Thanks

推荐答案


这篇关于Crystal Reports未出现在生产服务器,Windows上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 23:19