关于richtextbox控件的打印问题

stovl 2003-12-12 11:45:29
报表打印时只显示第一行,应该是换行问题,相关代码如下:


Private Sub SFills()
Dim sqlstr As String
Dim IAffected As Integer

On Error GoTo ErrFlag

SearchCode = ""
IAffected = 1
Conn.BeginTrans

sqlstr = ""
sqlstr = "insert into base values ("
For I = 0 To 95
If I = 11 Then

sqlstr = sqlstr & " '" & IIf(Trim(Text1(I).Text) = "", "0.00", Trim(Text1(I).Text)) & "',"
Else

sqlstr = sqlstr & " '" & IIf(Trim(Text1(I).Text) = "", "", Trim(Text1(I).Text)) & "',"
End If

Next

sqlstr = sqlstr & " '" & IIf(Trim(RichTextBox1.Text) = "", Null, Trim(RichTextBox1.Text)) & "',"


sqlstr = sqlstr & " '" & IIf(Trim(Text1(96).Text) = "", "", Trim(Text1(96).Text)) & "',"
sqlstr = sqlstr & " '" & StoreTime & "',"
sqlstr = sqlstr & " '" & Trim(Text2.Text) & "',"
sqlstr = sqlstr & " '" & Trim(Text3.Text) & "',"
sqlstr = sqlstr & " '" & Trim(Text4.Text) & "'"
sqlstr = sqlstr & " " & ")" & ""

Conn.Execute sqlstr, IAffected
If IAffected <> 1 Then GoTo ErrFlag
Conn.CommitTrans
SearchCode = Trim(Text2.Text)

If MsgBox("请检查数据是否正确!", vbQuestion + vbYesNo, "提示!") = vbNo Then

Text1(0).SetFocus
Exit Sub

End If

MsgBox "开始打印,请准备好纸张!", vbInformation, "提示!"
Cryrpt1.Destination = 0
Cryrpt1.ReportFileName = App.Path & "..\Reports\base.rpt"
Cryrpt1.SelectionFormula = "{base.NumberId}='" & Text2.Text & "' "
Cryrpt1.WindowState = crptMaximized
Cryrpt1.Action = 1

Text1(0).SetFocus
Call ClearText
Call GetBillCode
Text3.Text = Syear
Text4.Text = Smouth

Exit Sub
ErrFlag:
Conn.RollbackTrans
MsgBox "数据录入失败,请检查你的输入! ", vbInformation, "提示!"
End Sub
...全文
35 1 打赏 收藏 举报
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
flc 2003-12-24
关注
  • 打赏
  • 举报
回复
相关推荐
发帖
控件
加入

1431

社区成员

VB 控件
申请成为版主
帖子事件
创建了帖子
2003-12-12 11:45
社区公告
暂无公告