Dim xtrPRT0304024 As New System.Xml.XmlTextReader("C:\Users\dongxin\Desktop\帐票\duoxiancheng\SRC_ST\SIJI002\Rpt\SectionReport4.rpx")
Dim report4 As New SectionReport()
Dim dataTable As New DataTable
dataTable.Columns.Add("S001")
dataTable.Columns.Add("S002")
For i = 1 To 50
Dim dataRow As DataRow = dataTable.NewRow
dataRow("S001") = i
dataRow("S002") = "NAME____" + i.ToString
dataTable.Rows.Add(dataRow)
Next
With report4
.LoadLayout(xtrPRT0304024)
.DataSource = dataTable
.Document.Printer.PrinterName = "Microsoft XPS Document Writer"
.PageSettings.Orientation = Section.PageOrientation.Portrait
.PageSettings.Margins.Top = 0.35
.PageSettings.Margins.Left = 0.35
.PageSettings.Margins.Right = 0.35
.PageSettings.PaperKind = Printing.PaperKind.A5
End With
report4.Run(False)
Dim test As New TestForm2
test.Rpt(report4)