csshacker
0
Newbie Poster
Recommended Answers
Jump to Post<?php $filename ="excelreport.xls"; $contents = "testdata1 \t testdata2 \t testdata3 \t \n"; header('Content-type: application/ms-excel'); header('Content-Disposition: attachment; filename='.$filename); echo $contents; ?>
This is the simplest way to generate an excel report.
Jump to Posthi, i am janardhan..
i want some more coding details about export to excell sheet.. suppose i am retriving data from database and storing the values in a table. i want to export in an excell sheet with proper header ..how can i develop this.?
Jump to PostReplace testdata in the above example with the database values.
Jump to Post$result=mysql_query("select * from tbl_name"); function xlsBOF() { echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); return; } function xlsEOF() { echo pack("ss", 0x0A, 0x00); return; } function xlsWriteNumber($Row, $Col, $Value) { echo pack("sssss", 0x203, 14, $Row, $Col, 0x0); echo pack("d", $Value); return; } function xlsWriteLabel($Row, $Col, $Value …
All 24 Replies
Ole Raptor
19
Posting Whiz in Training
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
jana36
0
Newbie Poster
nav33n
472
Purple hazed!
Team Colleague
Featured Poster
amakrid
0
Newbie Poster
timmuin
0
Newbie Poster
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
trivikrama
0
Newbie Poster
karthik_ppts
81
Posting Pro
nivibala
commented:
Good
+1
trivikrama
0
Newbie Poster
karthik_ppts
81
Posting Pro
kapil purohit
0
Newbie Poster
cocy
0
Newbie Poster
ss00
0
Newbie Poster
uday_blr9
0
Newbie Poster
abdurrahman1
0
Newbie Poster
isms
0
Newbie Poster
jozest arzy
0
Newbie Poster
sudesh_m
0
Newbie Poster
PyaarSeLogBabaBulaateHain
0
Newbie Poster
daniweb12543
0
Newbie Poster
Amir_11
Karthi_sree
0
Newbie Poster
diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.