SSRS:多级别类别之间的自定义条形宽度

时间:2014-02-17 16:03:39

标签: reporting-services ssrs-2008 bar-chart

我有一个包含多个类别组的条形图,我需要增加第一级别类别组之间的间距,即蓝色箭头指向的位置。

我想改变这个:

SSRS bar chart

进入这个:

SSRS bar chart

提前致谢。

1 个答案:

答案 0 :(得分:2)

据我所知,没有办法调整自我施加的条形组之间的间距。但是,有一个技巧可以达到预期的效果。你所要做的就是欺骗SSRS。在您的查询中,您需要创建没有标签的空条。如果不知道查询的结构,可以这样做:

Select 'Group 1' as Group_Label --This would be equivalent to your Recursos or Credito Pessoal
    , 'Bar 1' as Bar_Label --This would be like T-3
    , 10 as Value_1 --This would be like the Red part of the bar
    , 20 as Value_2
    , '1' as Bar_Sort --This will come in handy later

Union All

Select 'Group 2' as Group_Label --This would be equivalent to your Recursos or Credito Pessoal
    , 'Bar 1' as Bar_Label --This would be like T-3
    , 15 as Value_1 --This would be like the Red part of the bar
    , 30 as Value_2
    , '2' as Bar_Sort --This will come in handy later

Union All

Select '' as Group_Label
    , '' as Bar_Label
    , 0 as Value_1
    , 0 as Value_2
    , 1.5 as Bar_Sort

Order by Bar_Sort

如果你设置它,你会得到的是Group 1 Bar 1后跟一个空栏(没有标签),然后是Group 2 Bar 1.这将用户将看到的组之间的确定空间吧,但你知道这只是一组空的值。我已多次成功使用条形图。

如果这对您没有意义,请创建一个SQLfiddle示例,我可以帮助您调整代码以使其正常工作。