Results 1 to 9 of 9

Thread: [RESOLVED] How to get rid of the login box

  1. #1

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Resolved [RESOLVED] How to get rid of the login box

    Hello everybody,

    I am using CR 10 with ASP.NET 1.1/MSSQL. Whenever I run the report from application, it first shows a page where it asks SQL Server username/password and then it shows the report. My report is directly connected to a View in the SQL Server database.

    How can I get rid of this login box when the report is presented from the application?

    Thanks.

  2. #2
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    Re: How to get rid of the login box

    see my post http://www.vbforums.com/showthread.php?t=451212, you need to apply logon information to each table of the report.
    "The dark side clouds everything. Impossible to see the future is."

  3. #3

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: How to get rid of the login box

    Thanks a lot. I will try your code and will let you know.

  4. #4

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: How to get rid of the login box

    I converted your code in C# and tried but getting logon failed exception. Here's the code.

    Code:
    		Database crDatabase;
    		Tables crTables;
    		//CrystalDecisions.CrystalReports.Engine.Table crTable = new CrystalDecisions.CrystalReports.Engine.Table();
    		TableLogOnInfo crTableLogOnInfo = new TableLogOnInfo();
    		ConnectionInfo crConnectionInfo;			
    
    		ReportDocument crReportDocument = new ReportDocument();
    		crConnectionInfo = new ConnectionInfo();		
    		crConnectionInfo.ServerName = "LOCALHOST";
    		crConnectionInfo.DatabaseName = "PCSNSurvey";
    		crConnectionInfo.UserID = "sa";
    		crConnectionInfo.Password = "sa";
    						
    
    		crReportDocument.FileName = Server.MapPath("Reports/CustomerList.rpt");
    		crDatabase = crReportDocument.Database;
    		crTables = crDatabase.Tables;
    			
    		foreach(CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
    		{
    			crTableLogOnInfo = crTable.LogOnInfo;
    			crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
    			crTable.ApplyLogOnInfo(crTableLogOnInfo);
    		}
    				
    		rptCustomerList.ReportSource = crReportDocument;
    I am getting exception on the following line, however I am providing simple login credentials of my local pc.

    crTable.ApplyLogOnInfo(crTableLogOnInfo);

    Would you please help me out with this?

    Thanks.

  5. #5

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: How to get rid of the login box

    I am trying this code as well. It doesn't throw exception when report is loaded but shows report with old data. When I click Refresh, application blows up and says "Login failed.".

    Code:
    		CrystalDecisions.CrystalReports.Engine.ReportDocument reportDoc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
    		reportDoc.FileName = Server.MapPath("Reports/CustomerList.rpt");	
    				
    		string serverName = PCSN.SurveyApplication.BusinessLogicLayer.DatabaseInfo.GetServerName();
    		string databaseName = PCSN.SurveyApplication.BusinessLogicLayer.DatabaseInfo.GetDatabaseName();
    		string userName = PCSN.SurveyApplication.BusinessLogicLayer.DatabaseInfo.GetUserName();
    		string password = PCSN.SurveyApplication.BusinessLogicLayer.DatabaseInfo.GetPassword();
    
    		reportDoc.SetDatabaseLogon(userName,password,serverName,databaseName,true);
    				
    		rptCustomerList.ReportSource = reportDoc;
    Thanks.

  6. #6
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Smile Re: How to get rid of the login box

    Basically login problem in the CR will occur when the report can not find the data table. I make a different code for this but it is VB.NET, Just read CR in VB.NET at my signature.

  7. #7

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: How to get rid of the login box

    The problem was on my side. Basically I need to provide login information and survey name for DSN.

    Thanks.

  8. #8
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Arrow Re: How to get rid of the login box

    Quote Originally Posted by usamaalam
    The problem was on my side. Basically I need to provide login information and survey name for DSN.

    Thanks.
    Ok that is other matter, no idea about that.

  9. #9

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: [RESOLVED] How to get rid of the login box

    Yes, basically reports were designed by some other developer and I didn't notice it is going to connect via DSN. Now I can use it from application without a login box.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width