90c89d9d by G Manojkumar

resolved unable to download empty campaign data

1 parent 0554d6f7
......@@ -141,7 +141,6 @@ foreach($usersarr as $r => $userdata)
$ppldata[]=unserialize($userdata['peopledata']);
}
// dd($ppldata);
for ($i=0; $i <count($ppldata) ; $i++) {
for ($j=0; $j <count($finputarr) ; $j++) {
......@@ -171,7 +170,6 @@ if ($ppldata[$i] != false){
$headerexcel[$cachekey] = 'string'; //$headerexcel2[] = $cachekey => 'string';
}
}
// dd($headerexcel2);
$filename = "MainReport.xlsx";
header('Content-disposition: attachment; filename="'.XLSXWriter::sanitize_filename($filename).'"');
header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
......@@ -183,11 +181,12 @@ if ($ppldata[$i] != false){
$styles1 = array( 'font'=>'Arial','font-size'=>10,'font-style'=>'bold', 'fill'=>'#eee', 'halign'=>'center', 'border'=>'left,right,top,bottom');
$writer->writeSheetHeader('Sheet1', $headerexcel,$styles1,['freeze_rows'=>1, 'freeze_columns'=>1]);
$writer->writeSheetRow('Sheet1', $selectedfields,$styles1 );
if($usersdata != null){
foreach($usersdata as $row)
{
$writer->writeSheetRow('Sheet1', $row, $row_options = ['height'=>15]);
}
}
$writer->writeToStdOut();
return;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!