Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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?

  • 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

     

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

     

    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

     

    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.

     

3 Replies

  • 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

     

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

     

    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

     

    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.

     

  • Anonymous's avatar
    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.

    • d_gosbell's avatar
      d_gosbell
      Super User

      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.