AndreJaya

Untitled

Oct 21st, 2019
106
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  2. cmd = New OleDbCommand("select tbl_Jurnal.Kode_COA,tbl_Jurnal.N_Perkiraan,sum (Debet) as Debet,sum (Kredit) as Kredit from tbl_Jurnal where left (Kode_COA,1) IN ('4','5','6') AND date between ? AND ? group by Kode_COA,N_Perkiraan order by Kode_COA asc", conn)
  3.         cmd.Parameters.AddWithValue("?", DateTimePicker1.Value.Date)
  4.         cmd.Parameters.AddWithValue("?", DateTimePicker2.Value.Date)
  5.         da = New OleDbDataAdapter(cmd)
  6.         ds = New DataSet
  7.         ds.Clear()
  8.         da.Fill(ds)
  9.         DGVLABARUGI.DataSource = ds.Tables(0)
  10.         DGVLABARUGI.ReadOnly = True
  11.         With DGVLABARUGI
  12.             .Columns(0).Width = "150"
  13.             .Columns(1).Width = "310"
  14.             .Columns(2).Width = "150"
  15.             .Columns(3).Width = "150"
  16.             .Columns(0).HeaderText = "KODE AKUN"
  17.             .Columns(1).HeaderText = "NAMA AKUN"
  18.             .Columns(2).HeaderText = "AMOUNT"
  19.             .Columns(3).HeaderText = "AMOUNT"
  20.             .Columns(2).DefaultCellStyle.Format = "##,0"
  21.             .Columns(3).DefaultCellStyle.Format = "##,0"        
  22.             .Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomRight            
  23.             .ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
  24.             .ColumnHeadersDefaultCellStyle.Font = New Font(DGVLABARUGI.Font, FontStyle.Bold)
  25.         End With
  26.     End Sub
RAW Paste Data