SQL Server Performance

Crsytal reports with SQL server 2005

Discussion in 'SQL Server 2005 General Developer Questions' started by donsls, Dec 7, 2009.

  1. donsls New Member

    I ahve written a web application that users could use to run Crystal reports. I have generated a crystal report that has 6 tables, 1 view and 1 sql command. The SQL command has 28 tables linked, and the view retrieves the currently logged in user to the pc.
    This same view exists for other reports and it works fine.
    When I run this report with Crystal everything works without any issues. And if I run it inside VS2005, stil the report runs without any issues.
    But when I deploy the application and run it from the web site, it gives me the following error.
    Failed to retrieve data from the database. Failed to retrieve data from the database. Error in File report1{BIA0AA0b-1234-A234-C2325A3S3S}.rpt: Failed to retrieve data from the database.
    I believe this is a permission issue, but not sure which user(s). I use the below simple command to show the report
    Dim sReport As String = Server.MapPath("report1.rpt")
    CrystalReportViewer1.ReportSource = sReport
    This will prompt me to enter the connection information. I enter them with the active directory user and password and select yes to Intergrated Security. Then the page prompts me to enter the parameters. I enter them and click ok. Then is shows me the above error. I wrote the same code in windows application and it works without any issues. Could some one help me with this. I have been stuck with this for the past 3 minths and I am forced to develop the viewer in windows, which I don't like.
    Any help is greatly appreciated.
    I know that I am posting this in n SQL server forum, but I am 100% sure that this is a SQL server permission issue.
  2. satya Moderator

  3. donsls New Member

    Thanks for your reply. I checked it and it does not work with my project. The problem is I have many users creating crystal reports, so I am not sure what the tables are to use datasets.
    I did further testing with the current problem and I believe it is a sql command issue. If I use the SQL command as a view and use that view in my crystal report, everything works without any issues. And if I run only this sql command in the report, again everything works. The moment I link this with another view that gives me the current logged on user, it gives me the error message in ASP.NET. I tried to use impersonation with this, but still it gives me the same error. So I am 100% sure that the problem lies with the SQL command.
    Any suggesstions?

Share This Page