473,322 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Word/Excel file generation

Hello.

Is it possible to generate word/excel files in PHP ? with a template
file ?...

It is possible in Java so I guess it is possible in PHP to. I allready
know how to do PDF...

Can anyone help me ?

Thx. Titi
Nov 22 '05 #1
4 1913
Thierry wrote:
Hello.

Is it possible to generate word/excel files in PHP ? with a template
file ?...

It is possible in Java so I guess it is possible in PHP to. I allready
know how to do PDF...

Can anyone help me ?

Thx. Titi


Hi Titi,

Yeas, some API's have been written in the past, but they always suffer from
the fact that M$ is changing their format in their newer versions.

I think the safest bet for you is to use Word and Excel themself on a W$
machine as server.
The process in short:
1) Instantiate a new Word-object. (Let PHP do that)
2) Do stuff on that object, like opening a template, etc. etc.
3) Safe a copy somewhere, or stream the copy to a client.
4) close and destroy the object.

The above approach used to be suspect for memoryleaks.
I am unsure how things are now on moderen OS's from M$.

The process is refered to as 'automation' I think.
Google for it for hints and examples.

You can also find many examples on the net, most are written in VBScript,
but do not let that demotivate you: You can use the same api once you
create an object in PHP, since the underlying object (and methods) are the
same.

Good luck.

Regards,
Erwin Moller
Nov 22 '05 #2
yeh its not that hard. just do fwrite() with a .doc extension then hope
to buggery it formats alright :-P. probably a lot easier to do in PERL.

Nov 22 '05 #3
Create text files that are tab or comma separated for easy loading into
Excell.

For WORD create an RTF file if you want all the formatting. Google it,
there are some sites out there that explain how. Easiest to create your
own template file (have a look at it in a plain text editor or in
emacs) and then insert the new text in the middle following the RTF
formatting rules. Yes, I have done this a few times. Not too hard once
you get the hang of it.

Kitty
http://OpenSkyWebDesign.com

Nov 22 '05 #4
MsKitty wrote:
Create text files that are tab or comma separated for easy loading into
Excell.

For WORD create an RTF file if you want all the formatting. Google it,
there are some sites out there that explain how. Easiest to create your
own template file (have a look at it in a plain text editor or in
emacs) and then insert the new text in the middle following the RTF
formatting rules. Yes, I have done this a few times. Not too hard once
you get the hang of it.

Kitty
http://OpenSkyWebDesign.com


Well if you have website examples...

Titi
Nov 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: MrBill | last post by:
I would like to be able to open, read, and extract data from a report that is produced in MS Word. The doc seems to contain embedded spreadsheets. I would like to extract some of the data from...
6
by: Chris | last post by:
Hi, - How can I open an existing word document from a C#-client and manipulate that document from within the C#-client ? - How can I open an excel document that is embedded in a word-document...
4
by: Chris | last post by:
Hi, everything works apart from the last line :-(( rng.Value2.ToString() An exception is thrown : "Old format or invalid type library" It gets compiled though (so he recognizes the property...
4
by: Lisa | last post by:
Hi - I'm able to open excel workbooks and word documents, but I can't seem to copy excel charts, named ranges, etc. to a word document. Anyone know of good reference material in this area? What...
1
by: Robin Tucker | last post by:
Heres and interesting problem: I have a VB.NET program that creates reports via. Word Automation. This all works fine. What I want to do as part of this report generation process is to embed a...
3
by: herman404 | last post by:
Hi everyone, I have data coming to me in the form of Word and Excel files, and I need to place this data into a SQL Server database. The Word file will be coming in text which is similiar to an...
4
by: Peppie | last post by:
Hi all, I created a button in an Access form that opens MS Word. Now I want this button also to open a specific file. How do I code this? Would it also be possible to let the user select the...
12
by: Steve | last post by:
I've been building an application that will merge fields in a text file with a word template, save the resulting word file out to the user's hard drive, and then email the file as an attachment. ...
7
by: Peter | last post by:
ASP.NET 2.0 I am trying to open a Word document and Excel document from a dialog web page, what's the best way to do that? I have tried the following: Response.Clear();...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.