In Crystal reports, I have a detail line that includes fields from multiple TSQL tables. Detail lines print twice because multiple records are returned from one of the tables. I want only the first record returned for each of the tables with fields in the detail section.
I have tried to use field formatting to suppress after RecordNumber>1 but this only suppresses the field. I have Select Distinct records selected in database options.
I am not seeing a way to do this with Crystal options or formatting. Am I wrong? The only option seems to be a TSQL command to pre-process the table.
A cheap work-around could be to set up a suppressed running total variable that resets on group change, and then, suppress the detail section if the variable RTotal is greater than 1.
However, you're likely running into issues because the tables have not been joined properly. If you don't correctly identify the relationship between SQL tables using their respective ID columns, Crystal Reports will cross join those tables--giving you duplicate rows.
You can check the Table Link. Then on the Fields Right click and Format Field. Click on Suppress Duplicate if you want to see Unique value.
Other way would be creating a group from the detail value and suppressing Details.
Related
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.
I am using crystal report in my vb.net program. Because of my database design I get some rows duplicated as in the following picture:
As you can see from the picture, the first record has two printer models that have the same ink group. and the next model is the only model that has that particular ink group. As I have mentioned before This is because the way I designed the database and its not the problem. I know how to suppress a single column.
When I select a column and check "suppress if duplicate", the following results show:
The row is suppressed but also has taken a place in the report details.
My question now is how to suppress a whole duplicated row?
thank you
As you are aware that your database design is producing these type of results, one option would be check the option Select Distinct Records so that only distinct records are displayed.
One more option.. This is not a tested one change as you required, This is just an idea
write a condition in supress of the section where you placed your data.
if ID=next(ID)
then true
else false
This condition will make sure that if next row is duplicated then it will be supressed
there is many Options , Easy one Is,
you can use Grouping in Crystal report , in your Example u can Group on ID then Suppress Group Detail and Group Footer Problem Solve Have Fun with Coding
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.
Hi I am using Crystal Reports 10 to generate my reports. In one of the reports I see that a group header is getting repeated 2 times in the output document while in the design tab I can that it is present only one time. I am having my query as a "Union All" of 2 data sets.
Please advise what could be the cause. Thanks.
Your grouping condition just generates two different groups and some detail suppression condition kills details for one of these groups?
Create "debug" detail section without any conditions and show there some non-empty field from leftmost table from your data tree (and optionally something from other tables) - usually this helps to debug such problems out. (I usually make such debug fields red to rememeber hide that section before sending report to customer :)) Check too that "convert null values" options in report options are set appropriately.
I have a problem with running Total in Crsystal report9
if their is no values available for a Paticular field how can we return the running total as '0'
Instead of display the Running Total directly in your report create a Formula Field based on the Running Total and drag it into the report.
Your formula should look like this (Crystal Syntax)...
if ISNULL({#RunningTotalField}) then
"0.00"
else
ToText(RunningTotalField, 2)
If there is no data for that particular group, then Crystal won't show it easily. Your options are :
1) Use subreports to display the values for a particular group, and keep the main report just looking at the table(s) containing the group headers.
2) Use a stored procedure as the source so you have full control over the SQL that is run.
The problem is that as soon as you use a field to group, Crystal will only return records where that field has been used. If it was simply in the Details section you could modify the link to a LEFT JOIN and it wouldn't matter, but the group forces the INNER JOIN which means the groups without data are not returned.
Unfortunately Running Totals don't show up if there are no records that match your criteria. An alternative is to use a set of formulas calculated in various sections of the report. The technique is widely described in the Crystal literature. For example, this TekTips gives a very succinct overview of your options.
You set up an initialising formula in each header, with the evaluation time directive "WhilePrintingRecords". This approach was the only one available for doing running totals in the "good ol' days" before RunningTotal objects were available.