php - Failed to open stream: HTTP request failed!? -
i need here, http request failed error give me lot of headache. try in local server , online server still didn't work, trying export table data .pdf or .xls format. controller.
public function export() { $format = input::query('type'); $filename = carbon::now()->format('ymd_') . "productslist"; $file = excel::create($filename, function ($excel) { $excel->sheet('product cost , amount', function ($sheet) { $sheet->setfittopage(0); $sheet->setfittowidth(0); $sheet->setfittoheight(0); $sheet->freezefirstrowandcolumn(); $sheet->setorientation('landscape'); $products = $this->report->getproductlevels(); $sheet->loadview('reports.product_report.product_level_report', compact('products')); }); $excel->sheet('product locations', function ($sheet) { $sheet->setfittopage(0); $sheet->setfittowidth(0); $sheet->setfittoheight(0); $sheet->freezefirstrowandcolumn(); $products = $this->report->getproductlevels(); $sheet->loadview('reports.product_report.product_warehouse_level', compact('products')); }); });
this views
<html> {{ html::style('dist/css/table.css') }} <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <body> <!-- headings --> <thead> <tr> <th>#</th> <th>product name</th> <th>amount</th> <th>reorder amount</th> <th>unit cost</th> <th>selling cost</th> <th>tax rate</th> <th>category</th> </tr> </thead> <?php $i = 1; ?> @foreach($products $product) <tr> <td scope="row">{{$i}}</td> <td><b>{{$product->productname}}</b></td> <td>{{$product->amount}}</td> <td>{{$product->reorderamount}}</td> <td>{{$product->unitcost}}</td> <td>{{$product->sellingcost}}</td> <td>{{$product->producttaxrate}}%</td> <td>{{$product->categoryname}}</td> </tr> <?php $i++; ?> @endforeach </body> </html>
i'm stuck in few hours , still can't solve this. i'm glad if willing me, thank attention
Comments
Post a Comment