While fixing the problem described in my previous post I saw lots of people trying to set auto width for the columns. Without any luck though... I have found a way:
- Change Expression to be something like =”<DIV>” & Replace(Fields!YourField.Value," "," ") & “</DIV>”
- Change placeholder properties – General tab – Markup type – HTML-Interpret HTML tags as styles. (Placeholder properties can be accessed by right clicking on Expression (Field) inside of the cell, not on cell itself).
That was too easy :)
PS. Works for SSRS 2008, never tested on 2005.
PPS. Keep in mind - this works ONLY in web browser. Export to PDF and even printing will still use predesigned column width. There might be a workaround too - but I don't really need it, so I will leave it to you guys.
Please comment if you find any additional notes.
Where did you insert this expression? I tried horizontal alignment under "Texbox Properties" and under size in the Properties pane. Neither worked.
ReplyDeletefzlala@gmail.com
I changed the value field in placeholder properties and replaced it with the provided expression. I also did step 2. It didn't work :(
ReplyDeleteRight click on the Field, then select "Expression" from the popup menu.
ReplyDeleteAmazing! never thought of that. Thank you for this tip. Helped save a lot of time!
ReplyDeleteI did all this and tried different ways but it doesn't work. I use RS 2008. nay ideas why?
ReplyDeletetautvis@gmail.com
It was working with SSRS2008. Double check all the steps and play with columns properties. For the test - create project from scratch just to test this functionality.
ReplyDeleteCant find step 2 in SSRS 2005
ReplyDeleteIt was never tested in SSRS 2005 so please comment if you were able to make it work.
ReplyDeleteI followed the steps in SSRS 2008 R2 and it did not work while viewing the report in IE 8.
ReplyDeleteWorks well for me - thanks dude, Now to work out a way (other than basing column widths on parameters) to make it work for pdf's :/
ReplyDeleteThis will not work in ssrs 2005 as it does not support html formatting. ssrs 2008 does.
ReplyDeleteAw, this was a really quality post. In theory I'd like to write like this too – taking time and real effort to make a good article… but what can I say… I procrastinate alot and never seem to get something done.
ReplyDeleteIn my case the bold formatting was preserved in both screen view and export formats (tried pdf and excel only). :)
ReplyDeleteit works just fine...thanks alot.
ReplyDeleteHello!
ReplyDeleteI tried so many time, but I don't know why it is not working.
I'm using SSRS 2008.
Hi. I want to set up my column width auto size. For exemple: In first page of my report I had in column1 same dates, and the second page my dates on column1 are larger then in first page. The column width size doesn´t grow up according the text size. Are you understanding me? I´m sorry about my english, it´s not perfect to explain things. Can somebody help meh? Thanks a lot
ReplyDeleteThansk for your help, i was looking for this answer for a long time and found here.
ReplyDeleteWorks great, but I lose my cell number formatting. Any thoughts how I can preserve that?
ReplyDeleteGot it to work with just text. How would I do this when my rows contain images
ReplyDeleteIt did not work for me.. can you explain step by step to auto size width of column in SSRS
ReplyDelete