none
How To Stop Text Wrapping in Textbox RRS feed

  • Question

  • So, I have a text box in my report with an expression that pulls in a company name... The text box is a little taller than 1 line of text due to formatting and alignment purposes, but it is also set to CanGrow=False... If the company name is too long for the text box width, I just want it to truncate the name, not wrap the text down onto a second line... The reason for this is because then the second line is partially visible and the alignment of the first line gets messed up...

    See pictures below... (It also does it for long email addresses)

    ^^^As you can see, it pushes the 1st line up a little bit and then the second line is partially visible...


    kclapp

    Wednesday, September 18, 2019 7:50 PM

Answers

  • Hi Kclapp,

    For you case, I think the best way is to truncate the text(company name) to a certain length, and add "..." symbol at the end to indicate that this is a long named company.

    For example:

    =IIF(LEN(youExpression)>30,LEFT(yourExpression,27)+"...",yourExpression)

    The 30, 27 is just for reference, you could change to suitable number to make your report looks perfectly.

    Regards,

    Lukas


    MSDN Community Support Please remember to click Mark as Answer; the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by kclapp Thursday, September 19, 2019 3:37 PM
    Thursday, September 19, 2019 2:34 AM

All replies

  • Hi Kclapp,

    For you case, I think the best way is to truncate the text(company name) to a certain length, and add "..." symbol at the end to indicate that this is a long named company.

    For example:

    =IIF(LEN(youExpression)>30,LEFT(yourExpression,27)+"...",yourExpression)

    The 30, 27 is just for reference, you could change to suitable number to make your report looks perfectly.

    Regards,

    Lukas


    MSDN Community Support Please remember to click Mark as Answer; the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by kclapp Thursday, September 19, 2019 3:37 PM
    Thursday, September 19, 2019 2:34 AM
  • Thanks, Lukas!!

    Because each character is a different length, it gets a little tricky picking the "30,27" numbers, but if I pick low enough numbers, there shouldn't be a problem! Either way, it's much better than before!! Thank you again!!


    kclapp

    Thursday, September 19, 2019 3:36 PM
  • Glad it helps. You are welcome :)

    MSDN Community Support Please remember to click Mark as Answer; the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, September 20, 2019 1:17 AM