LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PHP: export data to openoffice calc (https://www.linuxquestions.org/questions/programming-9/php-export-data-to-openoffice-calc-391417/)

lucesei 12-10-2005 09:09 PM

PHP: export data to openoffice calc
 
Hi, here's my question: to export data to an excel file, I use the the following header:
Code:

header ("Content-Type: application/vnd.ms-excel");
//Other code follows....

Now I need to export to an openoffice calc file (*.sxc). I guess I only need to change the "vnd.ms-excel" with something else, but what?

Thanks a lot for any help and bye.

spoody_goon 12-10-2005 10:08 PM

Wouldn't it be easier to just stay in the excel format. Do you realize Open Office has no problem reading excel sheets?
I realize I didn't answer you question, but the only thing that would change would be the program you open the file with.

Just an idea

lucesei 12-11-2005 12:12 AM

Quote:

Wouldn't it be easier to just stay in the excel format. Do you realize Open Office has no problem reading excel sheets?
I realize I didn't answer you question, but the only thing that would change would be the program you open the file with.
Thanks for your thoughts.
Yes, I know more than well that OO can read *.xls files. I use it both under Windows & under Linux.The reason why I want the users of my script to be able to save data as an OO calc file, is a matter of coherency. Excel format is Ok when you want to save data to a Windows box, but if you are using Linux, then what is the point of saving a file in a format that has nothing to do with this OS? Any other program that runs under Linux would be fine, I just chose OO since it's the (I think?) most widely used. Following your idea and to make an example, why bother compressing data as tar, gzip, bzip, etc, etc... when Linux can also work with Windows 'zip' files? Simply because any method of compression is better than the old 'zip'? Well, OO calc is also better than Excel... Let's all forget any other method of compression and use the Windows standard! I'm sure you agree with me that this isn't the right way of behaving.

Anyway, the truth is, that I have spent hours searching Google without going anywhere, I have left messages for help in all the on-topic forums I know of, and after a week, noone has still been able to give me an answer. As a matter of fact, I especially thank you because you have been the only one to have at least said something.

I think I'll write a mail to the OO programmers, the only alternative there's left.

Bye bye

lucesei 12-11-2005 12:28 AM

Oh, by the way, some smart ass who knows how to search Google WAY BETTER than me, has just come up with the answer:
PHP Code:

header('Content-type: application/vnd.sun.xml.calc'

Just in case someone was curious.


All times are GMT -5. The time now is 12:23 AM.