Click here to Skip to main content
15,887,350 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
the server is not reading/connecting to ODBC connection..


can anybody plzzz help me...

the reports are generating in compile mode but after published, its not connecting to ODBC connection.

my 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);

                   lblrpt.Text += "\n ...*****************...";

               }



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

           }
       }


plz help me guys...

thanks
Posted
Comments
ZurdoDev 25-Jan-14 19:07pm    
What's the error?
thatraja 27-Jan-14 5:10am    
What's the error?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900