No data returned in Crystal Reports - 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.

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.

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

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.

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.

Items in details repeating itself in Crystal Reports

Situation
I got stucked to some weirdo in Crystal reports. See the image below of my RAW RPT.
Everything in my report is coming fine except the details part. You can see there DetailsSection6, in which i have few columns(10-15). This rpt is binded with the XSD file and that XSD is then binded with its concerned dataset at runtime. Dataset has around 10 tables from which two tables are concerned here.
PROC_CONS_SUBBILL_REPORT - Header Table with single row.
CON_T_SUBBILL_DTL - Detail table having multiple rows based on the VoucherNo of above table.
What I want
I need to display all records of detail table in tablular format based upon the VoucherNo. Say in detail table (SUBBILL_DTL), I am having 25 records, but when table is rendered on the rpt, its starts repeating itself, sometimes twice sometimes thrice.
Kindly note:
My SP is returning the expected and correct data
RPT has 5-6 SubReports and in one report PROC_CONS_SUBBILL_REPORT table is used.
There is no Relationships in the report in the form of keys.
What I did
Tried removing all keys between the tables.
Suppressed the Detail Section but it suppresses the entire data.
Suppress the detail section with formula
{CON_T_SUBBILL_REPORT.CODE}=previous( {CON_T_SUBBILL_REPORT.CODE})
but still its not working.
I am totally lost. Kindly help.
Normally records are duplicated when the linking is wrong, In your case instead of formula try to use the option Select Distinct Records under Database tab.
This is a little late, but in case somebody else is looking for an answer.
I tried all the things above and nothing worked. Crystal reports was changing my query.
It worked in SQL Server but not in Crystal Reports.
The way I fixed it was by creating a view of my query on Sql Server and using the view
in my Crystal Report. It fixed everything.

crystal report field explorer not showing newly added field

I have created a crystal report with datasets(xsd) , it is working fine. Then i added a new field in xsd and when i open the field explorer it do not show that field, i added source again through database expert but still it is not showing that field. Any other person faced such issue then please help.
After waiting a lot for right answer and searching on internet i tried different options by myself and the problem was solved by right clicking on database fields and then click on verify database. If some one have some better option then please suggest.
I had the same problem and resolved it by adding parameter input and running the report from the designer. Crystal report popped up and said that it was fixing the report and refreshed the connection to the database for the most current fields.
I had a similar easy where Log on or Log off server and Verify Database wouldn't update the database fields list in Crystal Reports. The only thing that worked for me was to physically move the typed dataset to a different location. After creating a new connection within Set Datasource Location I updated the datasource and there it was....
Sap Crystal report has a problem while refreshing database changes to crystal report. I found this solution and it works like a charm:
First go to refresh data base option and then it will ask you to enter parameter values to the stored procedure
then without passing any values just press escape button it will suddenly ask you to confirm the changes made to database when you do it on second time it will say database is up to date
Don't forget to rebuild your solutions before validate your database.
Restarting the Machine did the trick for me.
Some data types in dataset can't show in crystal reports try to change data types ( example don't use System.DateTimeOffset use datetime only)
Verity database in database fields
If your DataSet (.xsd) came by "Add Existing File" and not create one, then you will encounter a problem like mine. to fix this:
-Find the DatasetName.xsd file and all of its name-like file . Copy it EXCEPT THE DESIGNER (DatasetName.Designer.cs) and paste it somewher, you will re-paste it later
-In your VS. Delete the DataSet (xsd File) in your project by right click it in your Solution Explorer. This will delete any traces of file.
-Re-paste the files that you copied in the same location. Then in VS. And add the xsd file that you re-paste.
-Then you can now add columns. And it will update the DataSet, and also the Crystal Report will see the updated column
Reason: For i-dont-know-what-the-heck-happened, if you include the designer file then add it in you project, then you add columns to it, the VS will create new designer.cs file instead of overwriting the existing file. So the column registers only in original but the newly created one only recognized as valid (which is no traces of new added column)
You can press F5 to see preview, if crystal report find out new fields it will verify all field in database, and your new fields will appear.
Hope this will help you!
Log off from server, then verify database, that did the trick for me!
By just updating the entire datasource location did not work for me. I had to expand the source location and then update the individual table. Hope this helps someone.
Right click REPORTDATASET then select Set Datasource Location.
click database files and select your existing *.xsd. then you will see REPORTDATASET.
select it.
update
close
Now you will be seeing the new fields in your *.rpt :)
I use the following technique:
Select datadese expert in crystal report
Select previous added datatable.
Press "<<" to remove it from reporting, its related columns are removed from report automatically.
Then select Project Data>>ADO .Net DataSets>> your updated dataset
Press ">>" to add and click the OK button.
New added field also shows in dataBase fields and then added in report.