Arsip: Konversi data dalam Database ke Excel

 
user image
more 13 years ago

n3o_cybertech

Allouww....temen2 aq mo nanya nih, gimana ya caranya memindahkan record semua data dalam database ke dalam file excel??? tolong ya temen2 coz aq dari dulu nyari referensinya gak pernah dapet (ato aq kurang sabar yach???). OK deh makasih sebelumnya!!! :P :P :P
user image
more 13 years ago

p2bf

Klo software nya seh ada, itu juga klo ga salah namanya ESF Database Converter ama Navicat MySQL. malah bukan ke Excel aja deh.. coba aja di search...
user image
more 13 years ago

simba

Cara paling gampang, simpan database ke file dgn struktur HTML table. Excel 2000 dan OpenOffice 2.0 atau yg terbaru bisa langsung otomatis mengenali dan mengkonversi HTML table ke spreadsheet. HTH.
user image
more 13 years ago

n3o_cybertech

@simba : bisa dijelasin secara terperinci tentang hal ini??? coz aq masih awam banget dalam database.
user image
more 13 years ago

simba

---8<--- begin copy block below this line ---8<---

<html>
<head>
<style><!--table
  {mso-displayed-decimal-separator:"\,";
   mso-displayed-thousand-separator:"\.";}
@page
  {margin:.75in .75in .75in .75in;
   mso-header-margin:.5in;
   mso-footer-margin:.5in;}
tr
  {mso-height-source:userset;}
col
  {mso-width-source:userset;}
br
  {mso-data-placement:same-cell;}
.style0
  {mso-number-format:General;
   white-space:nowrap;
   mso-style-id:0;}
td
  {mso-style-parent:style0;
   white-space:nowrap;}
.xHorizontal
  {mso-style-parent:style0;
   mso-rotate:0;}
.xVertical
  {mso-style-parent:style0;
   mso-rotate:90;}
.xText
  {mso-style-parent:style0;
   mso-number-format:"\@";}
.xNumber
  {mso-style-parent:style0;
   mso-number-format:"\#\,\#\#0";}
.xDate
  {mso-style-parent:style0;
   mso-number-format:"yyyy-mm-dd";}
.xTime
  {mso-style-parent:style0;
   mso-number-format:"hh:nn:ss";}
.xDateTime
  {mso-style-parent:style0;
   mso-number-format:"yyyy-mm-dd hh:nn:ss";}
.xMoney
  {mso-style-parent:style0;
   mso-number-format:Standard;}
.xWrapText
  {mso-style-parent:style0;
   white-space:normal;}
--></style>
</head>
<body link=blue vlink=purple>
<table>
<tr>
  <td width=80>Laporan Keuangan</td>
</tr>
<tr>
  <td />
  <td width=auto><font color=#FF0000><b>col1, row1</b></font></td>
  <td width=auto><i>col2, row1: test long text</i></td>
  <td width=200><u><font color=#008800>col3, row1</u></font></td>
</tr>
<tr>
  <td />
  <td class=xNumber>0211</td>
  <td class=xText>00213</td>
  <td>=B3+C3</td>
  <td class=xDate>16-01-2007</td>
</tr>
<tr>
  <td />
  <td align=right>col1, row3</td>
  <td>col2, row3</td>
  <td class=xWrapText align=center bgcolor=yellow><font color=red size=+1 face="Courier New">
  wrapText wrapTextwrapText wrapTextwrapTextwrapText wrapTextwrapTextwrapTextwrapText</font></td>
</tr>
</table>
</body>
</html>
---8<--- end copy block above this line ---8<--- Bikin file teks baru (pake Notepad), paste block di atas, simpan file dgn ekstensi .xls (misal: test.xls), buka Explorer, double click file tsb. Dijamin Excel (kalo udah terinstall) akan membuka dan menampilkannya dgn benar. Gmn bikin file seperti itu dari program? Silakan yg lain menjelaskan. :P
user image
more 13 years ago

snip3r

jadi misalnya database .txt dikonversi dulu ke HTML ya...
user image
more 13 years ago

n3o_cybertech

waduh...makasih ya @simba, tak coba dulu di rumah, berguna banget nih buat nyelesain proyek + TAku (sem. Depan). 1x lagi makasih!!!
user image
more 13 years ago

nurez

boleh jg dgn import table ..(tp dari MDB) klo convert dari XLS ke MDB via ODBC ..? pakai provider apa dn komponen apa sich..? koq di ADo ngga bisa..? apa msti install driver XLS dlu.? atau mungkin sy yg ngga bisa.? ko pke BDE mls nyobanya..
user image
more 13 years ago

IdrisZZ

Contoh Program yang pernah saya buat ==>>

var
  FCariLapBeliPrinciple: TFCariLapBeliPrinciple;
  Xls : Variant;
implementation
uses ComObj;
procedure TFCariLapBeliPrinciple.LapExcelClick(Sender: TObject);
Var Sheet : Variant;
    Baris : Integer;
    Total : Currency;
    Hari,Bulan,Tahun : Word;
    A,B              : String;
