none
Partial Format String RRS feed

  • Question

  • I need to format a part of the text in my textbox bold. (Not the entire string).
    For example, my expression may look like this:

    = "Name :" & Bold(Fields!Name.Value)

    The result may be:

    Name: Riccardo

    I there a way to do this with format function ?

    I also read that i can write a custom method on my report .rdlc in the code. But i don't know how to write this method.
    Thank you in advance,
    Riccardo
    Wednesday, February 20, 2008 11:33 AM

All replies

  • I'm not sure if there is a way with the format function, since as far as I knew, the format function was basically used for formatting numbers and datetime values.  I could be wrong though.

     

     

    As far as writing methods, they are done in VB code.  So I recommend you write them in a VB editor and verify they work there before putting them into your report, since the report only has limited debug abilties.

     

    To use methods:

    1. In the blank area under your report, right click, choose properties, then click on the Code tab.  Paste your VB method here.

     

    2. To use the method, edit the expression for the applicable control to say:

    =Code.MyMethodName(Fields!MyParam.Value, Fields!MyOtherParam.Value)

     

     

    MyMethodName would be the name you gave to the method

    and of course the MyParam and MyOtherParam  fields are whatever parameters your VB method may of needed.

     

    Wednesday, February 20, 2008 3:08 PM