How do I align the width of chart with the width of Tablix in SSRS 2008 R2 ? OR how to use DynamicWidth Property?

前端 未结 1 700
闹比i
闹比i 2021-01-22 09:58

I am in a mid of creating a SSRS report, the report consists of a tablix and a chart, both depicts same data i.e. same database query.

The actual number of columns of th

1条回答
  •  野的像风
    2021-01-22 10:32

    The number of columns is dynamic, but you know the width of each column as all the dynamic columns will be the same width. You also know the number of rows in your Dataset, so you can use an expression in DynamicWidth to make the chart width equal to the sum of the column widths.

    For example if your dynamic columns are 2.5cm width and you have a dataset called Dataset1 then the expression for DynamicWidth property of the chart would be:

    =2.5*CountRows("DataSet1") & "cm"
    

    If you have any static columns in the table then you'll also need to add the width of those to the expression.


    Having said all that, you mention aligning the bars of the bar chart with each column. If you want a single bar associated with the value in each column then alternatively you can look at adding a column oriented Data Bar inside a cell in your dynamic column, instead of the separate chart.

    0 讨论(0)
提交回复
热议问题