Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: duplicated value in grouped field Post Reply Post New Topic
Author Message
Indigenous
Newbie
Newbie


Joined: 25 Sep 2014
Online Status: Offline
Posts: 3
Quote Indigenous Replybullet Topic: duplicated value in grouped field
    Posted: 29 Nov 2016 at 8:31am
Greetings, I can't seem to get a duplicated value in a grouped field to render correctly (field is to turn red if duplicated).

group1 - location
group2 - invoice#
details - items associated with invoice

Invoice# field font color formula 'if invoice#=previous(invoice#) then red else black'.

This only works if the invoice# is exactly the next record displayed. Any records in between causes the field to remain black.

I'm not trying to suppress any records ... just change color on condition.

Any thoughts?

Thanks, Ian


IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Nov 2016 at 9:13am
sample data?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 29 Nov 2016 at 11:50am
A bit confused.  If you are grouping by Invoice number, then all records in that group should have the same invoice number?!?
IP IP Logged
Indigenous
Newbie
Newbie


Joined: 25 Sep 2014
Online Status: Offline
Posts: 3
Quote Indigenous Replybullet Posted: 30 Nov 2016 at 7:41am
data sample--

location A [group1]
    invoice 1 [group2]
    invoice 2 [group2]

location B [group1]
    invoice 1 [gpoup2] - (same value as found in location A but doesn't respond to invoice#=previous(invoice#) formula to set a condition)

And correct, a particular invoice# only shows up once under each location.

The goal is to have any invoice# change color if it shows up more than once anywhere in the report.

I don't understand why this is happening. It seems like other reports work fine with a similar setup. Might I have a wrong setting somewhere .. or does this seem like it needs a more involved formula...




IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Nov 2016 at 10:22am
Ahhh
Your location group is splitting up the invoice.
That is why previous/next wont work as it is the order in which it is displayed in the report, not the source table.
That is a bit tricky. There are not likely any good ways to do this with creating another data point to use.
Do you have rights to creating a stored procedure or a crystal command?
If so you can create a count of the invoices and then join that to the data set and use the count value to conditionally set your font color.
IP IP Logged
Indigenous
Newbie
Newbie


Joined: 25 Sep 2014
Online Status: Offline
Posts: 3
Quote Indigenous Replybullet Posted: 01 Dec 2016 at 6:48am
Yeah, no way to have access for a stored procedure.

I think the quick answer will be to run a second report just for dups.

Thank you all for your efforts.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.