Crystal Report Failed to Logon

Discussion in 'ASP .Net' started by andy lim, Nov 1, 2004.

  1. andy lim

    andy lim Guest

    Hello all,

    I'm developing a web application using ASP.NET/VB.
    I have problem in viewing my CR reports. It returns following exception when
    I tried to view any CR report.

    CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed

    I found many similar problem in several .NET forums, and no working
    solution.

    Anyone can help?

    Many thanks in advance,
    andy
     
    andy lim, Nov 1, 2004
    #1
    1. Advertising

  2. It appears that the only way around this MAJOR BUG (I know, they call it a
    security feature) is to pre-load the data into a dataset and set it as the
    reports datasource. The big problem with this is that you need a typed
    Dataset in your project & a bit of extra code to connect & fill the dataset.

    For example, you add a new dataset item to your project.
    Then you drag the table(s) you want to have in the report from the server
    explorer onto your dataset design screen. Save when finished.
    Now you can create your new report based on the dataset, (or change the
    location on an old one). Just look for you dataset under the Project
    Data->ADO.NET Datasets entry in the connection list. Make your report as
    normal.
    When you have the report ready, you will need to fill an in-memory dataset
    variable with the actual data from the database and assign it as the
    datasource for the report. (ie, YOU handle the database, NOT Crystal Reports)
    Now you just set the reportsource of the viewer as normal.
    Something like the following:

    SqlConnection conn = new SqlConnection("Integrated Security=SSPI;Data
    Source=<mydbserver>;Initial Catalog=<mydatabase>");
    SqlDataAdapter adap = new SqlDataAdapter("SELECT * FROM <sometable>", conn);
    MyTypedDataSet data = new MyTypedDataSet();
    adap.Fill(data);

    MyReport rpt = new MyReport();
    rpt.SetDataSource(data);
    ReportViewer.ReportSource = rpt;

    All Done!

    I know the forgetting of database connection details is supposed to be a
    security feature, but I find it weird that it 'forgets' the information even
    when there is no information to forget. I have tried this with a few
    databases (Access file, SQL Server, text file) in secure & unsecure formats
    (ie, with & without passwords) on window & web forms.
    My discovery is that the web forms version of the reports WILL NOT connect
    to ANY database of ANY type/status/location AT ALL. Hence I call this a MAJOR
    BUG.

    If anyone has managed to get the Crystal Reports components working (as
    intended by the documentation) in a web application (we'll try web services
    later) please tell us how you did it!!!

    "andy lim" wrote:

    > Hello all,
    >
    > I'm developing a web application using ASP.NET/VB.
    > I have problem in viewing my CR reports. It returns following exception when
    > I tried to view any CR report.
    >
    > CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed
    >
    > I found many similar problem in several .NET forums, and no working
    > solution.
    >
    > Anyone can help?
    >
    > Many thanks in advance,
    > andy
    >
    >
    >
     
    =?Utf-8?B?R2FyeSBL?=, Nov 15, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    512
  2. Replies:
    0
    Views:
    2,634
  3. =?Utf-8?B?Umljaw==?=

    Logon Failed for Crystal .NET Report in ASP.Net

    =?Utf-8?B?Umljaw==?=, Nov 26, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    443
    =?Utf-8?B?Umljaw==?=
    Nov 26, 2003
  4. =?Utf-8?B?S2FydW4gS2FydW5ha2FyYW4=?=

    Re: "Logon failed" for Crystal Report

    =?Utf-8?B?S2FydW4gS2FydW5ha2FyYW4=?=, Feb 25, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    548
    =?Utf-8?B?S2FydW4gS2FydW5ha2FyYW4=?=
    Feb 25, 2004
  5. Andy Lim

    Crystal Report Logon Failed

    Andy Lim, Dec 10, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    350
    Andy Lim
    Dec 10, 2004
Loading...

Share This Page