PHP converting : HTML2XLS

Wah dapat bahan bagus banget nih untuk menghasilkan Excel dari format HTML.

dengan cukup menambahkan kode berikut

header(“Content-type: application/octet-stream”);

# replace excelfile.xls with whatever you want the filename to default to
header(“Content-Disposition: attachment; filename=excelfile.xls”);
header(“Pragma: no-cache”);
header(“Expires: 0”);

jadi deh … Save as . XLS

 

testimoni nih bro and sis hehehe… dari milis PHPUG. Alhamdulillah bisa bermanfaat, ini namanya berkah ^_^

============================================================================

 

 

From: phpug@yahoogroups.com [mailto:phpug@yahoogroups.com] On Behalf Of Suwandi
Sent: Sunday, July 24, 2011 8:52 AM
To: phpug@yahoogroups.com
Subject: RE: [KPHPI] PHP Excel

 

 

Wah yang ini solusinya lebih mudah dan gampang, di coba deh.
Memang karena udah terlanjur buat format html-nya, karena request client mau
dijadiin XLS.

Ngak kepikiran bahwa bisa dari HTML -> XLS

Thanks bro.
MANSTAB

—–Original Message—–
From: phpug@yahoogroups.com [mailto:phpug@yahoogroups.com] On Behalf Of Andri
Darmawan
Sent: Friday, July 22, 2011 2:01 PM
To: phpug@yahoogroups.com
Subject: RE: [KPHPI] PHP Excel

Saya dapet link dari forum.
Kebetulan cara saya berbeda. Awalnya saya generate ke HTML.
Hanya dengan menambahkan baris berikut ini, generate HTML-nya berubah ke Save
as.. XLS.

header(“Content-type: application/octet-stream”);

# replace excelfile.xls with whatever you want the filename to default to
header(“Content-Disposition: attachment; filename=excelfile.xls”);
header(“Pragma: no-cache”);
header(“Expires: 0″);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s