以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]遍历打印时光标如何定位在正在打印的行?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=41358)

--  作者:hzcaqjf
--  发布时间:2013/10/17 16:26:00
--  [求助]遍历打印时光标如何定位在正在打印的行?
Dim doc As New PrintDoc \'定义一个报表
Dim rx As prt.RenderText \'定义一个文本对象
Dim CurRow As Row
If Tables("表A").count > 0 Then
    For i As Integer = 0 To Tables("表A").Count - 1
        CurRow = Tables("表A").Rows(i)
            Doc = New PrintDoc
            doc.PageSetting.Width = 230 \'纸张宽度为230毫米
            doc.PageSetting.Height = 100 \'纸张高度为100毫米
            doc.AutoRotate = False   
            rx = new prt.RenderText
            rx.Text = CurRow("第一列")
            rx.x = 20
            rx.y = 20
            doc.body.Children.Add(rx)
            doc.Print() \'打印报表
    Next
End If
请问,执行上述代码时,如何使"表A"中光标始终定位在正在打印的行上?
如果缺纸或卡纸,光标停在该行不动.
打印完毕后,光标自动移至下一行,打印机才又开始自动打印.

--  作者:Bin
--  发布时间:2013/10/17 16:29:00
--  
For i As Integer = 0 To Tables("表A").Count - 1
        Tables("表A").Position=i
        CurRow = Tables("表A").Rows(i)
            Doc = New PrintDoc
            doc.PageSetting.Width = 230 \'纸张宽度为230毫米
            doc.PageSetting.Height = 100 \'纸张高度为100毫米
            doc.AutoRotate = False   
            rx = new prt.RenderText
            rx.Text = CurRow("第一列")
            rx.x = 20
            rx.y = 20
            doc.body.Children.Add(rx)
            doc.Print() \'打印报表
    Next