frmviewrkmanage.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:3k
- Imports System.Configuration
- Public Class frmviewrkmanage
- 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 rkmanageViewer As DataDynamics.ActiveReports.Viewer.Viewer
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.rkmanageViewer = New DataDynamics.ActiveReports.Viewer.Viewer
- Me.SuspendLayout()
- '
- 'rkmanageViewer
- '
- Me.rkmanageViewer.BackColor = System.Drawing.SystemColors.Control
- Me.rkmanageViewer.Dock = System.Windows.Forms.DockStyle.Fill
- Me.rkmanageViewer.Location = New System.Drawing.Point(0, 0)
- Me.rkmanageViewer.Name = "rkmanageViewer"
- Me.rkmanageViewer.ReportViewer.CurrentPage = 0
- Me.rkmanageViewer.ReportViewer.MultiplePageCols = 3
- Me.rkmanageViewer.ReportViewer.MultiplePageRows = 2
- Me.rkmanageViewer.Size = New System.Drawing.Size(292, 273)
- Me.rkmanageViewer.TabIndex = 0
- Me.rkmanageViewer.TableOfContents.Text = "Contents"
- Me.rkmanageViewer.TableOfContents.Width = 200
- Me.rkmanageViewer.Toolbar.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
- '
- 'frmviewrkmanage
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
- Me.ClientSize = New System.Drawing.Size(292, 273)
- Me.Controls.Add(Me.rkmanageViewer)
- Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
- Me.Name = "frmviewrkmanage"
- Me.Text = "frmviewrkmanage"
- Me.ResumeLayout(False)
- End Sub
- #End Region
- Public strquery As String
- Public sqlString As String
- Private Sub frmviewrkmanage_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- rkprint()
- End Sub
- Private Sub rkprint()
- Try
- If sqlString = String.Empty Then
- sqlString = "select * from wz_rk where 票号='" & strquery & "' order by 序号"
- End If
- 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.rkmanageViewer.Document = rpt.Document
- rpt.Run(False)
- Catch ex As Exception
- MessageBox.Show(Me, "报表错误: " + ex.Message + "; " + ex.InnerException.Message, "Report Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
- End Try
- End Sub
- End Class