crystal-reports

No data returned in Crystal Reports


I have a Crystal Report I'm working on; last week it was returning results but when I fired it up this morning I was no longer getting anything. Checking the SQL query, I show that the table name is listed twice, for some reason:

 SELECT "WMS_TESTINFO"."RECORD_NAME"
 FROM   "TestEnv"."dbo"."WMS_TESTINFO" "WMS_TESTINFO"

Any thoughts on what could have broken? I've checked that the database is connected and my data is still there.


Solution

  • The table name is listed twice as Crystal Reports creates an alias for every table.

    This Crystal generated SQL:

    FROM "TestEnv"."dbo"."WMS_TESTINFO" "WMS_TESTINFO"

    Is in the format of:

    FROM DATABASE.OWNER.TABLENAME ALIAS

    This is normal for Crystal.

    I would run that SQL in SSMS (remembering to remove all of the " first) to check that the data really is still there.

    If it is, check that a filter hasn't been added to the report, via the Select Expert menu opton, to filter out all the data.

    enter image description here

    Lastly, go to Database > Set Datasource Location and re-apply the connection to ensure that the report is definitely pointing at the right location.