login Failed

I have a windows app that connects to a sql database.  I now want to do reporting from it.  I have created a CR report (from the buit-in VS2003 version of CR) that is going to be used to display the information. 

When I run the app I get a login prompt for the database.  No matter what I enter into the prompt CR returns "Login Failed".  Searching the web the only references to try and solve the problem deal with using CR for reports on the web which are of no use to me.  Searching Business Objects website I find references to webpages using CR and unless there is an option I'm missing I can only see snipits of the reply messages (even when clicking on the exact reply) again not help.

Questions
1.  Can I directly (not ODBC) connect to a SQL database via built-in CR.
2.  What is the VB (not C# or any Webpage) code to bypass the login prompt

Thank
David Davis


Answer this question

login Failed

  • Brian Kesecker

    Hi Keith

    I met the similar problem. The crystal report web application shows a "Load Report Failed" message in the client machine. The application runs fine in the development machine.
    (1) There is a subreport in the report;
    (2) There are two tables in the report;
    (3) I selected Access/Excel DAO to connect a DBF file

    Do you have any suggestions

    Thanks

    Eddy

  • Rajeev Goel msft

    I used the sample code for vbnet_web_adonet example to configure the database access & selection query. (this works just fine)

    The following is the code that I'm using to bypass the login screen
    (from vbnet_web_simplelogonengine example)
    '************************************************************
    '  Database Login information
    '************************************************************
    Dim crReportDocument = New rptMfgCR

    'Create a new instance of the connectioninfo object and
    'set its properties

    'Note: This sample report connects to the sample SQL Server database, Pubs,
    'If you have access to SQL server, enter in your values for the ServerName,
    'UserID and Password properties to connect. The report included with this
    'sample application connects using OLE-DB and SQL authentication.

    crConnectionInfo = New ConnectionInfo
    With crConnectionInfo
    .ServerName = "Schuette-M2M"
    .DatabaseName = "SIDevelopment"
    .UserID = "sa"
    .Password = "just4amin"
    End With

    'Get the tables collection from the report object
    crDatabase = crReportDocument.Database
    crTables = crDatabase.Tables

    'Apply the logon information to each table in the collection
    For Each crTable In crTables
      crTableLogOnInfo = crTable.LogOnInfo
      crTableLogOnInfo.ConnectionInfo = crConnectionInfo
      crTable.ApplyLogOnInfo(crTableLogOnInfo)
    Next

    When I run the program on the development computer I still get the login screen.  when I run the program on the deployment I get "Load Report Failed".

    Development Computer:    Win 2k3 Server (basic install)
    Deployment Computer:      Win 2k3 Server (Running Citrix)

    I also test the program on a Win XP computer with the same "Load Report Failed".  If I cancel the login or click OK on the "Load Report Failed" message the report still displays.

    Thanks
    David Davis


  • cedubose

    Hi David,

    Let's focus on the development machine first.

    Do you have subreports in this report
    How many tables did you use to create this report
    Which database access method did you select for the report
    Where do you have the logon code for you report in your application

    Do you have Pubs in your development SQL Server

    Can you try using the sample application from:

    http://support.businessobjects.com/communityCS/FilesAndUpdates/vbnet_win_samples.exe.asp

    This is our group of .NET windows sample applications and the sample I would like you to try is vbnet_win_dbengine.  Simply change the crConnectionInfo to match your server and see if this sample will run.

    Thanks,
    Keith - Business Objects

  • nannypooh

    I am having the exact same problem as Rob. All of the information I pass in is displayed in the login box, but the database name text box is blank and disabled. This works perfectly fine on any machine with Visual Studio installed. I've installed the .net framework, MDAC, and Crystal 10 on the client machines, and they still get the error.
  • Rahul Dixit

    Hello David,

    What database access method did you choose

    Is this happening on the development machine or does this happen when you deploy the application

    Are you changing database location at runtime

    What code did you use to set the database logon info

    Here is an article on how to pass in the logon info at runtime with VB.

    http://support.businessobjects.com/library/kbase/articles/c2010371.asp

    Keith - Business Objects



  • Nathani

    Mashuri

    Sorry it took so long to rely (I didn't notice there was a new post on this thread.

    If you are still having problems.  As I recall my problem was the fact that I bound the database incorrectly.  Once I bound the DB to an ADOrecord set the login code worked correctly

    HTH

    David Davis

  • jbullard

    Hello David,

    >>> Can I directly (not ODBC) connect to a SQL database via built-in CR.

    You can connect to a SQL database using ODBC or OLE-DB

    >>> What is the VB (not C# or any Webpage) code to bypass the login prompt

    We have sample codes that will walk you through the process of bypassing the login prompt. You can download it from:

    http://support.businessobjects.com/communityCS/FilesAndUpdates/vbnet_web_samples.exe.asp ref=devzone_netzone_resources_supportsampleapp

    For additional resources/samples, please go to:
    http://www.businessobjects.com/products/dev_zone/net/resources.asp ref=devzone_netzone_nav

    For informations on Crystal Reports for Visual Studio 2005, please go to:
    http://www.businessobjects.com/products/dev_zone/net/2005.asp


    -- Thanh


  • Macromullet

    Hi all,

    I have a (similar ) problem whereby direct DB access (OLE DB (ADO)) from a Windows forms application (VS.NET 2005 Pro) works fine in the development environment, but nomatter what I do to deploy the application, it keeps coming up with the logon prompt on the client machines. Oddly enough, it shows in teh logon prompt, the server, userID and password I have passed in, but the Database name is blank(!) (and greyed out).

    Here's the code I'm using to pass in the credentials:

    {

    testReportDocument = new ReportDocument();
    string reportPath = Application.StartupPath + "\\" + "TestReport.rpt";
    testReportDocument.Load(reportPath);

    // Database Access
    ConnectionInfo connectionInfo = new ConnectionInfo();
    connectionInfo.ServerName =
    "servername";
    connectionInfo.DatabaseName =
    "databasename";
    connectionInfo.UserID =
    "user";
    connectionInfo.Password =
    "password";
    connectionInfo.IntegratedSecurity =
    false;

    SetDBLogonForReport(connectionInfo, testReportDocument);

    crystalReportViewer1.LogOnInfo = objTableLogonInfos;
    crystalReportViewer1.ReportSource = testReportDocument;

    }

    private void SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument)
    {

    foreach (Table table in reportDocument.Database.Tables)
    {

    TableLogOnInfo objTableLogonInfo = new TableLogOnInfo();
    objTableLogonInfo.TableName = table.Name;
    objTableLogonInfo.ConnectionInfo = connectionInfo;
    objTableLogonInfos.Add(objTableLogonInfo);
    table.ApplyLogOnInfo(objTableLogonInfo);

    }

    }


  • ej_dba

    Hi Keith

    Turns out that the problem was with the report itself.  I redesigned it and now it works perfectly.

    Thanks for all the help

    David Davis

  • ixTitan

    Hi David,

    Could you please tell me what u did

    I am still not able to get it on my client's computer.

    Thanks,

    Kalpna


  • vishal srivastav

    Double post
  • Daeseong Han

    I solved my problem. When I created the report, I used the native SQL Server driver in my connection. I changed it to the Microsoft OLE DB driver, and the report worked fine after that. The Microsoft driver must be the only one that gets installed on the client's machine. That's why it would work fine on a machine with Visual Studio. I hope this helps those that were having the same problem as me.
  • saaniok

    Thanks for the samples.  the ado connections works like a charm.  Big Smile

    Now the only problem I have is the login screen.  On a Win 2k3 server (for testing) even using the code from the sample logon engine/viewer, the logon screen still appears, if I click on cancel the report still appears.  Running the same code on a Win XP SP2 the logon screen doesn't appear but I do get a message "Load Report Failed", when I click on OK the report still appears.

    This report will be ran on a Citrix (Win 2k3) server.

    OT: How long does it take for an email registration request to get processed.  I used email reg.  because I want the keycode in case I have to reinstall VS2003.

    Thanks

    David Davis

  • SirThomas

    Hi David

    Do you mind to share with us what exactly the changes you have done to the report.  I have similiar problem like yours


  • login Failed