Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Case Sensitivity in string field formulas Post Reply Post New Topic
Author Message
adavis
Senior Member
Senior Member


Joined: 30 Oct 2012
Online Status: Offline
Posts: 104
Quote adavis Replybullet Topic: Case Sensitivity in string field formulas
    Posted: 26 Jan 2015 at 5:20am
I have a string field that stores usernames each time a user accesses a particular database. Each unique user has one of two values that would be stored in the logon field, either just their username or the domain\username depending on which application they used to access the database.

I wrote a formula to strip out the domain portion of the stored login credentials, then grouped my data on the formula so that I would return results for individual users regardless of how they accessed the database.

My formula @users = replace ({TABLE.LG_NAME}, "DOMAIN\", "")

When I use the formula to group the data, records where the username and DOMAIN\username are the same are grouped together; however, there are a handful of records stored as domain\username with the domain portion in lowercase and crystal is treating these as different records.

So, I sometimes end up with a separate group for an individual user if their login was stored with a lowercase domain\username value.

I hadn't expected Crystal to treat records in a case sensitive fashion like this and have not seen this issue before. Has anyone else experienced this?

I have tried unchecking the "database is case sensitive" feature in both report options and general options. Is there another place to look?

Any other tips?

Edited by adavis - 26 Jan 2015 at 5:21am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jan 2015 at 5:24am
from crystal help
 
Overloads
  • Replace (inputString, findString, replaceString)
  • Replace (inputString, findString, replaceString, startPosition)
  • Replace (inputString, findString, replaceString, startPosition, count)
  • Replace (inputString, findString, replaceString, startPosition, count, compare)
Arguments
  • inputString is a String containing substring to replace.
  • findString is a substring being searched for.
  • replaceString is the replacement substring.
  • startPosition is an optional Number indicating the position within inputString where substring search is to begin. If omitted, 1 is assumed.
  • count is an optional Number of substring substitutions to perform. If omitted, the default value is -1, which means make all possible substitutions.
  • compare is an optional Number indicating the kind of comparison to use when evaluating substrings:
    • 0 performs a comparison that is case-sensitive
    • 1 performs a comparison that is case-insensitive

      If omitted, a case-sensitive comparison is performed.

 

 

IP IP Logged
adavis
Senior Member
Senior Member


Joined: 30 Oct 2012
Online Status: Offline
Posts: 104
Quote adavis Replybullet Posted: 26 Jan 2015 at 5:25am
I missed that. Thanks DBlank.
IP IP Logged
Vimal Nair
Newbie
Newbie
Avatar

Joined: 29 Dec 2014
Location: United Arab Emirates
Online Status: Offline
Posts: 26
Quote Vimal Nair Replybullet Posted: 27 Jan 2015 at 12:55am
If only the column value has to be checked without Uppercase or lowercase, Simple formula also will help.

@users = Uppercase(replace ({TABLE.LG_NAME}, "DOMAIN\", ""))

And Do the grouping on @users. But display the user according to your choice. If you need all uppercase, display the same groupname else Pull the value from your formula which mentioned in the question.
Born To Live
IP IP Logged
adavis
Senior Member
Senior Member


Joined: 30 Oct 2012
Online Status: Offline
Posts: 104
Quote adavis Replybullet Posted: 27 Jan 2015 at 2:13am
I did play around with using uppercase or lowercase, but there were other anomalies in the data that those equations would miss, respectively.

Using the information DBlank posted from the help guide, I did get it to work. I just needed to add the compare argument.

@users = lowercase(replace ({TABLE.LG_NAME}, "DOMAIN\", "",1,-1,1))

Edited by adavis - 27 Jan 2015 at 2:15am
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.