如何輕鬆快速開發報表:談 SQL Server 2008 報表開發
-
Upload
chui-wen-chiu -
Category
Technology
-
view
2.539 -
download
14
description
Transcript of 如何輕鬆快速開發報表:談 SQL Server 2008 報表開發
如何輕鬆快速開發報表:談 SQL Server 2008 報表開發
胡百敬 (http://byronhu.spaces.live.com)
精誠公司 恆逸資訊
Reporting Services
管理
Reporting Services 是完整的,以伺服器為基礎,橫跨全企業的報表平台,支援編輯、管理和發送互動好用的報表
發送
XML
Embedded Reporting
編輯
Web Report2007 Sales
Reporting Services 2008
大綱報表設計
全新資料來源以設計異質性資料報表Report Builder 2.0新增的 Tablix 資料區域新增的圖表與量測軌資料區域文字方塊支援豐富文本格式設定
報表處理與轉譯轉譯為 Word 檔案格式Excel 可以轉譯子報表大幅提升報表處理以及轉譯執行效率
報表伺服器架構與管理工具從此脫離了 IIS新的管理介面 Reporting Services 組態管理員
報表設計方式改變Report Designer
報表設計工具報表設計師報表產生器 1.0報表產生器 2.0 Report
Designer
Report Builder 1.0
完整支援 RDL分享配置介面
報表模型
Office 2007 外觀整合
VS.NET 2008
整合查詢與配置完整支援報表模型自動產生鑽研報表
有限支援 RDL
ReportBuilder
2.0
報表產生器 2.0報表產生器 2.0= 報表設計師 + 報表精靈 + 報表產生器 1.0專業開發人員以及一般使用者都可以使用接近 Office 2007 的介面可以處理複雜格式的報表同時支援資料集與報表模型可以隨時切換報表設計師或者是報表產生器的報表報表產生器 2.0 將是未來隨選報表的技術主流
7
群組資料群組 (Group) 類型
詳細資料 –預設 Table 或 List 沒有群組的內容資料列群組和資料欄群組 – 傳統的群組Recursive hierarchy groups – 階層資料
群組工作窗格 (Group Task Pane)階層式地呈現列和行的群組透過快捷選單加入相鄰的資料列或資料行群組透過群組屬性對話窗來定義群組運算式、分頁、排序、可見性、篩選、變數、進階
2001 2002 Total
1,115 1,331 2,446
152 642 794
11,156 13,312 24,468
1,523 6,421 7,944
13,946 21,706 35,653
Retail Acme
Nadir, Inc.
Wholesale ABC Corp.
XYZ, Ltd.
Grand Total
Customer
Retail
Acme
Nadir, Inc.
Wholesale
ABC Corp.
XYZ, Ltd.
Grand Total
Growth
19%
322%
19%
322%
56%
Tabl ixe + Matr
Tablix = Table + MatrixMatrix plus
多重平行資料列 / 資料行群組每個成員可以自由決定動態或者是靜態可以整合資料列標頭
Table plus動態巢狀資料行群組多重平行資料列群組靜態資料列可彈性延伸資料行標頭
動態平行群組Table Chair
WA Seattle 20 30
Spokane 10 20
OR Portland 10 10
Eugene 25 5
2005 2006
WA Seattle 50 60
Spokane 30 40
OR Portland 40 50
Eugene 20 30
以前
現在
Year Product
2005 2006 Table Chair
WA Seattle 50 60 20 30
Spokane 30 40 10 20
OR Portland 40 50 10 10
Eugene 20 30 25 5
混和動態 / 靜態資料行State City Pop Area
WA Seattle 20 30
WA Spokane 10 20
OR Portland 10 10
OR Eugene 25 5
State City 2005 2006 Pop Area
WA Seattle 50 60 20 30
Spokane 30 40 10 20
OR Portland 40 50 10 10
Eugene 20 30 25 5
2005 2006
WA Seattle 50 60
Spokane 30 40
OR Portland 40 50
Eugene 20 30
以前
現在
階層資料列以及動態標頭
2005 2006
West Total 140 180
Washington Total 80 100
Seattle 50 60
Spokane 30 40
Oregon Total 60 80
Portland 40 50
Eugene 20 30
East Total 200 220
2005 2006
West 140 180
Washington 80 100
Seattle 50 60
Spokane 30 40
Oregon 60 80
Portland 40 50
Eugene 20 30
East 200 220
以前 現在
...
...
加入總計“ 加入總計” 命令
在群組內搭配彙總函數加上資料列或行允許在所選擇的群組之前或後增加
總計資料列或資料行支援各種彙總函數,例如 Average() 或 Min()在資料列或資料行呈現文字方塊 – 不再有綠色三角型!
使用變數報表變數 (Report variable)
在報表執行當下賦予值,處理過程中不再變動在報表前後換頁時,每一頁中會有相同的值,若是以運算式設定如 Now() 函數,則資料會不同
群組變數在群組 scope 內賦予變數值,子群組可以使用賦予當下群組計算一個唯一值語法: =Variables!VariableName.Value
資料視覺化全新升級新增圖表類型
堆疊圖、範圍圖、箱型圖、金字塔圖、甜甜圈圖…強化圖表功能
混合圖表雙軸圖表導出數列刻度斷層多重圖例自動數列標籤
量測軌各種儀表板型態
豐富的圖型呈現
SSRS 2008 的圖表類型Column
Column (3-D), Stacked (3-D), 100% Stacked (3-D), Clustered (3-D), Cylinder (3-D) , Stacked Cylinder (3-D), 100% Stacked Cylinder (3-D), Clustered Cylinder (3-D)
LineLine (3-D), Smooth Line, Stepped Line, Line with Markers, Smooth Line with Markers
ShapePie (3-D), Exploded Pie (3-D), Doughnut, Exploded Doughnut, Funnel (3-D), Pyramid (3-D)
AreaArea (3-D), Smooth Area (3-D), Stacked, 100% Stacked (3-D)
RangeSmooth, Range Column, Range Bar, Stock, Candlestick, Error Bar, Boxplot
BarBar, Stacked (3-D), 100% Stacked (3-D), Clustered (3-D) Stacked Horizontal Cylinder (3-D), Stacked 100% Horizontal Cylinder (3-D), Clustered Horizontal Cylinder (3-D)
ScatterBubblePolar
Polar, Radar (3-D)ParetoHistograms
黃字部分為 SSRS 2008 新增的
新圖表功能多重圖表標題 ( 標題支援運算式 )多重圖例資料點的工具提示多重圖表區域雙軸圖表客製化圖表調色盤導出數列
平均值、移動平均、保歷加通道 (Bollinger Bands) 、標準差… 刻度斷層
圖表範例
刻度斷層
區域效果
圖型配色
圖表範例
多重圖表區域
導出數列
隔行換色
多重圖例
圓餅圖小面積「其他」
Custom Attribute. CollectedStyle=SingleSliceCollectedThresholdUsePercentCollectedThreshold小面積新圓餅圖
Custom Attribute. CollectedStyle=CollectedPie
量測軌SSRS 2008 新增量測軌 (Gauge) 資料區域(data region)兩種主要類型雷達型 (Radial) 和線型 (Linear)
用途一般繫結到單一或少許的資料點 ( 值、目標…等 )可用來呈現 KPIs單獨呈現或內嵌到 tablix (bullet graph)
量測軌範例
雷達型 線性
量測軌結構
Richly Formatted Text
textbox 可以混合不同的格式設計透過 expression placeholder 可做到 Mail-merge 功能段落
Numbered/bulleted lists段落對齊
HTML 標籤為基礎的格式化Word DOC 輸出
SSRS 2008 效能新架構隨選報表處理 (On-demand processing):沒看到的部分就先不處理全新分頁機制:直接呈現第一頁給使用者瀏覽最小記憶體耗用
分頁回應速度
0 2000
500
Response Time (Large Table with Constant Row Visibility)
RS2005 SP1
RS2008 CTP6
Page Number
Resp
onse
Tim
e [m
s]
0 200 4000
500
1000
Response Time (Table With Grouping)
RS2005 SP1RS 2008 CTP6
Page Number
Resp
nse
Tim
e [m
s]
從此脫離 IIS !!!
改以內建於 SQL Server CLR 的 ASP.NET 以及 .NET Framework ,與作業系統的 HTTP.SYS取代避免與其他網頁程式之間的干擾不受 ASP.NET記憶體政策之管控簡化效能調校與維護複雜度
新的設定管理介面Reporting Services 組態管理員
記憶體管理原則RSReportServer.config 檔提供設定:
WorkingSetMaximum 和 WorkingSetMinimum 會定義可用記憶體的範圍 ( 上下界 ) ,以定義報表伺服器應用程式設定可用記憶體的範圍高度記憶體壓力的上界是 WorkingSetMaximum而下界是MemoryThreshold中度記憶體壓力的上界是 MemoryThreshold而下界是MemorySafetyMargin低度記憶體壓力的上界是 MemorySafetyMargin而下界是WorkingSetMinimum
參考資源SQL Server 2008 Cumulative Updatehttp://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=956717&kbln=zh-tw
Q & A
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED
OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
各版本部署Usage Scenario Support Statement
RS 2005 RDL, RS 2000 RDL
• Can publish directly to 2008 Server using Report Manager or SOAP API• 2005 RDL will be preserved (not upgraded)
Report Designer (2000) Not supported - cannot deploy reports to a 2008 server
Report Builder 1.0 (in 2005 and 2008)
•Authors 2005 RDLs•Can deploy reports to a 2008 Server
Report Designer (2005) •Authors 2005 RDLs•Can deploy reports to 2008 Server
Report Designer (2008) •Will upgrade 2000 and 2005 RDLs to 2008•Authors 2008 RDLs•Deploy to 2008 server only
Report Builder 2.0 (Stand alone)
•Will upgrade 2000 and 2005 RDLs to 2008•Authors 2008 RDLs•Deploy to 2008 server only
VS 2005 Viewer and VS 2008 Viewer
•Can view 2008 server report•2008 RDLs are not supported in local mode
VS 2005 and VS 2008 RDLC Designer
•Authors SQL 2005 RDLs•Does not support 2008 RDLs