views:

32

answers:

1

HI, I have placed a graphic inside my report in SQL Server Reporting Services 2008. My only problem is that the natural behavior of the graphic is to have fixed width and heights, no matter how many items you have inside your graphic. Sometimes I have as few as 5 to 8 items in my Y axis, but sometimes I have some 20 or 25. What happens is that because of the fixed height, the graphics with few items have too much vertical space and large bars and the ones with many items are automatically compressed into a space that is small for them. So what I need is to dinamically set the height of the graphic based on how many items are in the Y axis of the graphic. The X axis does not expand, so I don`t need to set it dynamically. How would you set the height of the graphic dynamically? I probably have to set a function for the graphic height... Any help will be appreciated. Thanks.

+1  A: 

Assuming you mean chart, then the function for chart height would look something like this:

=countdistinct(fields!yValue.value, "Dataset")*HeightOfOneYvalue+HeightofXAxis

I have done this from memory so it may not be exactly correct.

jimconstable
Hey, thank you, I will try this and some variations in case it does not work exactly like this. Thank you!
Marcos Buarque
Hi, I am sorry to insist, but... Do you have an example to show me? Yes, I mean a chart (better than saying a "graphic"). First doubt is... where do I set the height of the chart. Aparently, there is no such setting. I was trying to do that in the Axis properties >> set axis scale and properties >> Maximum. But I don`t think that is the place to change the chart height... I appreciate any help. Thank you very much.
Marcos Buarque
jimconstable
Hey, thank you, "DynamicHeight" is the keyword to the answer. I hadn`t realized I could add expressions for each chart parameter and set them dynamically. In case anybody needs, here is a link to a complete explanation: http://blogs.msdn.com/robertbruckner/archive/2008/10/27/charts-with-dynamic-size-based-on-categories-or-data.aspx
Marcos Buarque