原創(chuàng)|其它|編輯:郝浩|2012-09-10 11:39:59.000|閱讀 3465 次
概述:根據(jù)代碼將通過添加相同的報(bào)表頁面創(chuàng)建一個(gè)單獨(dú)的Developer Express報(bào)表(XtraReport),附代碼級圖片說明。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
根據(jù)下面代碼將通過添加相同的報(bào)表頁面創(chuàng)建一個(gè)單獨(dú)的DevExpress報(bào)表(XtraReport)。
使用代碼
遵循以下命名空間要求:
Imports DevExpress.XtraPrinting
添加XtraForm,并在該表單中添加PrintControl,RibbonControl,RibbonStatusBar1。
添加XtraReport,并按照你希望表達(dá)的方式設(shè)計(jì)。以下是我所創(chuàng)建的一個(gè)報(bào)表。
我添加了一個(gè)含有網(wǎng)格視圖和按鈕的表單。
設(shè)置該按鈕的單擊事件:
'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()
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:本站原創(chuàng)