Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: if small caps then crred Post Reply Post New Topic
<< Prev Page  of 2
Author Message
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Mar 2016 at 4:04am
ah - I thought this was a test formula outside the formatting
you need the if-then
if instr(lowercase(replace({this.table},"-","")),replace({this.table},"-",""),0)= 1 then crred else crblack
IP IP Logged
belfane
Newbie
Newbie


Joined: 18 Apr 2013
Online Status: Offline
Posts: 21
Quote belfane Replybullet Posted: 04 Mar 2016 at 4:15am
That got me closer. There is no error now. However, the first line of data now remains black, but all of the succeeding lines turn red, regardless of lower case and dashes.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Mar 2016 at 4:25am
a few samples please?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Mar 2016 at 4:26am
and your exact formula
IP IP Logged
belfane
Newbie
Newbie


Joined: 18 Apr 2013
Online Status: Offline
Posts: 21
Quote belfane Replybullet Posted: 04 Mar 2016 at 4:32am
Thank you again for taking the time to help with this.

The formula:

if instr(lowercase(replace({Large.Material},"-","")),replace({Large.Material},"-",""),0)= 1 then crred else crblack

The result:

B12-85632-003
30-6589256-025
23-6589564-026
63-3256895-028
a63-6325654-005
21-6925686-000
b32-2535689-002
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Mar 2016 at 4:41am
a. It is likely not the "-" but rather the fact that they are all numeric values.
you can add another exclusion to deal with that

if ISNUMERIC(replace({Large.Material},"-","")) then crblack else if
instr(lowercase({Large.Material}),{Large.Material},0) = 1 then crred else crblack
IP IP Logged
belfane
Newbie
Newbie


Joined: 18 Apr 2013
Online Status: Offline
Posts: 21
Quote belfane Replybullet Posted: 04 Mar 2016 at 4:59am
Perfect! Thanks again.

One last thing, can you recommend a worthwhile CR course that would help me to improve my understanding of these types of formulas?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Mar 2016 at 5:07am
personally I think you can order Brian's book from this site and read it front to back to get a big picture of the possibilities and limitations. Then just read a lot of the posts every day in the various sub forums and then test them in your own environment in a sandbox report. It is a great way to see various approaches as well as get introduced to different functions and operators.
IP IP Logged
<< Prev Page  of 2
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.016 seconds.