SSRS tablix column CanGrow property for width?

John Straka picture John Straka · Oct 21, 2011 · Viewed 75k times · Source

I'm working on a tablix in SSRS 2008 and want my columns to autosize (width only) to their contents. CanGrow only affects height. Is there a property I'm missing or any way to otherwise rig the columns to do this?

Answer

surfen picture surfen · Jan 6, 2012

I've been trying to do that myself (client side), without success. There is no property that would autosize the column width.

Check out this workaround: http://blog.sharepointalist.com/2009/05/ssrs-column-width-auto-size.html (I haven't tested it)

The best workaround I've found for client side reporting would be to set column's width in code or use multiple columns and show/hide them based on string length condition.

For example, column named AccNum2:

report.DetailSection1.ReportObjects.Item("AccNum2").width = 200

See this thread for details and other ideas: http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/9e6043f1-c458-4540-be59-d37b02feab8a/