ASP.NET - ReportViewer Control 使用心得 (一)

摘要:ASP.NET - ReportViewer Control 使用心得 (一)

之前開發報表就是很單純的開發報表,怎麼說呢!? 其實就是開啟 Visual Studio 工具,建立一個新的報表專案,之後就發佈到 Reporting Server 上面去了;前端只要多個超連結,導到那份報表即可。坦白說,這種方式也沒有不好就是了,其實滿單純的。之後有一次看到有朋友用 ReportViewer Control 來呈現報表後,想想沒做過可以來玩玩看,以下就來簡單的設計一份報表唄...

開發工具:Visual Studio 2008
資料來源:Northwind 的 Orders

步驟一:建立一個新的「WebForm1.aspx」


步驟二:到 設計 模式並且將 MicrosoftReportViewer Control 拉進頁面中



步驟三:建立新報表檔


步驟四:建立一個 資料集 來做為報表的資料來源


步驟五:使用 伺服器 連結到 Northwind 並且將 Orders 拉進 資料集 中


步驟六:建立報表資料來源



步驟七:開啟 資料 / 顯示資料來源



步驟八:拖拉所要顯示的欄位到 Table 中


步驟九:開啟 WebForm1.aspx 並設定 ReportViewer 的報表來源


結果:


參考資料:
使用ASP.NET 2.0中的ReportViewer控件
Using the ASP.NET 2.0 ReportViewer in Local Mode
ReportViewer and Linq to SQL: A better way to report your applications
Microsoft Report Viewer 2008 SP1 Redistributable - 繁體中文