How to Apply CSS on HTML to Excel export - php

I am trying to export HTML to Excel format using php headers, but CSS styling is not applying on elements (while export to excel file), I also try to implement Bootstrap Classes, but no luck
Note: while applying bootstrap classes, I included the bootstrap.css in my html
Is there any way available to apply CSS?
Headers using
header('Content-type: application/excel');
header("Content-Disposition: attachment; filename=\"$filename\"");
Sample HTML elements
<table width="100%" border="1" class="table table-striped table-bordered">
<thead>
<tr>
<td colspan="9" style="font-weight: bold; font-size: 16px; text-align: center;"><h2>Push Notification </h2></td>
</tr>
<tr><td colspan="9"></td></tr>
</thead>
<tbody>
<tr class="heading">
<th colspan="2" ></th>
<th style="width:2% !important">S.no</th>
<th style="width:10% !important">Date</th>
<th style="width:10% !important">App</th>
<th style="width:20%">Category</th>
<th colspan="2" style="width:50%">Message</th>
</tr>
#if($push_notifications->count() > 0)
<?php $counter = 1; ?>
#foreach($push_notifications as $notification)
<tr #if(($counter %2) ==1) bcolor="#c9c9c9" #endif>
<td colspan="2"></td>
<td style="width:2% !important">{!!$counter!!}</td>
<td style="width:10% !important">{!!$notification->date!!}</td>
<td style="width:10% !important">{!!$notification->notificationAppType->name!!}</td>
<td style="width:20%">{!!$notification->notificationCategory->name!!}</td>
<td colspan="2" style="width:50%">{!!htmlentities($notification->message, ENT_QUOTES)!!}</td>
</tr>
<?php $counter++; ?>
#endforeach
#else
<tr>
<td colspan="9">No record available</td>
</tr>
#endif
</tbody>
</table>

Short answer is no, you can't apply css to excel.
You can, however, apply some formatting to the text of excel files, but the amount of formatting is limited by the library you use to generate the excel file and to what formatting the excel itself permits.

Related

Why datagrid_data1.json data can not appear

In my project, i use easyui-datagrid.
Here is my html code:
<tr>
<td style="width:10%" colspan="2">attachment</td>
<td style="width:90%" colspan="18">
<table class="easyui-datagrid" data-options="url:'datagrid_data1.json',method:'get'" title="" style="width:100%">
<thead>
<tr>
<th data-options="field:'ck',checkbox:true"></th>
<th data-options="field:'name',align:'center'">filename</th>
</tr>
</thead>
</table>
</td>
</tr>
The code of datagrid_data1.json:
{"total":2,"rows":[
{"name":"1.jpg"},
{"name":"123.jpg"}
]}
But unfortunately, I works fail. Two names of 1.jpg and 123.jpg can not appear. Who can help me?

How can I set name to excel sheet in PHP?

Am generating .xls file with <table> tags. Export is working fine. Now I have to set the name for the sheet.
Code is as follows:
<h2>==>> Export Table into Excel file <<==</h2>
<?php
echo $excel_data = '<table border="1">
<thead>
<th width="1"></th>
<th align="left">S.No.</th>
<th align="left">Name</th>
<th align="left">DOJ</th>
</thead>
<tbody>
<tr>
<td width="1"></td>
<td align="left">1</td>
<td align="left">Sreekanth Kuriyala</td>
<td align="left">04-06-2015</td>
</tr>
<tr>
<td width="1"></td>
<td align="left">2</td>
<td>SK1</td>
<td align="left">26-07-2015</td>
</tr>
<tr>
<td width="1"></td>
<td align="left">3</td>
<td> SK2</td>
<td align="left">26-07-2015</td>
</tr>
</tbody>
</table>';
$excel_file = 'report.xls';
file_put_contents ($excel_file, $excel_data);
?>
</br>
</br>
<a href="<?php echo $excel_file; ?>" download>Export to Excel</a>
Can anyone help me on this. Thanks in advance.
For that you have to follow/generate Excel file content structure instead of table structure.
You can use PHP library for Excel file generator. There are many PHP library available you can googling it. Some of are
PHPExcel
SimpleExcel PHP
Pear Excel Writer
Excel Writer(XML) for PHP
Thanks.

