簡體   English   中英

SSRS 2008 R2的折線圖

[英]Line graph at SSRS 2008 R2

我創建了SQL腳本PIVOT,它生成數據,我想為它創建線圖。

Year Jan Feb Mar Apr May -Dec
2012 00 00 00 00 50 20 
2013 116 113 182 144 50 435
2014 184 135 00 00 00 00

我正在添加帶有SSRS圖表標記的折線圖,我無法創建年份作為折線圖,Y軸將顯示數字,X軸將顯示月份。 有人可以在這方面指導我嗎?

謝謝

您應該按照以下方式將您的IssuedQty值按年和月分組:

-- load test data
    declare @issue_inv_detail table(iid_item_code int identity(1,1),iid_issue_qty int,iid_created_date datetime)
    while (select count(*) from @issue_inv_detail) < 1000
        begin
            insert into @issue_inv_detail(iid_issue_qty,iid_created_date)
                values
                    (round(rand()*10,0),dateadd(day,round(rand()*765,0),'20120101'))
        end

-- return @issue_inv_detail grouped by Year,Month
    select
        year(iid_created_date) ISYear,
        month(iid_created_date) ISMonth,
        sum(iid_issue_qty) ISQty
    from @issue_inv_detail
    group by
        year(iid_created_date),
        month(iid_created_date)
    order by
        year(iid_created_date),
        month(iid_created_date)

然后設置您的SSRS圖表值:

  • 價值:ISQty
  • 類別組:ISMonth
  • 系列組:ISYear

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM