Lokasi : Komplek Graha Bukit Raya 1 Blok G3 No 16 LT 3, Bandung Barat

Lokasi : Komplek Graha Bukit Raya 1 Blok G3 No 16 LT 3, Bandung Barat

VIDEO TUTORIAL MIKROTIK VIDEO + MODUL TRAINING ORDER BISA VIA TOKOPEDIA KLIK LINK GAMBAR

VIDEO TUTORIAL MIKROTIK  VIDEO + MODUL TRAINING ORDER BISA  VIA TOKOPEDIA KLIK LINK GAMBAR
Update Video Tutorial > Lebih dari 350 Video Tutorial MIkrotik

Jadwal Training Mikrotik Running Setiap Awal dan Akhir Bulan

Excel Fundamental, Excel Advanced, Dan Excel Programming VBA

IT TRAINING CENTER CONTACT : 0812-1451-8859 / 081-1219-8859

Cetak Multi Select DBGRID dengan Multi User


Ditutorial sebelumnya telah dibahas cara mencetak Multiselect di delphi dengan Single user, selanjutnya jika pemakai sistem banyak (Multi User) maka kita harus merubah codingnya seperti berikut



Resep Programming
Syntak Delphi
procedure TFcetak_barcode.bcetakClick(Sender: TObject);
var
i : integer;
begin
if DBGrid1.SelectedRows.Count > 0 then
  Begin
    with DBGrid1.DataSource.DataSet do
      Begin
        with qr2 do
          Begin
            close;
            sql.Clear;
            sql.Add(' DROP TABLE IF EXISTS `'+'temp'+main.usr+'` ' );
            ExecSQL;

            close;
            sql.Clear;
            sql.Add('CREATE TABLE `'+'temp'+main.usr+'` (');
                          sql.Add('idbcode VARCHAR(20) NULL DEFAULT NULL,');
                          sql.Add('tglinput DATE NULL DEFAULT NULL,');
                          sql.Add('idrak VARCHAR(10) NULL DEFAULT NULL,');
            sql.Add('nam_wh VARCHAR(50) NULL DEFAULT NULL,');
                          sql.Add('idmat INT(11) NULL DEFAULT NULL,');
                sql.add('qty_datang INT(11) NULL DEFAULT NULL,');
                sql.Add('unit_basic VARCHAR(50) NULL DEFAULT NULL,');
                          sql.Add('no_po VARCHAR(50) NULL DEFAULT NULL,');
                sql.Add('brg VARCHAR(50) NULL DEFAULT NULL,');
                sql.Add('supplier VARCHAR(50) NULL DEFAULT NULL');
            sql.Add(')COLLATE="utf8_general_ci" ');
            sql.Add('ENGINE=MyISAM ');
            sql.Add('; ');
            ExecSQL;
            close;
          end;
      end;
      for i := 0 to DBGrid1.SelectedRows.Count-1 do
         begin
           //GotoBookmark(pointer(DBGrid1.SelectedRows.items[i]));
           qr1.GotoBookmark(pointer(DBGrid1.SelectedRows[i]));
              begin
              // Buat tabel baru
                 with qr2 do
                  begin
                    close;
                    sql.Clear;
                    sql.Add('insert into `'+'temp'+main.usr+'`(idbcode,tglinput,idrak,nam_wh,
idmat,qty_datang,unit_basic,no_po,brg,supplier)');
                    sql.Add('values(:idbcode,:tgl,:idrak,:nam_wh,:idmat,
:qtydatang,:ub,:nopo,:brg,:supp)');
                    ParamByName('idbcode').AsString := qr1idbcode.AsString;
                    ParamByName('tgl').AsDate := qr1tglinput.AsDateTime;
                    ParamByName('idrak').AsString := qr1idrak.AsString;
                    ParamByName('nam_wh').AsString := qr1nam_wh.AsString;
                    ParamByName('idmat').AsString := qr1idmat.AsString;
                    ParamByName('qtydatang').AsString := qr1qtydatang.AsString;
                    ParamByName('ub').AsString := qr1unit_basic.AsString;
                    ParamByName('nopo').AsString := qr1no_po.AsString;
                    ParamByName('brg').AsString := qr1brg.AsString;
                    ParamByName('supp').AsString := qr1supplier.AsString;
                    ExecSQL;
                    close;
                  end;
             end;

        end;

       with qr3 do
        begin
          close;
          sql.Clear;
            sql.Add('select * from `'+'temp'+main.usr+'` ');
          open;
          close;
          end;
        frxReport1.Report.ShowReport(false);
end;
end;



Selamat Mencoba

PADEPOKAN IT COURSES
IT Tutorial, Training Center & IT Solution


Share

Artikel Lainnya :



No comments:

Post a Comment

Training Bulan ini

Padepokan IT Course

Lokasi Training
Jl. H.Gofur Komplek Graha Bukit Raya 1 Blok G3 No 16 Lantai 3, Cilame, Bandung Barat

Telp : 081214518859 (WhatsApp)
E-Mail : padepokanit.course@gmail.com
Instagram : @padepokanit
Website : www.padepokanit.com

Info Site

User Online Padepokan-IT Course

IT Tutorial, Training & IT Solution