How to find what tables are used in SAP Crystal Report 2013? - crystal-reports

I am trying to debug missing data in an existing report.
I see the database it is connected to, but I do not find any table or stored procedure or view in that database with the same name that I see in the record selection part of the Crystal Report.
Is there a way to find which table/view/stored procedure is used as input for the Crystal Report?
Thank you

Never mind. I found it. Rt click on Database Fields and select Set Datasource location...

You need to set up first what type of connection you need.
This will help you using ODBC connection.

Ideally you can set this when first time confiugre the data, but suppose if you update the table or procedure and that will not impacted in your crystal report.
To update the updated db element / object in crystal report, simply "Update datasource" option click which pull the changes and update in crystal report.
May be helpfull in future.

Related

Adding second table field to report causes report to go blank - Crystal Reports 14.1.2.1121 using SQL Server Database source

I have a report pulling all fields from a single SQL Server table that works well. I need to add a second table to pull additional data, but doing so causes the entire report to go blank and number of records to drop to 0, from 242 without the added field from the second report. I have no grouping in the report either.
Reviewing Database Expert Links I see multiple links between the two tables, but the field in question, (CUSTPO_27, a String field), does not appear in the original table and therefore has no link. The field needs to be in the Details section of the report along with the data from the original table.
I have run Verify Database and get the "The database is up to date" message.
Running Dependency Checker finds no errors, even with the troublesome field added.
I am fairly new to Crystal Reports, but feel like I am missing a step to be able to see the second table field in the report, so any insight or direction would be greatly appreciated.
I would be happy to add code, but I don't see where to view the code in Crystal, (again, I am a newbie!)
Adding that field probably forced Crystal to join to a new table, and that join failed to find a matching record. So check your join logic.
Crystal doesn't update your database. It's Read Only.

Crystal Report showing empty when DB query returns data

Not sure what's going on here. I'm creating a report using two tables. I do an inner join on both tables to obtain the rows I need. I'm sure the proper rows exist because I have taken the DB query that Crystal Reports generates for you and ran it on sql developer and it returns the appropriate rows. Not sure why my report would return empty if it's grabbing the proper rows and the DB has been verified using Crystal Report's "Verify Database" tool.
Check and Double check each section of your report, you might have left some Suppression formula. Secondly check and double check Record Selection filters in the report.
Sometimes what we don't see the first time, miraculously appears the second time.

Replacing Crystal Report data source with store procedure

I used to create crystal reports by going into database expert, selecting tables and specifying the link manually. As I get a bit more comfortable with CR, there is a need for me to put the underlying SQL query into a store procedure to provide data to the report. But doing so will require me to rewrite the whole report which is time consuming.
So, my question is if there are any guru in the community that could and/or have tried to replace the underlying SQL (created by manually add table and links) with a store procedure or cmd without having to rewrite the whole report? I would love to get some hint of how to do that as I have a couple dozen of reports that need "adjustments" and time does not permit me to rewrite them all.
My Crystal Report versions are CR 2008 and CR 2012.
Thank you in advance.
In case you can use an existing software : this feature is available in a free Crystal reports viewer. Here is the documentation, which explains the use :
http://www.r-tag.com/Documents/RTag%20DataSource.pdf
... and here is where you can get your free license:
http://www.r-tag.com/Pages/FreeCrystalReportsViewer.aspx
Crystal does an absolutely horrible job of migrating from many tables to a single DB object, be it a Command or stored procedure.
You might be able to Database | Set datasource location... to map your SP to one of the many tables in the report (choose the one that has the most fields in use); I've never been able to get this feature to work trying to map a Command to a table.
'Best practice' for a really-poor 'feature' set:
create a formula field for each field that will be on the canvas, but isn't grouped (these fields won't be removed when you change datasources)
add the Command to the report; link tables if desired
manually switch grouping, record-selection formula, sorting, etc.

Can you update a data table, without losing your columns in your report in Crystal Reports?

I have a Crystal Report that contains numerous fields and functions that all reference one SQL Server data view. Recently, I've had to make a copy of the underlying SQL data view and make a few modifications. I need to use my new data view as my data source within my Crystal Report.
My problem is that I need to keep the original data view, without changing it's name, but I need my Crystal Report to reference the new data view.
Is there an easy way for me to update my report's data source without having to update all of my columns and formulas? Otherwise, I'm starting from scratch and might as well create a new report, which I'd prefer not to do.
Yes. I haven't used CR in a while, but I used to do that frequently. There's actually a built-in option to change your data source and remap any fields it can't find in the new data source.
Check out #1 of Todd Watson's answer:
How do I point Crystal Reports at a new database
Go to Field Explorer -> Right click on Database fields -> Go to Set Datasource location -> In lower section (Replace with) -> Go to My Connections -> Right click on New Dataset (go to Refresh).

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