Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Imports MySql.Data.

MySqlClient
Imports System.Data.DataTable
Imports Microsoft.Reporting.WinForms
Imports System.Drawing.Printing
Public Class KartuDisposisi
Public dt0 As New DataTable
Private Sub KartuDisposisi_Load(sender As System.Object, e As System.EventArgs)
Handles MyBase.Load
'Me.WindowState = FormWindowState.Maximized
Me.ReportViewer1.SetDisplayMode(DisplayMode.PrintLayout)
print()
End Sub

Private Sub print()


koneksisql()
Dim SDA As New MySqlDataAdapter
Dim DS As New DataSetDisposisi
Dim str As String
str = "select
a.*,c.TC30_MinimumSpek,TC30_MaksimumSpek,TC95_MinimumSpek,TC95_MaksimumSpek,MH_MinimumSpe
k,MH_MaksimumSpek,TC30_minspek,TC30_makspek,TC95_minspek,TC95_makspek,MH_minspek,MH_maksp
ek, b.disposisi,ydate_shift,waktu from (select
TESTNO,BARCODE,TXNDATE,shf,batch_no,WORKSTN,COMP_NO,LOT_NO,TCA,TCB,MH,QC_CHECK from
testrheo where shf like '%T%' And qc_check = 'NG' and testno='" & TXTESTNO.Text & "') a
"
str = str & " left join histdisp b on a.TESTNO = b.testno"
str = str & " left join panduandisposisi c on a.COMP_NO = c.Compound"
SDA.SelectCommand = New MySqlCommand(str, dbconn)
SDA.Fill(DS.Tables(0))
ReportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local
Dim tpspk As String
dt0.Clear()
Dim strsql0 = "select tipespek from panduandisposisi where compound='" &
TXITEMCODE.Text & "' "
'MsgBox(strsql0)
dbdata = New MySqlDataAdapter(strsql0, dbconn)
dbdata.Fill(dt0)
If dt0.Rows.Count > 0 Then
tpspk = dt0.Rows(0).Item(0).ToString
If tpspk.ToUpper = "2 JENIS" Then
ReportViewer1.LocalReport.ReportPath =
System.Environment.CurrentDirectory & "\Report1.rdlc"
ElseIf tpspk.ToUpper = "3 JENIS" Then
ReportViewer1.LocalReport.ReportPath =
System.Environment.CurrentDirectory & "\Report2.rdlc"
End If
End If
ReportViewer1.LocalReport.DataSources.Clear()
ReportViewer1.LocalReport.DataSources.Add(New
Microsoft.Reporting.WinForms.ReportDataSource("DataSetDisposisi", DS.Tables(0)))
ReportViewer1.DocumentMapCollapsed = True
Me.ReportViewer1.RefreshReport()
End Sub

Private Sub KartuDisposisi_FormClosing(sender As System.Object, e As


System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
Return
End Sub
End Class

You might also like