Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Bold part of field Post Reply Post New Topic
Author Message
Hammerklavier
Newbie
Newbie


Joined: 24 Oct 2011
Online Status: Offline
Posts: 24
Quote Hammerklavier Replybullet Topic: Bold part of field
    Posted: 27 Oct 2011 at 2:29am

In my report, I have a customer number.  Usually it has six digits, but if there's a seventh digit, I want it to be bold.

 
Is there a way, without creating two separate fields, and without using the <b> tag, to be able to create a formula that will only bold the seventh digit of my customer number? 
 
Thank you.
IP IP Logged
SamD
Newbie
Newbie


Joined: 24 Oct 2011
Online Status: Offline
Posts: 15
Quote SamD Replybullet Posted: 27 Oct 2011 at 2:55am
Right click on the Customer Number field, select 'Format Editor', 'Font' tab click on x2 button for Style. Input this formula:
if Length ({Your customer# field name here}) > 6 then
CrBold
IP IP Logged
Hammerklavier
Newbie
Newbie


Joined: 24 Oct 2011
Online Status: Offline
Posts: 24
Quote Hammerklavier Replybullet Posted: 27 Oct 2011 at 3:03am
Sam,
 
This formula bolds the entire customer number field.  Is there a way to only bold the seventh digit of the field?
 
Thanks.
IP IP Logged
SamD
Newbie
Newbie


Joined: 24 Oct 2011
Online Status: Offline
Posts: 15
Quote SamD Replybullet Posted: 27 Oct 2011 at 3:53am
Hammerklavier,
Sorry, I read what you wrote wrong. Think you would have to break it apart.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 27 Oct 2011 at 4:00am
DBlank posted a response for an issue like this, and the solution was along these lines:
create 2 formulas, 1 for the left 6 digits like:
left(totext({table.field},0,""), 6)
and another for the rest of the string like:
mid(totext({table.field},0,""), 7)
 
place both formulas into 1 text field and mark the second formula as BOLD.  when the report runs, only the extra digits will appear bolded.
 
HTH
 
I haven't done this myself, but it seemed a fairly elegant solution to this type of issue.
IP IP Logged
Hammerklavier
Newbie
Newbie


Joined: 24 Oct 2011
Online Status: Offline
Posts: 24
Quote Hammerklavier Replybullet Posted: 27 Oct 2011 at 6:51am

Lockwelle,

 
I appreciate the response, and the solution does work, but I've been asked to do this using only one field and only one formula (without a <b> tag).  An odd requirement, I realize, but my boss is convinced this can be accomplished.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 27 Oct 2011 at 7:46am
well to the best of my knowledge, you can't. 
CR only works on whole fields....when you are doing things programatically.  If you were to type a word into a text field, you can bold any part of the word that you want, but when you want to do things using formulas, it is the whole field, which is why the response was to break the string into 2 fields.
 
HTH
IP IP Logged
CircleD
Senior Member
Senior Member
Avatar

Joined: 11 Mar 2011
Location: United States
Online Status: Offline
Posts: 251
Quote CircleD Replybullet Posted: 27 Oct 2011 at 4:26pm
The only way I can think it might work is to create another section with the 1 field you want and underlay it.You may have to play with the exact placement so it matches the other section.
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.016 seconds.