以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  专业报表 打印文字在出现空格,跳到下一行  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=11199)

--  作者:tungwun
--  发布时间:2011/7/12 23:20:00
--  专业报表 打印文字在出现空格,跳到下一行

Dim doc As New PrintDoc \'定义一个报表
Dim rt As  prt.RenderText \'定义一个文本对象
Dim CurRow As Row = Tables("TAXI車輛資料").Current
rx = new prt.RenderText
rx.Text = CurRow("修理內容")
rx.x = 26.5
rx.y = 76
rx.Width= 163
doc.body.Children.Add(rx)
文字在出现空格,跳到下一行怎样用在上面("修理内容") ?
Dim s As String ="修理冷气 换日本翻新冻cail一个 方哇呶 抽真空入环保雪种 入134a泵油"
For Each s1 As String In s.split(" ")
    rt =New prt.RenderText
    rt.Text = s1 \'设置文本对象的内容
    doc.Body.Children.Add(rt) \'将文本对象加入到报表
Next
doc.Preview() \'


--  作者:ybil
--  发布时间:2011/7/12 23:56:00
--  
Dim doc As New PrintDoc \'定义一个报表
Dim rt As  prt.RenderText \'定义一个文本对象
Dim CurRow As Row = Tables("TAXI車輛資料").Current

if  CurRow("修理內容") isnot nothing then
    Dim n As Integer
    For Each s1 As String In CurRow("修理內容").split(" ")
        rt =New prt.RenderText
        rt.Text = s1 \'设置文本对象的内容
        rt.x = 26.5
        rt.y = 76+n*5
        rt.Width= 163
        doc.Body.Children.Add(rt) \'将文本对象加入到报表
        n+=1
    Next
    doc.Preview()
End if
[此贴子已经被作者于2011-7-13 0:02:40编辑过]