We help IT Professionals succeed at work.

How do I hide part of a field in a SSRS textbox?

Medium Priority
69 Views
Last Modified: 2020-02-25
I have a SSRS report where in one text box I want to only display part of the FIELD that populates the textbox.
For example, if the text in the field is "LASTNAME, FI - ID", I want to display only "LASTNAME, FI". So in the query I have Select LASTNAME + ', ' + LEFT(FIRSTNAME,1) + ' - ' + ID.
I can't just change the SELECT statement to leave off ID because I need that for grouping and sorting.
I changed the placeholder properties to recognize HTML tags
Something like:
Select LASTNAME + ', ' + LEFT(FIRSTNAME,1) +<font size= "3">' + ' - ' + ID + '</font>'
works, but I can't find a way to hide the ID
I tried:
Select LASTNAME + ', ' + LEFT(FIRSTNAME,1) +<div style="visibility:hidden">' + ' - ' + ID + '</div>'
References say that only certain inline CSS attributes are supported, so visibility must be one that isn't.
Any ideas, other than using one field for sorting and another for display.
Comment
Watch Question

Head of IT
CERTIFIED EXPERT
Commented:
Can you change the html to <font colour=#FFFFFF> rather than (or as well as) change the size.
loneieagle2Accountant

Author

Commented:
Thanks, that will work. It still takes up space, but I can live with that.
loneieagle2Accountant

Author

Commented:
Thanks, that will work. It still takes up space, but I can live with that.