begin
     DecodeDate(TglAwal.Date, Tahun,Bulan,Hari);
     A := (IntToStr(Bulan)+'/')+(IntToStr(Hari)+'/' + (IntToStr(Tahun)));
     DecodeDate(TglAkhir.Date, Tahun,Bulan,Hari);
     B := (IntToStr(Bulan)+'/')+(IntToStr(Hari)+'/' + (IntToStr(Tahun)));
      FLapBeliPrinciple.QHutang.Close;
      FLapBeliPrinciple.QHutang.SQL.Clear;
      FLapBeliPrinciple.QHutang.SQL.Add('SELECT A.KODE_PRINC, A.TGL_TRANS'+
                                             ', A.NOFAKTUR, A.TGL_FAKTUR, A.KETERANGAN'+
                                             ', A.TGL_JT, A.MASUK, A.DEBET_NOTE, A.BAYAR'+
                                             ', A.CREDIT_NOTE, B.NAMA_PRINC');
      FLapBeliPrinciple.QHutang.SQL.Add('FROM HUTANG_DAGANG A, PRINCIPLE B');
      FLapBeliPrinciple.QHutang.SQL.Add('WHERE (A.KODE_PRINC = B.KODE_PRINC) AND (A.KODE_PRINC = '+QuotedStr(Kode_Princ.Text)+') AND (A.MASUK <> 0) AND '+
                                             '(A.TGL_TRANS >= '+QuotedStr(A)+') And (A.TGL_TRANS <= '+QuotedStr(B)+')');
      FLapBeliPrinciple.QHutang.SQL.Add('ORDER BY A.TGL_TRANS');
      FLapBeliPrinciple.QHutang.Open;
      If FLapBeliPrinciple.QHutang.RecordCount <> 0 Then
      Begin
         Xls := CreateOleObject('Excel.Application');
         Xls.Visible := True;
         Xls.Caption := 'Report Pembelian';
         Xls.WorkBooks.Add;
         Xls.WorkBooks[1].Sheets.Add;
         Xls.WorkBooks[1].WorkSheets[1].Name := 'Pembelian';
         Sheet := Xls.WorkBooks[1].WorkSheets['Pembelian'];
         Sheet.Cells[1,1] := 'Laporan Pembelian / Principle';
         Xls.WorkBooks[1].WorkSheets['Pembelian'].Rows[1].Font.Color := ClBlue;
         Xls.WorkBooks[1].WorkSheets['Pembelian'].Rows[1].Font.Bold := True;
         Xls.WorkBooks[1].WorkSheets['Pembelian'].Rows[3].Font.Bold := True;
         Xls.WorkBooks[1].WorkSheets['Pembelian'].Rows[4].Font.Bold := True;
         Xls.WorkBooks[1].WorkSheets['Pembelian'].Rows[6].Font.Bold := True;
         Xls.WorkBooks[1].WorkSheets['Pembelian'].Rows[8].Font.Bold := True;
         //Xls.WorkBooks[1].WorkSheets['Report 01'].Rows[3].Alignment:= Center;
         Sheet.Cells[8, 1] := 'TGL. TERIMA BARANG';
         Sheet.Cells[8, 2] := 'NO. FAKTUR';
         Sheet.Cells[8, 3] := 'TGL. FAKTUR';
         Sheet.Cells[8, 4] := 'JUMLAH (Rp.)';
         Sheet.Cells[8, 5] := 'T` GL. J.TEMPO';
         Sheet.Cells[8, 6] := 'KETERANGAN';
         Sheet.Cells[3, 1] := 'KODE PRINCIPLE : '+FLapBeliPrinciple.QHutang['KODE_PRINC'];
         Sheet.Cells[4, 1] := 'NAMA PRINCIPLE : '+FLapBeliPrinciple.QHutang['NAMA_PRINC'];
         Sheet.Cells[6, 1] := 'PERIODE  '+DateToStr(TglAwal.Date)+' s/d '+DateToStr(TglAkhir.Date);
         Baris := 8;
         With FLapBeliPrinciple Do
         Begin
         QHutang.First;
         While Not QHutang.Eof Do
         Begin
              Inc(Baris);
              Sheet.Cells[Baris, 1] := QHutang['Tgl_Trans'];
              Sheet.Cells[Baris, 2] := QHutang['NoFaktur'];
              Sheet.Cells[Baris, 3] := QHutang['Tgl_Faktur'];
              Sheet.Cells[Baris, 4] := QHutang['Masuk'];
              Sheet.Cells[Baris, 5] := QHutang['Tgl_JT'];
              Sheet.Cells[Baris, 6] := QHutang['Keterangan'];
              Total := Total + QHutang['Masuk'];
              QHutang.Next;
         End;
         End;
         Xls.WorkBooks[1].WorkSheets['Pembelian'].Columns[1].ColumnWidth := 25;
         Xls.WorkBooks[1].WorkSheets['Pembelian'].Columns[2].ColumnWidth := 20;
         Xls.WorkBooks[1].WorkSheets['Pembelian'].Columns[3].ColumnWidth := 12;
         Xls.WorkBooks[1].WorkSheets['Pembelian'].Columns[4].ColumnWidth := 12;
         Xls.WorkBooks[1].WorkSheets['Pembelian'].Columns[5].ColumnWidth := 15;
         Xls.WorkBooks[1].WorkSheets['Pembelian'].Columns[6].ColumnWidth := 15;
         Xls.WorkBooks[1].WorkSheets['Pembelian'].Columns[7].ColumnWidth := 25;
         Inc(baris, 2);
         Sheet.Cells[Baris, 2] := 'TOTAL SELURUH';
         Sheet.Cells[Baris, 4] := FormatFloat('###,###,###',Total);
      End
      Else
      Begin
           ShowMessage('Data Pembelian Tidak Ada..!');
           Exit;
      End;
end;
Edited by MOMOD: Penambahan Syntax Highlighter
user image
more 13 years ago

simba

Kalo mau yg lebih rumit (tapi mantap), native, gak perlu com/dll/activex, silakan gunakan FlexCel. Cari yg versi 2.5.3, itu masih free open source. Versi setelah itu udah jadi komersil krn dibeli ama TMSSoftware. :( Happy hunting, eh, googling. :D
more ...
  • Pages:
  • 1
Share to
Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com