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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting Formula Data to display in BOLD

Status
Not open for further replies.

CappsRLO

Vendor
Apr 18, 2007
31
US
I have a formula that will display data in the Details section into one line like this:
ItemA
ItemB
ItemC
prints out as one line like this:
ItemA, ItemB, ItemC

The solutions requires three formulas:
1) In the Group Header place the @reset formula:
WhilePrintingRecords;
StringVar chain := '';
NumberVar ChCnt := 1

2) On the Details place the @Accum formula:
WhilePrintingRecords;
StringVar Item:= {MYFIELD}
StringVar Chain;
NumberVar ChCnt;

if ChCnt = 1
then (ChCnt:= 2; chain := Item)
else
if Length(Chain) + Length(Item) > 254
then Chain := Chain else
chain := chain + ', ' + Item

3) On the Group Footer place the @Display formula:
WhilePrintingRecords;
StringVar Chain

What I am having issues with is I want to BOLD certain items in {MYFIED} based off the value of another boolean field.

Example - my existing data is ItemA, ItemB, ItemC
Now based off the result of a boolean field in the same data group I want ItemA to be BOLD, ItemB & ItemC to be regular font.
So if {BooleanField}=0 then {MYFIELD} crBOLD else crregular

This is easy to do when displaying a regular field in the Details section but I can't figure out how to do it in the above formula when it displays the data in one continuous line.

Any ideas?
 
You can do this by modifying the second formula to this:

WhilePrintingRecords;
StringVar Item:= {BooleanField}=0 then "<b>" & {MYFIELD} & "</b>" else {MYFIELD};
StringVar Chain;
NumberVar ChCnt;

if ChCnt = 1
then (ChCnt:= 2; chain := Item)
else
if Length(Chain) + Length(Item) > 254
then Chain := Chain else
chain := chain + ', ' + Item

After you save the formula, right click the field on the report, and choose Format Field. Under the paragraph tab, change the Text Interpretation to HTML text

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top