cancel
Showing results for 
Search instead for 
Did you mean: 

How To Font Bold in Crystal Report

former_member1229785
Participant
0 Kudos

Hi All

Here my problem is in crystal report, i have Bind two location in one Column using new line("\n"), here i'm using formula for bold font in crystal report like

if {DataTable1.DataColumn1} ="YES" then if {DataTable1.col1} = {DataTable1.DataColumn2} /// DataTable1.col1= J4+"\n\n"+J3 then     /// here i stored location which i want to bold in DataTable1.DataColumn2 crRegular else crBold else crRegular

when i use this formula it show all bold

How can i do this....

Thanks !

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Try:

if {DataTable1.DataColumn1} = "YES" AND {DataTable1.col1} = {DataTable1.DataColumn2} then

     '<b>' & {Column} & '</b>'

else

  {column}

Drag and drop this formula field on the report > Right-click and select format field > Paragraph tab > Under 'Text Interpretation' set 'HTML Text'.

-Abhilash

former_member1229785
Participant
0 Kudos

Hi Abhilash

   here i try like this as ur formla

if ({DataTable1.DataColumn1} = "YES" AND {DataTable1.col1} = {DataTable1.DataColumn2}) then

     '<b>' & {DataTable1.col1} & '</b>'

else

{DataTable1.col1}

it showing error like "THE FORMULA RESULT MUST BE A NUMBER"

abhilash_kumar
Active Contributor
0 Kudos

Try:

if ({DataTable1.DataColumn1} = "YES" AND {DataTable1.col1} = {DataTable1.DataColumn2}) then

     '<b>' & {DataTable1.col1} & '</b>'

else

     Totext({DataTable1.col1})


-Abhilash

former_member1229785
Participant
0 Kudos

It showing same error message, Abhilash

abhilash_kumar
Active Contributor
0 Kudos

What is the datatype of {DataTable1.col1}?


Please post a screenshot of the full formula editor window with the error message

-Abhilash

former_member1229785
Participant
0 Kudos

i have one dough, i binding Col1 like (J1 \n\n J3), if we use '<b>' & {DataTable1.col1} & '</b>' the total Col1 is bold na but i want bold J3 or J1 in the Col1.

How to do this

thanks !

abhilash_kumar
Active Contributor
0 Kudos

Please post a sample dataset and expected output.

-Abhilash

former_member1229785
Participant
0 Kudos

Hi,

    i'm doing Employee OT Report, here i want bind OT location where they work like DayLocation1, NightLocation2, so i add new line like (DayLocation1 \n\n NightLocation2) it bind in crystal report like

DayLocation1

NightLocation2 (in same column name (DataTable1.col1))

and i just check one condition DataColumn1="DayLocation1" (if true i want bold DayLocation1) at the same time if(DataColumn1="NightLocation1"), if true i want bold NightLocation2

if it not clear i ll attach image...

abhilash_kumar
Active Contributor
0 Kudos

Please attach the image as well.

-Abhilash

former_member1229785
Participant
0 Kudos
abhilash_kumar
Active Contributor
0 Kudos

Try:

If Right({column},2) = 'J3' then

    Replace({column},'J3','<b>J3</b>')

else {column};

Make sure HTML Text is set under 'Text Interpretation.

-Abhilash

former_member1229785
Participant
0 Kudos

Thanks for replay but same Error ! "THE FORMULA MUST BE A NUMBER"

abhilash_kumar
Active Contributor
0 Kudos

Please post a screenshot of the formula editor window with that error message.

-Abhilash

former_member1229785
Participant
0 Kudos
abhilash_kumar
Active Contributor
0 Kudos

It seems you're using this formula in the 'font' tab.

Please create a new 'formula field' via the Field Explorer > Set it to interpret HTML Text and use this formula field on the report.

-Abhilash

former_member1229785
Participant
0 Kudos

ya it working fine , it not possible to use data set having  some design problem

former_member1229785
Participant
0 Kudos

Thanks a lot it working fine, ....  i have tried past 1 day for that issue.... thanks...

former_member1229785
Participant
0 Kudos

I need ur help again,

how to use </br> in this code

If Right({DataTable1.col1},2) = 'J3' then

    Replace({DataTable1.col1},'J3','<b>J3</b></br>')

else {DataTable1.col1};

abhilash_kumar
Active Contributor
0 Kudos

Hi Prasanna,

Please create a new discussion for this issue per SCN's rules.

-Abhilash

Answers (0)