查看帮助文档给了一个例子,Form_Load方法中代码如下:
Dim rpt As New rptData()
rpt.Run()
Dim rpt2 As New rptLetterhead()
rpt2.Run()
Dim i As Integer
For i = 0 To rpt.Document.Pages.Count - 1
rpt.Document.Pages(i).Overlay(rpt2.Document.Pages(0))
Next
这样就可以应用Overlay方法。但是这是.vb的帐票。
应用到.rpx的帐票时就不好用。代码如下,所以想知道 是不是.rpx帐票不能使用Overlay方法。
Dim rpt As New GrapeCity.ActiveReports.SectionReport()
Dim xtr As New System.Xml.XmlTextReader("..\..\SectionReport1.rpx")
rpt.LoadLayout(xtr)
rpt.Run()
Dim rpt2 As New GrapeCity.ActiveReports.SectionReport()
Dim xtr2 As New System.Xml.XmlTextReader("..\..\SectionReport2.rpx")
rpt2.LoadLayout(xtr2)
rpt2.Run()
For i = 0 To rpt.Document.Pages.Count - 1
rpt.Document.Pages(i).Overlay(rpt2.Document.Pages(0))
Next
Viewer1.Document = rpt.Document |
|