frmviewrk.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:3k
- Imports System.Configuration
- Public Class frmviewrk
- Inherits System.Windows.Forms.Form
- #Region " Windows 窗体设计器生成的代码 "
- Public Sub New()
- MyBase.New()
- '该调用是 Windows 窗体设计器所必需的。
- InitializeComponent()
- '在 InitializeComponent() 调用之后添加任何初始化
- End Sub
- '窗体重写 dispose 以清理组件列表。
- Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
- If disposing Then
- If Not (components Is Nothing) Then
- components.Dispose()
- End If
- End If
- MyBase.Dispose(disposing)
- End Sub
- 'Windows 窗体设计器所必需的
- Private components As System.ComponentModel.IContainer
- '注意: 以下过程是 Windows 窗体设计器所必需的
- '可以使用 Windows 窗体设计器修改此过程。
- '不要使用代码编辑器修改它。
- Friend WithEvents rkViewer As DataDynamics.ActiveReports.Viewer.Viewer
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.rkViewer = New DataDynamics.ActiveReports.Viewer.Viewer
- Me.SuspendLayout()
- '
- 'rkViewer
- '
- Me.rkViewer.BackColor = System.Drawing.SystemColors.Control
- Me.rkViewer.Dock = System.Windows.Forms.DockStyle.Fill
- Me.rkViewer.Location = New System.Drawing.Point(0, 0)
- Me.rkViewer.Name = "rkViewer"
- Me.rkViewer.ReportViewer.CurrentPage = 0
- Me.rkViewer.ReportViewer.MultiplePageCols = 3
- Me.rkViewer.ReportViewer.MultiplePageRows = 2
- Me.rkViewer.Size = New System.Drawing.Size(638, 406)
- Me.rkViewer.TabIndex = 0
- Me.rkViewer.TableOfContents.Text = "Contents"
- Me.rkViewer.TableOfContents.Width = 200
- Me.rkViewer.Toolbar.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
- '
- 'frmviewrk
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(8, 18)
- Me.ClientSize = New System.Drawing.Size(638, 406)
- Me.Controls.Add(Me.rkViewer)
- Me.Name = "frmviewrk"
- Me.Text = "frmviewrk"
- Me.ResumeLayout(False)
- End Sub
- #End Region
- Public rkbillnumber As String
- Private Sub frmviewrk_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- rkprint()
- End Sub
-
- Private Sub rkprint()
- Dim frmrkviewer As New frmrk
- Dim sqlstring As String
- Try
- If rkbillnumber Is String.Empty Then
- MessageBox.Show("没有要打印的数据!", "提示信息:", MessageBoxButtons.OK)
- Else
- sqlstring = "select * from wz_rk where 票号='" & rkbillnumber & "' order by 序号"
- Dim rpt As New rpxrk
- Dim myDS As New DataDynamics.ActiveReports.DataSources.SqlDBDataSource
- myDS.ConnectionString = ConfigurationSettings.AppSettings.Get("constr")
- myDS.SQL = sqlstring
- rpt.DataSource = myDS
- Me.rkViewer.Document = rpt.Document
- rpt.Run(False)
- End If
- Catch ex As Exception
- MessageBox.Show(Me, "报表错误: " + ex.Message + "; " + ex.InnerException.Message, "Report Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
- End Try
- End Sub
- End Class