[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] VoucherViewer [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] CrystalDecisions.Windows.Forms.CrystalReportViewer = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] CrystalDecisions.Windows.Forms.CrystalReportViewer[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] DataSet1 [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] DataSet = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] DataSet()[/SIZE]
[SIZE=2]DataSet1.Tables.Clear()[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] DataTable_Emp_Profile [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] DataSet1.Emp_ProfileDataTable[/SIZE]
[SIZE=2]DataSet1.Tables.Add(DataTable_Emp_Profile)[/SIZE]
[SIZE=2]Local_Global_SQLSTRING = [/SIZE][SIZE=2][COLOR=#800000]"SELECT * FROM Emp_Profile WHERE emp_no='"[/COLOR][/SIZE][SIZE=2] & DataGridView1.Item(0, DataGridView1.CurrentRow.Index).Value.ToString & [/SIZE][SIZE=2][COLOR=#800000]"'"[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] DAdapter1 [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] OleDb.OleDbDataAdapter = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDb.OleDbDataAdapter(Local_Global_SQLSTRING, OleDbConnection1)[/SIZE]
[SIZE=2]DAdapter1.Fill(DataTable_Emp_Profile)[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] DataTable_Requisition [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] DataSet1.RequisitionDataTable[/SIZE]
[SIZE=2]DataSet1.Tables.Add(DataTable_Requisition)[/SIZE]
[SIZE=2]Local_Global_SQLSTRING = [/SIZE][SIZE=2][COLOR=#800000]"SELECT * FROM Requisition WHERE batch_no='"[/COLOR][/SIZE][SIZE=2] & DataGridView1.Item(1, DataGridView1.CurrentRow.Index).Value.ToString & [/SIZE][SIZE=2][COLOR=#800000]"'"[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] DAdapter2 [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] OleDb.OleDbDataAdapter = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDb.OleDbDataAdapter(Local_Global_SQLSTRING, OleDbConnection1)[/SIZE]
[SIZE=2]DAdapter2.Fill(DataTable_Requisition)[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] VoucherReport [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] Voucher[/SIZE]
[SIZE=2]VoucherReport.SetDataSource(DataSet1)[/SIZE]
[SIZE=2]VoucherViewer.ReportSource = VoucherReport[/SIZE]
[SIZE=2]Voucher_Report_Form.Controls.Add(VoucherViewer)[/SIZE]
[SIZE=2]Voucher_Report_Form.WindowState = FormWindowState.Maximized[/SIZE]
[SIZE=2][COLOR=#008000]'Set the Crystal Report Viewer properties[/COLOR][/SIZE]
[SIZE=2]VoucherViewer.ActiveViewIndex = 0[/SIZE]
[SIZE=2]VoucherViewer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle[/SIZE]
[SIZE=2]VoucherViewer.DisplayGroupTree = [/SIZE][SIZE=2][COLOR=#0000ff]False[/COLOR][/SIZE]
[SIZE=2]VoucherViewer.Dock = System.Windows.Forms.DockStyle.Fill[/SIZE]
[SIZE=2]VoucherViewer.Location = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] System.Drawing.Point(0, 0)[/SIZE]
[SIZE=2]VoucherViewer.Name = [/SIZE][SIZE=2][COLOR=#800000]"CrystalReportViewer1"[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]'Show the Voucher_Report_Form[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] DisplayForm [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] Voucher_Report_Form[/SIZE]
[SIZE=2]Voucher_Report_Form.ShowInTaskbar = [/SIZE][SIZE=2][COLOR=#0000ff]False[/COLOR][/SIZE]
[SIZE=2]Voucher_Report_Form.ShowDialog([/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2])[/SIZE]