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/");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

now in linux
im using Calc and writter so how can i do that
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.

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:
i think that was not solu bcz in wondows v write
header("Content-Type: application/");
that is for microsoft excel but in llinux we r using Calc so what should be written in that place
JavaScript Best Practices

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

maybe these ones:

I convert into excel all the time.  I found my answer in a pear module.

It is absolutely excellent and very easy to work with.

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


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

    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;

When i run this code in windows and write header("Content-type: application/"); 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.
did you try this?

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
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.
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.

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

From novice to tech pro — start learning today.