Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

text formatting in report builder

i use report builder to produce reports from Epicor Kinetic ERP.

epicor passes data as field values

i would like to be able to find a string inside that field value and format that string specifically and leave the rest of the field value as default.

 

example:

field = Part_PartDescription

Part_PartDescription = Red Cog (sometimes)

 

in cases where the field value contains the word red i want the word red to be colored red, but the rest of the text default (black)

 

the report only contains a text box with an expression value of "= Part_PartDescription"

 

Report Builder version appears to be v. 15.0.1473.0

 

any help?

1 ACCEPTED SOLUTION
d_gosbell
Super User
Super User

So this is possible by using a little bit of html

 

If you click on the placeholder (so that the field name is highlighted as below) and go into the placeholder properties

d_gosbell_0-1629328452278.png

 

You can then set the placeholder to interpret html (1) 

d_gosbell_1-1629328491912.png

 

and then in the Value section (2) you can use an expression like the following

 

=Replace(Fields!Color_Name.Value,"re", "<span style='color:Red'>re</span>")

 

I don't have any sample data with "red" as part of the text so I just randomly chose to make the characters "re" red using the following expression

 

d_gosbell_2-1629328579351.png

Note you could also build this html version of the text in your data model if it is easier instead of doing the replace in a report builder expression, the important bit is changing the placeholder property to tell it to treat html tags as styles.

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

that doesn't seem to work.....

 

the syntax seems to be accepted by Epicor and it isn't just replacing all the text with the single color word.  it's just unaffected.

 

=Replace(Fields!OrderDtl_LineDesc.Value,"Yellow","<span sytle='color:Red'>Yellow</span>")

 

so as soon as i pasted this i see the mistake....."sytle"

 

worked perfectly!  thanks.

 

i didn't realized the Replace() function was so "inline".  pretty simple really.

 

it's the syntax of the assignments i couldn't find.  i can follow your example pretty well.  i was going to ask where i can find that because i spent some time looking over the microsoft report builder help site, but i guess it's just basic HTML?

 

i am leaving my mistakes in case they are helpful to others.

 

anyway, thanks for pitching in to my disaster!

 

cheers.


@Anonymous wrote:

 

it's the syntax of the assignments i couldn't find.  i can follow your example pretty well.  i was going to ask where i can find that because i spent some time looking over the microsoft report builder help site, but i guess it's just basic HTML?

 


Yes, it's just basic HTML with some css attributes for the styling.

d_gosbell
Super User
Super User

So this is possible by using a little bit of html

 

If you click on the placeholder (so that the field name is highlighted as below) and go into the placeholder properties

d_gosbell_0-1629328452278.png

 

You can then set the placeholder to interpret html (1) 

d_gosbell_1-1629328491912.png

 

and then in the Value section (2) you can use an expression like the following

 

=Replace(Fields!Color_Name.Value,"re", "<span style='color:Red'>re</span>")

 

I don't have any sample data with "red" as part of the text so I just randomly chose to make the characters "re" red using the following expression

 

d_gosbell_2-1629328579351.png

Note you could also build this html version of the text in your data model if it is easier instead of doing the replace in a report builder expression, the important bit is changing the placeholder property to tell it to treat html tags as styles.

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.