How to create an html link to another page from "<?=$objResult["id"];?>"

I'm working on a php/mysql application and need to make the output of one column, one row an html link to another html page. Have not been able to find any relavant information. The "" needs to be the link. Thanks for any help.
<table id="display" style="width:800px;">
<tr>
<th width="40">ID</th>
<th width="70">Last</th>
<th width="70">First</th>
<th width="10">Middle</th>
<th width="70">Birth</th>
<th width="70">Death</th>
<th width="170">Notes</th>
<th width="100">Cemetery</th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td style='text-align:center;'><?=$objResult["id"];?></td>
<td style='text-align:center;'><?=$objResult["last"];?></td>
<td style='text-align:center;'><?=$objResult["first"];?></td>
<td style='text-align:center;'><?=$objResult["middle"];?></td>
<td style='text-align:center;'><?=$objResult["birth"];?></td>
<td style='text-align:center;'><?=$objResult["death"];?></td>
<td><?=$objResult["notes"];?></td>
<td style='text-align:center;'><?=$objResult["cemetery"];?></td>
</tr>
<?
}
?>
</table>

Prevent table resizing in PDF

I'm using mpdf to generate PDF from a form. In form I have an option to adding new rows to table. The problem is when count of rows is too big for generated PDF page. Then the table is resizing (it's smaller) instead of going to the next page.
This is mpdf code:
$mpdf=new mPDF('UTF-8','A4','','',20,15,48,25,10,10);
$mpdf->WriteHTML(generatePDF());
$mpdf->Output();
exit;
This is html table code:
function getHTMLStyle(){
$html ='<table class="items" width="100%" style="font-size: 9pt; border-collapse: collapse;" cellpadding="8">
<tr>
<td width="5%">A</td>
<td width="95%"><b>'.$a.'</b><br /><br /> '.$_POST['title'].'</td>
</tr>
<tr>
<td >B</td>
<td ><b>'.$b.'</b><br /><br /> '.$_POST['organizationName'].'</td>
</tr>
<tr>
<td >C</td>
<td></td>
<table class="items2" width="100%" page-break-before="always" >
<tr>
<td ><b>'.$c.'</b></td>'.addTableC().'
</tr>
</table>
</tr>
This is image with property view:
And this is an amage with wrong view:
How can I make a break in table and continue to another side?
Because you're incorrectly nesting tables -
<tr>
<td >C</td>
<td></td>
<table class="items2" width="100%" page-break-before="always" >
<tr>
<td ><b>'.$c.'</b></td>'.addTableC().'
</tr>
</table>
</tr>
The table should be inside the <td> tag, like so:
<tr>
<td>C</td>
<td>
<table class="items2" width="100%" page-break-before="always" >
<tr>
<td ><b>'.$c.'</b></td>'.addTableC().'
</tr>
</table>
</td>
</tr>

How do I export data and a base64 image to excel using PHP?

I'm trying to export the following to excel but the image is not coming through.
Example:
$today = date("d/m/y : H:i:s", time());
header ("Content-Type: application/x-msexcel");
header ("Content-Disposition: attachment; filename=\"export.xls\"" );
echo '
<table>
<tr>
<th nowrap="nowrap">Client ID</th>
<th nowrap="nowrap">Client Name</th>
<th nowrap="nowrap">No. of Staff</th>
<th nowrap="nowrap">No. of Events</th>
<th nowrap="nowrap">Fail all\'s</th>
<th nowrap="nowrap">Fail Section</th>
<th nowrap="nowrap">Fail all %</th>
</tr>
<tr>
<td nowrap="nowrap">8</td>
<td nowrap="nowrap">SEAI</td>
<td nowrap="nowrap"><div> 17 </div></td>
<td nowrap="nowrap"><div> 354 </div></td>
<td nowrap="nowrap"><div> 7 </div></td>
<td nowrap="nowrap"><div> 0 </div></td>
<td nowrap="nowrap"><div> 1.98% </div></td>
</tr>
</table>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA24AAAEsCAYAAAC7XuApAAAWw0lEQVR4nO3dT2scd57HcV/yiHKf257mT47zDPoQMAOzLJNkyBwNjcH4kmXsTMbgPmgV55SsmxmoYE1AMPgQDTQdCAi0B8HQGpCRs7HJzsB3D6Y61a1qqaXq+qm6fq8XvCFWWq1SLs6Hqq669fbgwVu/+OCzT3723qevf/fHr84efP71650vv4n/kiRJkiQlbefLb+LB51+//t0fvzr76W8+ff3O+589fHvw4K1b77z/5Pf/8Z9ffv/dqx8CAACAbnj5/Q/x64+K79/54MlHt37+3pNX//v6/276mAAAAFjy3asf4mfvffr61oeffPXypg8GAACAer/9+C8vb/3hi4N/3fSBAAAAUO/B5wf/vPX4T5ObPg4AAABWePynSRhuAAAAHWa4AQAAdJzhBgAA0HGGGwAAQMcZbgAAAB1nuAEAAHSc4QYAANBxhhtATz0Z78VPfvmrcz0Z7135vf568E385Je/ir8efNPCkV5deTzVVh3b8mtX/f5171l2/Pd/XPnYqsfTtf9+AGwfww2gp8rhVh0d5ddSDohNj5a7D3fP/V7Hf/9H/OSXv4q7D3fPvX7V11cd51VG2roMNwCaMtwAeqpuuEWsP2Q2ZZOjZdXvFPHjeKueUav72mXHabgB0EWGG0BPrTvcynFz0aWBdcOj+v7VyzKr7113uWb1PcqzZ+tekvjuh/cvHJ13H+7Gux/eXzjmdS8TXXe4Lf9Oy++57qWS5ftU1Q3N6veW/72Wf+a7H95fOCYA+sdwA+ipuuG2PAzqhkLd5ZQXDY+7D3fn33+Vz3f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d3R0NH/NukPRcAMAADauHG7LLQ+3o6Ojc0NrebhF/Dj6ytGzrO61y8ezPP6WB1n1+5Zfv6zuOJZ/l93d3Tg6Opr/t3jx4sV8IJbHcHR0tPJnVBluAADAxq17xu3g4GDhTNjya5a/fnBwMD+TVVX32vKfq2fzSnWjaXnwlSOr7ufVHcfy18rfrToCq68x3AAAgBu17nCrnqWqnpkqX7P8vRedcat77fLliqV1httFX7/qGTfDDQAA6JyrfMat+lmyy864RcTC59Gqn3Fb9XPK965eTlk3msrPpx0cHCx8Dm3VsKw7jos+41Z+z7WH28MvDv651qsBAABaUjf2eOP3n3/9z1sffvLVy5s+EAAAIE+r7vzIj3778V9e3vr5e09evfz+h5s+FgAAAJZ89+qH+Pl7T17deuf9J7//94++fPXdK+MNAACgK15+/0P8+qPi+3c+ePLRrbcHD976xQefffLT33z6+v2Hey8//uLgX3/477+FJEmSJCl9H39x8K/3H+69/OlvPn39iw8+e/D24MFb/w8FVkJZAxfZ3wAAAABJRU5ErkJggg==" />
';
I have tried the following with out success:
echo file_get_contents(base64_decode($img));
With and without the tag and with and without the file_get_contents and base64_decode.
I feel that is should be possible but I'm missing something :(. Does anyone have any ideas?
Thanks!!!
From what I see, you are trying to create an excel file (XLS) keeping headers.
Headers are not enough!
You need set of libraries. I would recommend you to do use PHPExcel
You can add images easily to it. Keep this library handy! It can do many more stuff.
Once you have installed it, you can refer to this answer for more step by step instructions.
Try complete solution using PHPExcel that I also recommend for this job.
http://phpexcel.codeplex.com/discussions/271473

Categories