none
Hide db login info in crystal report after migrate to VS2012 RRS feed

  • Question

  • Hi,

    i have a windows application in .net 2005 upgraded to .net 2012. the old version is running fine on a Win2003 Server. database is 2005 express on Win2003 Server.

    i have upgraded this application to vs2012. On my machine (Win7 - SQL Express 2005) the application is running fine with .net 2012.

    But on A Win2016 Server (the new engine for crystal report has been installed), all crystal reports display db login window and db name cant be seen although it has been provided. i have installed express 2012 on win2016 server for driver.

    i'm using this code:

       MyReport reportDelivery = new MyReport ();
       reportDelivery.DataSourceConnections[0].SetConnection(Globals.DB_Loc,Globals.DBName.ToUpper() , Globals.ReadUser_Name, Globals.ReadPassWord);
    
       reportDelivery.Refresh();      
       reportDelivery.RecordSelectionFormula = ReportCondition;
    
    //ReportCondition is a string that has a value for //filtering records
    
       Viewer.ReportSource = reportDelivery;

    all above code is running fine with old version on any machines. is there something i have to change after upgrade ?

    sorry if this is not the proper place for this question.

    Thanks,

    Sunday, March 25, 2018 8:41 AM

All replies

  • i have also tried the following method for report connection settings :

     private void SetReportConnection(CrystalDecisions.CrystalReports.Engine.ReportClass report)
            {
                ConnectionInfo connInfo = new ConnectionInfo();
                connInfo.ServerName = Globals.DB_Loc;
                connInfo.DatabaseName = Globals.DBName;
                connInfo.UserID = Globals.ReadUser_Name;
                connInfo.Password = Globals.ReadPassWord;
    
                Tables crTables; Database crDatabase; TableLogOnInfo crTableLogonInfo;   
    
                TableLogOnInfo tableLogOnInfo = new TableLogOnInfo();
                tableLogOnInfo.ConnectionInfo = connInfo;
                
                crDatabase = report.Database; crTables = crDatabase.Tables;
    
                foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
                { 
                    crTableLogonInfo = crTable.LogOnInfo;
                    crTableLogonInfo.ConnectionInfo = connInfo;
                    crTable.ApplyLogOnInfo(crTableLogonInfo);
                }
              
            }

    but useless.

    always, i'm getting the same window :

    any idea ?

    Thanks..

    Monday, March 26, 2018 7:12 AM
  • Hi,

    Welcome to MSDN forum.

    This forum is discussing the installation of visual studio, it is recommend to go to SAP Crystal Reports forum to talk about the problems. Thank you for the understanding.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 26, 2018 8:21 AM