Recently I got a weird problem building some reports with SSRS 2008. The column width started to automatically resize based on content, while all columns width are fixed in SSRS by design. The cause of this was long words and long URLs in these fields, which were not able to wrap. Looks like HTML table was adjusting the column size accordingly. (By the way, it was still showing Ok in preview, but was changing the size of columns in published version.) Spent quite a time trying to figure out what to do with that, cause I need those column widths to be static. Here is the solution:
While this problem is caused by native HTML functionality, we can use HTML to fix it.
- Change Expression to be something like =”<DIV style=’width:1.2in’>” & Fields!YourField.Value & “</DIV>” where width is the desired static width of this column.
- 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).
PS. I am also sure that you can use the same approach to create columns with adjustable or auto width, it just needs some tweaking. Update: Here it is.
Hello I'm logesh.. I tried this.. but then the style attribute is throwing some error.. Help me on this
ReplyDeletethank you very much.
ReplyDeleteyour post really save my day!!
in order to solve my problem, i need to change from 'div' tag to 'table' tag. 'div' doesn't work for me.
however, this content give me an idea to figure it out. thanks a million !!!!
This is awesome. You're a lifesaver, I wasted almost a day on tweaking a couple of troublesome columns in my report
ReplyDeleteAmazing. Thanks a lot
ReplyDeleteCan you explain step by step of dynamically changing width in SSRS
ReplyDeleteCan you give me solution for dynamically changing column width in SSRS
ReplyDeleteCheck my other blog post at http://blog.sharepointalist.com/2009/05/ssrs-column-width-auto-size.html
DeleteIt never applies the width :(
ReplyDeleteThank you very much for this post; I spent hours and hours trying to determine the problem and solution for this behavior. This soultion worked perfectly!!
ReplyDeleteThank you ! This saved me a a lot of grief!
ReplyDeleteThe only thing I would say is maybe add an intermediate step where you specify that the user needs to select the text to get to the placeholder properties. Again, thank you!
It's still saving time.
ReplyDeleteThank you so much.