nishu883
asked on
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
maybe these ones:
application/vnd.oasis.open document.s preadsheet
application/vnd.oasis.open
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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\tSALA RY\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["SAL ARY"][$i], 2);
$data .= "$fn\t$ln\t$sal\n"; // This will generate data into csv format
}
}
header("Content-type: application/vnd.sun.xml.ca lc");
//header("Content-disposit ion: 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.ca lc");
it doesnt work so pl tell me what is d solution.
thanx
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,
$data = "FIRSTNAME\tLASTNAME\tSALA
if($nrows!=0){
for ($i = 0; $i < $nrows; $i++ ){
$fn = $result["FIRSTNAME"][$i];
$ln = $result["LASTNAME"][$i];
$sal = number_format($result["SAL
$data .= "$fn\t$ln\t$sal\n"; // This will generate data into csv format
}
}
header("Content-type: application/vnd.sun.xml.ca
//header("Content-disposit
print $data;
exit;
?>
When i run this code in windows and write header("Content-type: application/vnd.ms-excel")
it doesnt work so pl tell me what is d solution.
thanx
did you try this?
application/vnd.oasis
application/vnd.oasis
ASKER
ya i even try that thing llike header("Content-type: application/vnd.oasis.open document.s preadsheet ");
but it didnt work
so any other solu.
Is there any mistake in my code
pl let me know
thanx
but it didnt work
so any other solu.
Is there any mistake in my code
pl let me know
thanx
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.
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.
Huji
EE Cleanup Volunteer
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
ASKER
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