Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

duplicates

Status
Not open for further replies.

unknownly

Programmer
Jul 7, 2003
181
US
Using CR 8.5

I have a table called errors.
fields:
error-id,
utility,
point,
error message,error month

In some case there might be errors generated more than once with different error_id though the remaining fields are same. (sometimes rarely with a different error message)

my user need to see these duplicate error messages in 2 seperate column in the report.

Can anyone help how I can do this

TIA,
Sweetie

 
Group by the duplicate fields. Suppress the detail lines and show the values in the group header or footer.

For each group, have a minimum and maximum of error_id, and also error message. When the maximum value is different, show it to the right of the minimum, giving the look of two columns.

This will work fine as long as there are just two values. If there were three, the middle one would be missing and there would be no easy way round.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Is there any other way around to do this. Since I may have more than two. I won't be possible for me to show in multiple columns when more than 2.

How can i do this if shown in the same column(one column) with the amounts getting double? Hope I clear with my Q.

ex: when more than one error message
I can't group by error message because there is custom group done base on a parameter to group by which includes error message as a pick list in the parameter

company utility point flowmonth amount errorMessage
1 BUG BUG 1 07/07 418 no volume
1 BUG BUG 1 07/07 418 volume not found

TIA,
Sweetie
 
What you could do is collect the values for the group, using variables. Here's one I did for postcodes:
Code:
// Accumulate using a formula field (suppressed) in the detail line.  Allow for nulls and blanks.
whileprintingrecords;
if not isnull({Recc.Postcode}) and {Recc.Postcode} <> " "
then stringvar pst := pst + {Recc.Postcode} +", "
else if length(pst) = 0 
then stringvar pst := pst + "Excluding blanks; "
else stringvar pst := pst
Code:
// Show in using a formula field in the group footer.
whileprintingrecords;
stringvar pst;
left(pst,len(pst)-2)
Code:
//  Clear using a formula field using in the group header.
whileprintingrecords;
stringvar pst := "";
Note that clearing in the footer avoids problems with group headers repeating on a new page, which does clear everything for the group. Provided the 'clear' is placed in the section AFTER the display, it will do them in that order.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I tired this logic and it works but I get the "a string can be almost 254 char long".

Can I somehow restric it to collect only 2 or 3 values.
the field type is varchar 255 and checked a max leng with trim it's 108 for a single message?

Please advice.

TIA,
Sweetie


 
Upgrade to Crystal XI, it can be 64,000 characters long in that case.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If the phone doesn't ring, it's me".....Jimmy Buffet
 
If you're not in a position to upgrade, you'll need to adjust the formula to save in several separate fields. Use Length({your.field}) to get lengths.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top