resolved unable to download empty campaign data
Showing
1 changed file
with
6 additions
and
7 deletions
| ... | @@ -141,7 +141,6 @@ foreach($usersarr as $r => $userdata) | ... | @@ -141,7 +141,6 @@ foreach($usersarr as $r => $userdata) |
| 141 | $ppldata[]=unserialize($userdata['peopledata']); | 141 | $ppldata[]=unserialize($userdata['peopledata']); |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | // dd($ppldata); | ||
| 145 | for ($i=0; $i <count($ppldata) ; $i++) { | 144 | for ($i=0; $i <count($ppldata) ; $i++) { |
| 146 | 145 | ||
| 147 | for ($j=0; $j <count($finputarr) ; $j++) { | 146 | for ($j=0; $j <count($finputarr) ; $j++) { |
| ... | @@ -171,7 +170,6 @@ if ($ppldata[$i] != false){ | ... | @@ -171,7 +170,6 @@ if ($ppldata[$i] != false){ |
| 171 | $headerexcel[$cachekey] = 'string'; //$headerexcel2[] = $cachekey => 'string'; | 170 | $headerexcel[$cachekey] = 'string'; //$headerexcel2[] = $cachekey => 'string'; |
| 172 | } | 171 | } |
| 173 | } | 172 | } |
| 174 | // dd($headerexcel2); | ||
| 175 | $filename = "MainReport.xlsx"; | 173 | $filename = "MainReport.xlsx"; |
| 176 | header('Content-disposition: attachment; filename="'.XLSXWriter::sanitize_filename($filename).'"'); | 174 | header('Content-disposition: attachment; filename="'.XLSXWriter::sanitize_filename($filename).'"'); |
| 177 | header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); | 175 | header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| ... | @@ -183,11 +181,12 @@ if ($ppldata[$i] != false){ | ... | @@ -183,11 +181,12 @@ if ($ppldata[$i] != false){ |
| 183 | $styles1 = array( 'font'=>'Arial','font-size'=>10,'font-style'=>'bold', 'fill'=>'#eee', 'halign'=>'center', 'border'=>'left,right,top,bottom'); | 181 | $styles1 = array( 'font'=>'Arial','font-size'=>10,'font-style'=>'bold', 'fill'=>'#eee', 'halign'=>'center', 'border'=>'left,right,top,bottom'); |
| 184 | $writer->writeSheetHeader('Sheet1', $headerexcel,$styles1,['freeze_rows'=>1, 'freeze_columns'=>1]); | 182 | $writer->writeSheetHeader('Sheet1', $headerexcel,$styles1,['freeze_rows'=>1, 'freeze_columns'=>1]); |
| 185 | $writer->writeSheetRow('Sheet1', $selectedfields,$styles1 ); | 183 | $writer->writeSheetRow('Sheet1', $selectedfields,$styles1 ); |
| 186 | 184 | if($usersdata != null){ | |
| 187 | foreach($usersdata as $row) | 185 | foreach($usersdata as $row) |
| 188 | { | 186 | { |
| 189 | $writer->writeSheetRow('Sheet1', $row, $row_options = ['height'=>15]); | 187 | $writer->writeSheetRow('Sheet1', $row, $row_options = ['height'=>15]); |
| 190 | } | 188 | } |
| 189 | } | ||
| 191 | $writer->writeToStdOut(); | 190 | $writer->writeToStdOut(); |
| 192 | 191 | ||
| 193 | return; | 192 | return; | ... | ... |
-
Please register or sign in to post a comment