0
由於我正在處理SSRS報告(.rdl),因此我需要在報告中進行分頁。通常用於asp.net開發者的分頁,我在頁面num和行邏輯的過程中添加了一些語句。SSRS報告中服務器端分頁的邏輯是什麼
但是因爲我的SSRS報告也在使用商店程序,所以我必須在此處做同樣的事嗎?但是,我怎麼能夠處理這些事件呢?通過事件我的意思是說「下一頁」「背頁」等。有SSRS的任何內置功能,可以處理分頁。我在服務器端討論分頁問題,因爲我的報告可能非常龐大,我正在使用過程一次選擇所有記錄。可能是象下面這樣:
Create procedure myproc
@year int,
@docid varchar(200)
Begin
Declare @commandtext nvarchar(max)
set @commandtext = 'select docid, year, type,
sum(case when statusid = 231 then 1 else 0 end) as granted,
sum(case when statusid = 232 then 1 else 0 end) as revoked,
sum(case when statusid = 235 then 1 else 0 end) as deleted,
sum(case when statusid = 236 then 1 else 0 end) as others
from table1 where 1=1'
if (@year <> 0 and @year is not null)
set @commandtext = @commandtext + 'and year=''' + CONVERT(varchar(10),@year) + ''''
if(@docid is not null and @docid <>'')
set @commandText = @commandtext + 'and documents in (' + @docid + ')'
set @commandText = @commandtext + 'group by docid, year, type '
EXEC (@commandText);
End