Introduction
The following piece of code will create a single Developer Express report (XtraReport), by adding the same reports as pages.
Using the Code
The following namespace is required.
Imports DevExpress.XtraPrinting
Add XtraForm
and add PrintControl,RibbonControl,RibbonStatusBar1
to the form. I have given the form as frmPrint
.
Add XtraReport
and design as you wish to represent. Following is what I have created.
I have added another form which contains a grid view and button.
On the button click event:
Add a XtraReport to the Designer and Create an object from it.
Dim masterreport As New xrBill
For r = 0 To gvGeneratedBills.RowCount - 1
Dim report(r) As xrBill
report(r) = New xrBill
report(r).CreateDocument()
masterreport.Pages.AddRange(report(r).Pages)
masterreport.PrintingSystem.ContinuousPageNumbering = True
frmPrint.PrintControl1.PrintingSystem = masterreport.PrintingSystem
Next
frmPrint.Show()
frmPrint.BringToFront()
Points of Interest
You need to download the Developer Express for WinForm from www.devexpress.com.
History
- May 06, 2012: Article created