我正在研究一個報告,我必須顯示具有6級子級別的類別。SSRS矩陣顯示層次結構
說得更容易理解: 多個類別,每個類別都有多個屬性,每個屬性可以有多個子屬性,這些子屬性可以有子屬性等等。
select語句的結果是這樣的:
ModellID | ModellName| ParentLevelID | LevelID | LevelName | ParentAttributeID | AttributeID | AttributeName
,報告應該是這樣的:
Level 1 Level 2 Level 3 Level 4 ...
Modell A | Attribute A | Child A | Child A | |
| | | Child B | Child A |
| | | | Child B |
| | Child B | Child A | |
| Attribute B | Child A | | |
| Attribute C | Child A | Child A | |
| | | Child B | |
| | | Child C | |
| | Child B | Child A | |
Modell B | Attribute A | Child A | Child A | Child A |
| | | | Child B |
我試着與類別爲行組和等級作爲與屬性列組矩陣作爲價值,但這隻顯示每個類別的第一個記錄。
我也嘗試過多種建議,我發現了與谷歌的幫助,但我無法使他們的工作。
任何幫助或建議,非常感謝!
示例數據:
Create Table hierarchy_ssrs (
ModellID uniqueidentifier,
ModellName varchar(max),
ParentLevelID uniqueidentifier,
LevelID uniqueidentifier,
LevelName varchar(max),
ParentAttributeID uniqueidentifier,
AttributeID uniqueidentifier,
AttributeName varchar(max)
)
https://dl.dropboxusercontent.com/u/108638325/Example_Data.xlsx
您可以通過SQL Management Studio中導入數據。 右鍵單擊數據庫 - >任務 - >導入數據 - >數據源:MS Excel - >瀏覽文件 - > ...進一步的步驟應該是不言自明的。
在此先感謝!
您能否提供一個簡化的示例數據集和您期望的最終結果,以幫助證明您的要求? –
添加了一個帶有示例數據和表定義的excel文檔。最終結果應該看起來像在每個屬性和模型上展開圖標的問題。 – bego
對不起,該文件沒有正確上傳,現在示例數據應該是正確的。 – bego