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
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.