Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reporting services SSRS(柱状图):为绑定数据集中不存在的数据显示带有零(0)标签的列栏_Reporting Services_Sql Server 2008 R2 - Fatal编程技术网

Reporting services SSRS(柱状图):为绑定数据集中不存在的数据显示带有零(0)标签的列栏

Reporting services SSRS(柱状图):为绑定数据集中不存在的数据显示带有零(0)标签的列栏,reporting-services,sql-server-2008-r2,Reporting Services,Sql Server 2008 R2,我是SSRS新手 我已在类别组表达式(如category group on)中按类别、开关大小写创建了老化柱状图: =Switch( Fields!Age.Value>=0 and Fields!Age.Value<=7,1, Fields!Age.Value>=8 and Fields!Age.Value<=14,2, Fields!Age.Value>=15 and Fields!Age.Value<=21,3, Fields!Age.Value

我是SSRS新手

我已在类别组表达式(如category group on)中按类别、开关大小写创建了老化柱状图:

=Switch( Fields!Age.Value>=0 and Fields!Age.Value<=7,1,
 Fields!Age.Value>=8 and  Fields!Age.Value<=14,2,
 Fields!Age.Value>=15 and  Fields!Age.Value<=21,3,
 Fields!Age.Value>=22 and  Fields!Age.Value<=31,4,
 Fields!Age.Value>31,6)
=开关(Fields!Age.Value>=0和Fields!Age.Value=8和Fields!Age.Value=15和Fields!Age.Value=22和Fields!Age.Value31,6)
我的问题是,如果与图表绑定的数据集没有颗粒类别的任何行(如“8-14天”),则图表不会显示值为0的in的数据:

我的要求是,如果没有年龄类别的可用数据,则显示零(0)值,如下所示:

图表说明如下:

值=计数(id)
类别:分组讨论

 =Switch(Fields!Age.Value>=0 and Fields!Age.Value<=7,1,
     Fields!Age.Value>=8 and  Fields!Age.Value<=14,2,
     Fields!Age.Value>=15 and  Fields!Age.Value<=21,3,
     Fields!Age.Value>=22 and  Fields!Age.Value<=31,4,
     Fields!Age.Value>31,6)    
=开关(Fields!Age.Value>=0和Fields!Age.Value=8和Fields!Age.Value=15和Fields!Age.Value=22和Fields!Age.Value31,6)

系列:无系列。

谢谢大家的帮助。 通过使用Temp SQl表,我已经达到了我的要求,但您的指导非常有用。 再次感谢


:)

您可以改为更改查询吗?请发布SQL查询。@tgolisch感谢您的回复是的,我可以,我的查询非常简单,它的结构就像“从学生中选择学生ID,年龄”,我在SSRS图表上所做的一切。这个老问题的解决方案似乎与问题无关,所以我想知道是否值得结束,因为“无法复制”。