Arsip: cara ngerubah data di excel lewat delphi gimana
more 17 years ago
mas_kofa
var vkodemk:string;
bposting:boolean;
vsks:string;
function Convert_To_Excel(namatable,namafileexcel:string):integer;
var i,j:integer;
source:TTable;
Dest:TF1Book;
countfield,countrec:integer;
begin
try
Source:=TTable.create(application);
Source.databasename:=extractfilepath(namatable);
Source.tablename:=extractfilename(namatable);
Source.Active:=true;
Dest:=TF1Book.create(application);
countfield:=Source.fieldcount;
countrec:=Source.RecordCount;
if countrec>16382 then
begin
result:=-1;
exit;
end;
for i:=1 to countfield+1 do
begin
if i=1 then Dest.TextRC[1,i]:='No'
else Dest.TextRC[1,i]:=Source.Fields[i-2].DisplayName;
{pengecekan lebar field}
if i=1 then
begin
Dest.ColWidth[i]:=length(Source.fields[i].displayname)256
end
else if length(Source.fields[i-2].displayname) > Source.fields[i-2].datasize
then Dest.ColWidth[i]:=length(Source.fields[i-2].displayname) 256
else Dest.ColWidth[i]:=Source.fields[i-2].datasize*256+300;
end;
Source.first;
for j:=1 to countrec do
begin
for i:=1 to countfield+1 do
begin
{pencetakan record}
if i=1 then Dest.numberRC[j+2,i]:=j
else if i=2 then Dest.TextRC[j+2,i]:=copy(Source.Fields[i-2].text,1,2)+'.'+
copy(Source.Fields[i-2].text,3,2)+'.'+copy(Source.Fields[i-2].text,5,3)
else Dest.TextRC[j+2,i]:=Source.Fields[i-2].Text
end;
Source.next;
application.ProcessMessages;
end;
Dest.write(namafileexcel,F1FileExcel5);
Source.free;
Dest.free;
except
end;
result:=0;
end;
more 17 years ago
lela
HEHEHEH, nuhun ya, aku mo nyobain ah, tapi kalo ada yang salah ntar bantuin lagi ya
more 17 years ago
chandra
gimana caranya kalo mau nulis text ke excel? misal saya mau nulis
cell a1='ini'
cell a2='ibu'
cell a3='budi'
thanx
more 17 years ago
donald
@lela: cara ngerubah data di excel lewat delphi gimana, mohon bantuannya bangetkok kulo gak ngerti ya apa yang dimaksud ama @lela,tolong donk diperjelas ato contoh file dalam bentuk excelnya,krn saya juga tertarik nih dengan pembahasan perubahan data excel melalui delphi
more 17 years ago
lela
misalkan di excel data pada sel a2=4, nah kita pengen melalui delphi di excel itu sel a2 datanya berubah jadi 5, itu gimana sih carane
more ...
- Pages:
- 1
reply |
Report Obsolete
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 4 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 4 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 12 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 12 years ago
Random Topic
- pergeseran bit biner gimana caranya ?
by putu_niki in Tip n Trik Pemrograman more 17 years ago - Penggunaan TComPort & TCustomComPort
by astonix in Network, Files, I/O & System more 17 years ago - ada yang tau komponent edbedit
by alvonz in Enginering more 16 years ago - VCL dan Library gratis!
by DelphiExpert in Tip n Trik Pemrograman more 17 years ago - Minta infonya dunk...
by p2bf in Enginering more 17 years ago - ingin proteksi softaware anda ???
by EkoIndri in Hal umum tentang Pascal Indonesia more 18 years ago - Delphi Killer
by bo3l4q in OOT more 15 years ago - Acces ke tabel di komputer lain
by goehsatrio in Tip n Trik Pemrograman more 17 years ago - NULL
by EkoIndri in MsSQL more 18 years ago - ord dan chr
by pebbie in Tip n Trik Pemrograman more 16 years ago