You do not need a huge library to export excel. You can create an excel file almost genuine only with the correct one meta
in the html file.
You will need to include something like this in your header:
<html xmlns:x="urn:schemas-microsoft-com:office:excel">
<head>
<meta charset="UTF-8">
...
The full code I'm using is below. Based on what is written there, most likely, this code will not work in earlier versions of MS Office. Please note that this is a type of blade.
<html xmlns:x="urn:schemas-microsoft-com:office:excel">
<head>
<meta charset="UTF-8">
</head>
<body>
<table>
@if(!empty($thead))
<thead>
{!! $thead !!}
</thead>
@endif
@if(!empty($tbody))
<tbody>
{!! $tbody !!}
</tbody>
@endif
@if(!empty($tfoot))
<tfoot>
{!! $tfoot !!}
</tfoot>
@endif
</table>
</body>
</html>
Hide result, ( colspan
rowspan
) ( , text-center
text-right
).
:
$fileName = "export.xls";
$data = View::make('export.excel.table', [
'thead' => $thead,
'tbody' => $tbody,
'tfoot' => $tfoot,
]);
return Response::make($data, 200, [
'Content-type' => 'application/excel',
'Content-Type' => 'application/excel',
'Content-Disposition' => 'attachment; filename=' . $fileName
]);
, .