Click here to Skip to main content
15,906,708 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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... guys, help me.

My manager is on my head to complete this.

Thanks
Posted
Updated 25-Jan-14 2:46am
v2
Comments
karthik Udhayakumar 25-Jan-14 9:27am    
As you said it is working in local or test environment ,
What is the problem in production server..
The reports are not visible or values are not seen?explain this to help you?
abdul subhan mohammed 25-Jan-14 10:35am    
crystal reports in not visible, d server have other applications too, where cyrstal reports are used n they are running good. But only my app reports are not viewing.
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" />
plzzz help me
karthik Udhayakumar 25-Jan-14 22:46pm    
Hello Abdul,

Share your Aspx code to guide you..the server side code looks just fine!
idenizeni 26-Jan-14 5:30am    
If it works in development and not in production then I would look at the production environment before I start changing the code.

I think this is your first problem...

// you catch the exception but do nothing with it!
catch (Exception ee)
{

}

My guess is you are getting an error in production but you can't see what the problem is because you don't log or show the error anywhere. See if you can capture the error message and come back and update your question with it.

1 solution

Actually everything is correct & proper,

But the thing is, I was using bootstrap, n this bootstrap was stopping the crystal report to view,

So, I opened that report in new window. & its working well.

Thanks everyone.
 
Share this answer
 
Comments
thatraja 27-Jan-14 2:15am    
Oops, I'm late, I was almost away, that's why. Glad you have solved the issue
abdul subhan mohammed 29-Jan-14 4:11am    
thank you

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