exporting to an excel sheet

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default exporting to an excel sheet

    Hey all,

    I've created a MySQL database with lots of names, addresses and other
    info in it and I'd like to write a little script that puts some selected
    info in an excel file.
    Anyone know how? Maybe there are some small programs I can buy?

    Thanks,
    Tim
    El Bucanero Guest

  2. Similar Questions and Discussions

    1. Using cfform to update an Excel sheet
      I am building a cfform to update a spread sheet, but am not sure how to indicate what column/row that the form field should update in the excel file....
    2. How to get the name of an Excel sheet?
      It's a COM call via CFObject but be warned - if there are External Links in the spreadsheet or VBA code, you could have issues. I'll post some code...
    3. Excel sheet creation from ASP
      Hi. Simple ASP creates Excel file on C drive: Dim xls Set xls = CreateObject( "Excel.Application") xls.Workbooks.Add...
    4. Excel Sheet Export
      Hi All, I have an Excel sheet which I recieve every week. Its not too much data and the present process is to manually load that data into a SQL...
    5. Export to Excel sheet
      You may refer to this KB article: http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q288130 Luke (This posting is provided "AS IS",...
  3. #2

    Default Re: exporting to an excel sheet

    El Bucanero wrote:
    > I've created a MySQL database with lots of names, addresses and other
    > info in it and I'd like to write a little script that puts some selected
    > info in an excel file.
    > Anyone know how? Maybe there are some small programs I can buy?
    Use the PEAR package:
    [url]http://pear.php.net/package-info.php?package=Spreadsheet_Excel_Writer[/url]

    You can also just write the data out into an HTML file as a table and save
    it with an .xls extension and Excel will open it as a spreadsheet. This
    isn't the best way but it's a quick 'n dirty approach.

    --
    Chris Hope
    The Electric Toolbox - [url]http://www.electrictoolbox.com/[/url]
    Chris Hope Guest

  4. #3

    Default Re: exporting to an excel sheet

    >
    > Use the PEAR package:
    > [url]http://pear.php.net/package-info.php?package=Spreadsheet_Excel_Writer[/url]
    >
    > You can also just write the data out into an HTML file as a table and save
    > it with an .xls extension and Excel will open it as a spreadsheet. This
    > isn't the best way but it's a quick 'n dirty approach.
    >
    Quick n Dirty sounds good :)
    it's just text, no calculations neccesary.
    I can import this in excel and then save it as a proper file?

    Thanks,
    Tim
    El Bucanero Guest

  5. #4

    Default Re: exporting to an excel sheet

    El Bucanero spilled the following:
    >>
    >> Use the PEAR package:
    >> [url]http://pear.php.net/package-info.php?package=Spreadsheet_Excel_Writer[/url]
    >>
    >> You can also just write the data out into an HTML file as a table and
    >> save it with an .xls extension and Excel will open it as a spreadsheet.
    >> This isn't the best way but it's a quick 'n dirty approach.
    >>
    >
    > Quick n Dirty sounds good :)
    > it's just text, no calculations neccesary.
    > I can import this in excel and then save it as a proper file?
    >
    Proper file? Proper File? You mean a proprietary format that has a facility
    for building in virus and trojans! Tread carefully El.

    I was going to suggest that you skip PHP altogether and use MyODBC to import
    the data directly to Excel. But I don't think I will now.

    C.
    Colin McKinnon Guest

  6. #5

    Default Re: exporting to an excel sheet

    El Bucanero wrote:
    >> Use the PEAR package:
    >> [url]http://pear.php.net/package-info.php?package=Spreadsheet_Excel_Writer[/url]
    >>
    >> You can also just write the data out into an HTML file as a table and
    >> save it with an .xls extension and Excel will open it as a spreadsheet.
    >> This isn't the best way but it's a quick 'n dirty approach.
    >>
    >
    > Quick n Dirty sounds good :)
    > it's just text, no calculations neccesary.
    > I can import this in excel and then save it as a proper file?
    Yeah it works. The only catch is if any of your cells have leading zeros
    they'll be removed when you open up the file. If they don't then this isn't
    a problem.

    IIRC you can even format the colour of cells using the bgcolor attributes of
    the tr and td tags.

    --
    Chris Hope
    The Electric Toolbox - [url]http://www.electrictoolbox.com/[/url]
    Chris Hope Guest

  7. #6

    Default Re: exporting to an excel sheet

    On Tue, 15 Jun 2004 13:54:15 +0200
    El Bucanero <american_discoPANTS@hotmail.com> wrote:
    > Hey all,
    Hi...
    > I've created a MySQL database with lots of names, addresses
    > and other info in it and I'd like to write a little script
    > that puts some selected info in an excel file.
    Try the PEAR extension listed in [http]://pear.php.net
    > Anyone know how? Maybe there are some small programs I can
    > buy?
    Why to buy?
    > Thanks,
    > Tim
    Regards...
    --
    Daniel Molina Wegener <dmw[@]unete.cl>
    Developer | FreeBSD User
    "Swift as the wind, Quiet as the forest,
    Fierce as fire, Immovable as a mountain"
    Daniel Molina Wegener Guest

  8. #7

    Default Re: exporting to an excel sheet

    Alternatively to the other suggestions, you can easily use PHP to
    export everything out into a Comma Seperated Values (CSV) format,
    and then open it up in Excel. Tabs and spaces could also be used
    as seperators, just remember to enclose your data in quotes, escaping
    any quotes in the data with a backslash (\) so it doesn't get
    interpreted as the end of a field.

    On Tue, 15 Jun 2004 13:54:15 +0200, El Bucanero
    <american_discoPANTS@hotmail.com> wrote:
    >Hey all,
    >
    >I've created a MySQL database with lots of names, addresses and other
    >info in it and I'd like to write a little script that puts some selected
    >info in an excel file.
    >Anyone know how? Maybe there are some small programs I can buy?
    >
    >Thanks,
    >Tim
    eclipsboi Guest

  9. #8

    Default Re: exporting to an excel sheet

    > Yeah it works. The only catch is if any of your cells have leading zeros
    > they'll be removed when you open up the file. If they don't then this isn't
    > a problem.
    >
    > IIRC you can even format the colour of cells using the bgcolor attributes of
    > the tr and td tags.
    >
    Whoopdeedoo, it works.
    Thanks all. Yes you too colin :P

    T
    El Bucanero Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139