Exporting data from php page to word document
Posted
by udaya
on Stack Overflow
See other posts from Stack Overflow
or by udaya
Published on 2010-03-29T05:21:12Z
Indexed on
2010/03/29
5:23 UTC
Read the original article
Hit count: 404
php
|codeigniter
Hi
I exported data from php page to word document but the problm is the header is not available in all pages
I got the same problem while i am exporting the datas to pdf but i got the result for that one by using fpdf library
In pdf i got the results like this
ex page1
slno name
1 udaya
2 sankar
In page 2
slno name
3 chendu
4 Akila
I want the same kind of result in word how to get that
This is the function i used
function changeDetails()
{
$bType = $this->input->post('textvalue');
if($bType == "word")
{
$this->load->library('table');
$data['countrytoword'] = $this->AddEditmodel1->export();
$this->table->set_heading('Name','Country','State','Town');
$out = $this->table->generate($data['countrytoword']);
header("Content-Type: application/vnd.ms-word");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-disposition: attachment; filename=$cur_date.doc");
echo '
';
echo 'CountryList
';
print_r($out);
}
}
© Stack Overflow or respective owner