SSRS dynamic chart width, but keep margins static width - reporting-services

I have a chart with an expression to set the width based on the number of months in the dataset.
However the wider the chart, the greater the margin size.
This is stopping me aligning it with a matrix that sits underneath...
How can I fix the margin width?
EDIT
Chart's DynamicWidth expression as requested:
=IIF(
Count(Fields!Month_Of_Year.Value) < 12,
1.38 * 12 & " cm",
(Count(Fields!Month_Of_Year.Value) * 1.38) & " cm"
)

Hi hope this will answer you question :
Select the Chart and in the Properties window(the one on right side) click the (...)button for the property ChartAreas
Position -> Expand the property CustomPosition and change Enabled to True and set the property Left to 0
This will make the chart area move to the left Permanently.
otherwise I can provide more workarounds if this

Related

SSRS - Major/minor gridlines spacing

I have an SSRS report with a bar chart with multiple series by CountryName Category group. What I want to do is have gridlines which split each country like below:
However in SSRS the major gridlines seem to interval with the line in the middle of the country name when the grid interval is set to 1 like below:
Can someone point me in the right direction into how to rectify this?
Also is there a way of adding the X axis in SSRS to start from zero like I have in my first graph?
Thanks
You can do it, there is an offset property on the grid lines (horizontal and vertical are separate). Click one one of the gridlines and look in the properties pane. Change the offset to 0.5.
Gives you this.
I'm not sure what you meant about starting from zero on the X-Axis, you have negative values so you'll start from a negative number. If you meant you wantde zero aligned to the middle. You can do that to. You need to set the min and max values of the horizontal axis to the following
Min Value:
=MAX(ABS(Fields!MyValueField.Value), "MyDataSet")*-1
Max Value will be:
=MAX(ABS(Fields!MyValueField.Value), "MyDataSet")
Basically we take the ABSolute largest value and use that as the extent (*-1 for the min value). The problem is that zero might not show so you'll have to play around with the Axis properties maybe to get that working. I'm sure it's possible but I don't have time to test at the moment.
My test data is not great as the number are large

Barchart is empty when there is no value

I am using html5 stacked bar charts in JasperSoft Studio.
When there is no value to be displayed, the chart is totally empty and the 0 (zero) line in the y axis goes to the upper. It doesnt really stay at the level of origin.
How can I get the bars of the chart even if there is no corresponding data to be displayed. like a thin line on the level of zero?
And how can I take the 0 line back on the x axis?
You can set "Range Axis Min Value Expression" to 0 in the stacked bar-chart properties section.
To add open property panel click on the chart and select Windows --> Properties then add
Range Axis Min Value Expression = 0
I faced a similar problem where the bar was not showing up correctly. So what I did was I set the max and the min value in the customizer class
In my case the range of the bar was from 0 to 1.
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setLowerMargin(0.0);
rangeAxis.setUpperMargin(1.0);
rangeAxis.setRange(0, 1.0);
setting maxto a value is a solution but it has a side-effect for me. It fixes the scale of the axis so if the max value is very big compared to the current data we have, the resulting graph doesnt look nice.
I set minRange to 0.1 and it solved my problem. I didnt need to set max after that.

StripLines with same properties displaying different width

I have two different horizontal stripLines in my bar graph. I am displaying a label for these stripLines through the use of a line chart data type with the corresponding values. My problem is I have the same properties (other than actual value) for these stripLines, but they are displaying at 2 different widths. Does the stripInterval have anything to do with this?
The interval and interval offset for the top line (1200/yr) is;
=Fields!BasicNeed.Value + Fields!LifeStyleNeed.Value
=Fields!BasicNeed.Value + Fields!LifeStyleNeed.Value + 1 (not sure what offset should really be but this displays great)
and for the bottom line which is appearing too thin;
=Fields!BasicNeed.Value
=Fields!BasicNeed.Value + 1
The BorderWidth, BorderStyle, BorderColor, StripWidth, IntervalTypes and everything else are all the exact same except for the actual values above.
I just had this same issue.
The problem for me was that I was using the StripWidth property to control the width of the strip (what was I thinking?). That should be set to 0 - it's actually a proportion based on the total axis value.
Use the BorderWidth property to control the width of the Strip Line.
Also, make sure you set the BorderStyle to Solid. Default looks like Solid but is actually None.
Source: Mark from Dundas
I would set the Interval property back to Auto. You only need to set the IntervalOffset property.

Chart bar not property sizing when scalar axis's interval set to 1

When I create a Microsoft SQL Server Reporting Services 2012 bar chart with the horizontal axis type set to scalar and the interval set to 1, the rendered bar size does not match the axis label size.
In the example below, a value of 1 should be displayed for 9/1/12 and a value of 52 should be displayed for 9/5/12. However, the bars span too wide. Each spans three date labels instead of just one.
How do I limit the chart's bars so that they are the proper width?
Thank you!
I had the same problem, I changed the MaxPixelPointWidth to a value, in my case 15, and that fixed my problem.
(Chart Series properties=>CustomAttributes=>MaxPixelPointWidth) //Mari

SSRS - Setting Table Row Height

I'm working in a SSRS report. I have a table in the report. How do I set the row height of the rows in the table?
Select the row you want to change the height of. With that row selected bring up the properties pane (Alt+enter if you don't see it). Scroll down to the position group of properties and specify the width and height there. The "cangrow" and "canshrink" properties are useful too sometimes.
Hope that helps!
Select one cell in a row , go to properties, go to size, give width and height and dis-select "allow textbox height to increase" and "allow textbox height to decrease" in textbox properties. Then it will effect on whole row.
You can edit the RDL(C) and set it exactly using an XML editor.
Look for the following:
...
<TablixRows>
<TablixRow>
<Height>1.5in</Height>
...
Note that you must have set the row height before there will be a Height node.
Since a tablix row doesn't have a dynamic height property (only CanGrow and CanShrink properties), I came up with a workaround.
You can use the length function LEN() in the Value expression for a cell in the row you want more height and add whitespace to the bottom (or top) of the cell with <br/> tags, thus effectively changing the row height dynamically.
To do this, first in the Placeholder Properties of the cell, change the markup type to "HTML - Interpret HTML tags as styles". (Just like changing the static row height property for a cell, this will change the height for the entire row.)
The "dynamic" whitespace you add to the bottom (or top) of the cell depends on how many <br/> tags you append to the value. Here's an example to add whitespace to the row if the cell has a value length of 100 or more characters (increasing the whitespace for every additional 100 characters in length).
=IIF(LEN(Fields!myText.Value) < 100, Fields!myText.Value,
IIF(LEN(Fields!myText.Value) < 200, Fields!myText.Value + "<br/><br/>",
IIF(LEN(Fields!myText.Value) < 300, Fields!myText.Value + "<br/><br/><br/><br/>",
Fields!myText.Value + "<br/><br/><br/><br/><br/><br/>"))))))
Make sure the CanGrow and CanShrink properties are set according to your needs. (For the example above, CanGrow is set to True.
From the Microsoft documentation Change Row Height or Column Width (Report Builder and SSRS):
In Design view, click a cell in the table row.
In the Properties pane that displays, modify the Height property, and then click anywhere outside the Properties pane.
Changing the height of one cell appears to affect the whole row. It worked for me.