/    Sign up×
Community /Pin to ProfileBookmark

Spreadsheet

How would I insert data in to an XLS spreadsheet?

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@NogDogMay 01.2010 — Probably the simplest way is to use fputcsv() and create a CSV file, which is easily readable by any spreadsheet program. If you want to create a true .xls file, you want to use one of the available 3rd-party scripts/classes to do it, such as [url=http://phpexcel.codeplex.com/]PHPExcel[/url]. (I can't vouch for this one, it's just the first promising-looking one I found in a quick search.)
Copy linkTweet thisAlerts:
@themartyMay 01.2010 — I've used this one in the past:

http://pear.php.net/package/Spreadsheet_Excel_Writer/redirected

It's easy to use and does the job well
Copy linkTweet thisAlerts:
@JunkMaleMay 01.2010 — Thats nice info.
Copy linkTweet thisAlerts:
@rootauthorMay 01.2010 — Thanks.

I will have to spend some time on this, seems more difficult than I first thought.

The file is already a XLS file and I want to be able to insert the data straight in to the existing XLS sheet so that when I do open it up, all the data needed or inserted is present.

The alternative is if the information can be retrieved by the spreadsheet from a MySQL database.

I would prefer the first option because I don't have excel myself but would want to be able to insert the information so I then can open the file at work to print off.
Copy linkTweet thisAlerts:
@rootauthorMay 02.2010 — Ok, well it appears that you have to install these things and I do not have that level of access in the server as the server is on a web hosting account.

?
×

Success!

Help @root spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...