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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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