我有一张我试图在 SSRS-2014 中报告的表格。
表格的精简版:-
TABLE_NAME FEE_NAME FEE_VALUE
PDE 1st year 100.00
PDE 2nd year 120.00
PDE 3rd year 130.00
PDE 4th year 140.00
PDE 5th Year 150.00
PGB 1st year 500.00
PGB 2nd year 520.00
PGB 3rd year 530.00
PGB 4th year 440.00
PGB 5th Year 850.00
PUS 1st year 100.00
PUS 2nd year 120.00
PUS 3rd year 130.00
PUS 4th year 140.00
PUS 5th Year 150.00
PCA 1st year 100.00
PCA 2nd year 120.00
PCA 3rd year 130.00
PCA 4th year 140.00
PCA 5th Year 150.00
PJP 8th year 600.00
PJP 10th year 820.00
PJP 11th year 40.00
PJP 12h year 140.00
PJP 14th Year 750.00
我怎样才能显示数据,以便它是: -
Table Name 1st year 2nd year 3rd year 4th year 5th year 6th year 7th year 8th year 9th year 10th year 11th year 12 year 13th year 14th year
PDE 100.00 120.00 130.00 140.00 150.00
PGB 500.00 520.00 530.00 440.00 850.00
PJP 600.00 820.00 40.00 140.00 750.00
等等。
年份列的范围为 1 到 20,并且每年都不会有一个值。
我试过使用:-
=Lookup(ReportItems!Textbox3.Value, Fields!FEE_NAME.Value, Fields!FEE_DIS1.Value, "Fees")
使用 SSRS 表的标题行中的年份从数据集中查找 FEE_NAME,但是我为数据集中的每个条目得到一行,但每一行显示相同的(正确)值。
我尝试在 SQL 中使用 CASE :-
CASE WHEN FEES.FEE_NAME = '3rd year' THEN FEE_VALUE END AS [3rd year],
同样,我得到了我想要的值,然后为其余的 TABLE_NAME 行清空行。
我还查看了 Pivot (SQL) 和 Matrix (SSRS) 表,但我只想返回相应的费用值并将其显示在相关年份列中,而到目前为止,Pivot 和 SSRS 需要汇总。
希望这是有道理的。
干杯。