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
Sql server 2008 选择一个表的值,这些值是另一个表的字段_Sql Server 2008_Reporting Services_Ssrs 2008 - Fatal编程技术网

Sql server 2008 选择一个表的值,这些值是另一个表的字段

Sql server 2008 选择一个表的值,这些值是另一个表的字段,sql-server-2008,reporting-services,ssrs-2008,Sql Server 2008,Reporting Services,Ssrs 2008,我正在从事SSRS报告服务2008。 我有两张桌子: 表1: 我有一个表2,其中我使用表1的值作为列名: Year Month Sabc Sdef Sghi SubPen SubPencil SubPillow ---- ----- ---- ---- ---- ----- -------- --------- 2012 April 45 45 56 35 97 78 2012 June 66 78

我正在从事SSRS报告服务2008。 我有两张桌子: 表1:

我有一个表2,其中我使用表1的值作为列名:

Year  Month  Sabc  Sdef  Sghi  SubPen  SubPencil  SubPillow
----  -----  ----  ----  ----  -----    --------  ---------
2012  April  45     45   56      35     97          78
2012  June   66     78   95      54     89          08
2013  may    34     23   78      73    98           97
我想在报告中创建一个矩阵,根据表1中的键名称进行分组,并使用表2中的值显示表1中的子键名称

           |  
           |  SubKpiNames    Values   Sparkline
------------------------------------------------
alpha      |  Sabc            76
           |  Sdef            80 
           |  Sghi            45    
Station    |  SubPen          72
           |  SubPencil       45
Home       |  SubPillow       65
           |  SubSheet        75
           |  SubMat          34

我该怎么做?我们如何将一个表的值映射到另一个表的字段。

您可以通过嵌套表来实现这一点,但这会非常混乱,我怀疑您是否能够获得所需的布局。 我建议您在服务器端这样做,并从每个表的基础值创建一个数据集

           |  
           |  SubKpiNames    Values   Sparkline
------------------------------------------------
alpha      |  Sabc            76
           |  Sdef            80 
           |  Sghi            45    
Station    |  SubPen          72
           |  SubPencil       45
Home       |  SubPillow       65
           |  SubSheet        75
           |  SubMat          34