Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Dec 2005
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Excel Processing

    All,

    Looking for help with reading/processing/writing Excel in PHP.

    Have post on this at:

    http://forums.codewalkers.com/php-co...tml#post167558

    All help appreciated!

    Thanks!

    OMR

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,500
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    It looks to me like there are many methods,
    some better than others. I guess it's important
    to know if you have your own server or not.
    I mention that because there might be some PHP
    modules / classes / libraries that do it all.
    Not sure if all webhosts have things installed for Excel.

    I assume you've looked at this?
    http://www.google.com/search?hl=en&q...=Google+Search

    EDIT:
    I should have read your post more closely.
    I now see you've been trying many things (viewing codewalkers forum).
    Sorry I can't provide any more help than the codewalkers is giving you.


    .
    Last edited by mlseim; 01-09-2008 at 06:10 PM.

  • #3
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,049
    Thanks
    2
    Thanked 317 Times in 309 Posts
    IF (big if) VBA runs when you access excel using COM - http://www.php.net/manual/en/class.com.php (I see a little commented out COM in your code), then you should be able to do what you want directly without relying on any third-party code classes.

    Here is an example I found (starting on page 6) - http://sydphp.org/presentations/010606-excel.html
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #4
    New Coder
    Join Date
    Dec 2005
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Almost There

    All,

    Maybe you didn't notice, but this project turned out to be much larger than I thought.

    Anyway I finally got all the reading done and now working on writing the second file.

    I had to break up the output into two (2) MySql tables as 1.) one table deals with header and footer information, for both input and output EXCEL files and 2.) the second table deals with itemized rows.

    In particular this is a problem as you notice the output EXCEL file only has ten (10) rows to write into, and the input EXCEL file has 300 rows of data. Now selection (query) of data from the first input file is on the "QTY" column, which we ignore if blank, so usually less than 10 rows are active. But when more than 10 row result from the query, then new rows have to be inserted into the output EXCEL file, conserving the formatting from the row above and then renumbering column one, for all remaining detail item rows.

    I'm uploading the source for where I'm at. I used:
    • [li]TBS to open/view the source file, [/li]
      [li]Excel Reader to read my values[/li]

    but now have to find a different class to write with.

    If you have a single class that can do it all, it would be helpful and jumping in here to help will be appreciated.

    I tried but limit on filesize is 50kb and source files are too large zipped. First file is at:

    http://forums.codewalkers.com/php-co...tml#post170927

    Will find another place to put second one and post link here.

    Thanks!

    OMR

  • #5
    New Coder
    Join Date
    Dec 2005
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #6
    New Coder
    Join Date
    Dec 2005
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    RoadBlock

    All,

    Hey I got all it working but the write to the new SS.

    On the subject of write, when I look at all the docs on the Excel Writer Classes, everyone assumes new file, new workbook, new worksheet.

    Nothing could be further from my situation! I have a .XLT template with a specific "NAMED" worksheet that must be written to.

    Therefore none of the docs fit my problem and I have not yet figured out how to find my worksheet in the writer. Finding worksheets seems to be a "READER" function not a "WRITER" function, so I seem to be at an impasse right now!

    Suggestions on how to approach or solve this portion would help me get around my current road block.

    All help greatly appreciated!!!

    Thanks!!!

    OMR

  • #7
    New Coder
    Join Date
    Dec 2005
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Work Around

    All,

    Harish at:

    http://www.phpclasses.org/browse/package/2037.html

    suggested I use the PEAR class, get it working and then extract the class code to my other class libs when it works.

    What do you think?

    OMR


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •