Word/Excel file generation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thierry

    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
  • Erwin Moller

    #2
    Re: Word/Excel file generation

    Thierry wrote:
    [color=blue]
    > 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[/color]

    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

    Comment

    • freako9699@gmail.com

      #3
      Re: Word/Excel file generation

      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.

      Comment

      • MsKitty

        #4
        Re: Word/Excel file generation

        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
        San Diego web design, development, training, and programming - we set up membership sites, Blogs, Ecommerce, Dynamic Content, and easily maintained web sites


        Comment

        • Thierry

          #5
          Re: Word/Excel file generation

          MsKitty wrote:[color=blue]
          > 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
          >[/color]

          Well if you have website examples...

          Titi

          Comment

          Working...