问题
Most things are dynamic in SSRS i.e you can create a custom expression for most formatting.
I have a report with a matrix tool. This matrix will vary in width depending on how many columns are included.
Above the matrix is a chart.
How do I make the column width dynamic so that is always the same width as the matrix?
回答1:
Sorry, but it's not possible. The width of columns in a matrix can't be set with an expression:
Q: Will the width property of a column be able to be set at run-time
A: This is a common request and I definitely see the value in it. However, we didn't get to this for SSRS 2008.
Source on social.msdn
One alternative that may suit you is varying the width of the chart, because they do have a properties for Dynamic Height and Dynamic Width (see also this blogpost). Note that this only available in SSRS-2008 and up.
The other alternatives will be much "heavier", including generating (or editing) the XML for the RDL dynamically. Workarounds would inlude hiding excess columns (the visibility can be dynamically set)
来源:https://stackoverflow.com/questions/11047111/dynamic-matrix-width-to-always-equal-chart-width