原創|其它|編輯:郝浩|2012-09-10 11:39:59.000|閱讀 3465 次
概述:根據代碼將通過添加相同的報表頁面創建一個單獨的Developer Express報表(XtraReport),附代碼級圖片說明。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
根據下面代碼將通過添加相同的報表頁面創建一個單獨的DevExpress報表(XtraReport)。
使用代碼
遵循以下命名空間要求:
Imports DevExpress.XtraPrinting
添加XtraForm,并在該表單中添加PrintControl,RibbonControl,RibbonStatusBar1。
添加XtraReport,并按照你希望表達的方式設計。以下是我所創建的一個報表。
我添加了一個含有網格視圖和按鈕的表單。
設置該按鈕的單擊事件:
'Add a XtraReport to the Designer and Create an object from it.
Dim masterreport As New xrBill
'Here i am loopign through the records on grid view
For r = 0 To gvGeneratedBills.RowCount - 1
Dim report(r) As xrBill 'Create report object
report(r) = New xrBill
'Add report functionality here
'Set the modifier property of reports controls to public
'you can access report controls and assing data from the DB
'Finnaly Create the report
report(r).CreateDocument()
'Add the created report's page to the main report
masterreport.Pages.AddRange(report(r).Pages)
'Set the page no to the continues format
masterreport.PrintingSystem.ContinuousPageNumbering = True
'Bind the main report printing system to the form's printing system
frmPrint.PrintControl1.PrintingSystem = masterreport.PrintingSystem
Next
'Display the report
frmPrint.Show()
frmPrint.BringToFront()
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:本站原創