Welcome Guest, Not a member yet? Register   Sign In
[Export to Excel 2013]Popup when open exported file.
#1

I have been using "Export to excel 2013" plugin from this link:  https://github.com/bcit-ci/CodeIgniter/w...Excel-2013.
The exported file can be normally opened but the popup as below appears.
   

So sorry because it is Japanese but the meaning is something like "File xxx.xls's format and extension does not match.Whether the file is corrupted, it might not be safe. If the publisher can not be trusted, please do not open this file. Do you want to open a file?"

Can we turn off this popup?
And if I want to export .csv (not .xls), how to set the header?

Thanks and regards!
Reply
#2

or you can use this https://github.com/faisalman/simple-excel-php
Reply
#3

to export the data from mysql to excel in codeigniter much similar to PHP. here is the example you can see simple method.

how to export data from MySQL to excel using PHP
Reply
#4

If just CSV, it would be simpler to use php's fputcsv function like this:

Code:
$filename = "file.csv";
header('Content-Type: application/csv');
header('Content-Disposition: attachment; filename="'.$filename.'";');
$handle = fopen('php://output', 'w'); 
foreach ($rows as $row) {
    fputcsv($handle, $row);
}
Reply
#5

(02-19-2018, 03:38 AM)ehtesham Wrote: codeigniter much similar to PHP

I'm sick of seeing this. It's not like everybody is saying it, but it is how everybody acts.

It's all PHP people. Stop looking for "how to do X in framework Y"; if you know how to do it in pure PHP - that's how you do it.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB