Convert file into excel and word in linux

hi ,
i want to convert my file into excel and word format in linux how can i do that.
whe i used to work in windows i was doing like
inmy file i.e
header("Content-Type: application/vnd.ms-excel");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

now in linux
im using OpenOffice.org Calc and writter so how can i do that
thanx
nishu883Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

WoodyRoundUpCommented:
i think it's the same.
i use both of these to create csv file.
but, i am not sure about excel. did you try it and it failed?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nishu883Author Commented:
hi,
i think that was not solu bcz in wondows v write
header("Content-Type: application/vnd.ms-excel");
that is for microsoft excel but in llinux we r using OpenOffice.org Calc so what should be written in that place
Thanx
WoodyRoundUpCommented:
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

WoodyRoundUpCommented:
maybe these ones:

application/vnd.oasis.opendocument.spreadsheet        
joshlrogersCommented:
I convert into excel all the time.  I found my answer in a pear module.

http://pear.php.net/package/Spreadsheet_Excel_Writer

It is absolutely excellent and very easy to work with.

Good Luck!
Josh Rogers
nishu883Author Commented:
hi,
Thanx for the excellent support,
But my code is not working.
Actually my code is lik this
tabexcel.php
<html>
      <head>
            <title> excel File</title>
            <script language="javascript">
            function code(){
                  
                  document.test.action = "test.php";
                  document.test.submit();
            }
            
            </script>
      </head>
      <body>
            <form name="test">
            
            <input name="Generate" type="button" value="Generate" onClick="javascript:code();">
            </form>
            
            </body>
            </html>

test.php

<?php
$query = "select firstname,lastname,salary from trainee_emp";
      $db_conn = ocilogon( "..", "..", "..." );
      $parsed = ociparse($db_conn, $query);
      ociexecute($parsed);
      $nrows = ocifetchstatement($parsed, $result);
$data = "FIRSTNAME\tLASTNAME\tSALARY\n";   //This is use to make column title

if($nrows!=0){
    for ($i = 0; $i < $nrows; $i++ ){
     $fn = $result["FIRSTNAME"][$i];
     $ln  = $result["LASTNAME"][$i];
     $sal = number_format($result["SALARY"][$i],   2);

        $data .= "$fn\t$ln\t$sal\n";  // This will generate data into csv format
       
    }
}
header("Content-type: application/vnd.sun.xml.calc");
   //header("Content-disposition: csv.xls");
   print $data;
   exit;  
?>

When i run this code in windows and write header("Content-type: application/vnd.ms-excel"); it works properly but when i run it n linux and write header("Content-type: application/vnd.sun.xml.calc");
it doesnt work so pl tell me what is d solution.
thanx
WoodyRoundUpCommented:
did you try this?

application/vnd.oasis
nishu883Author Commented:
ya i even try that thing  llike header("Content-type: application/vnd.oasis.opendocument.spreadsheet");
but it didnt work
so any other solu.
Is there any mistake in my code
pl let me know
thanx
WoodyRoundUpCommented:
i mean, without the opendocument.spreadsheet?
just vnd.oasis?

if it works in windows,it shall work in Linux. There should not be any code problem.
hujiCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I will leave the following recommendation for this question in the Cleanup topic area:
Split: WoodyRoundUp & joshlrogers

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Huji
EE Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.