Php 无法打开流:HTTP请求失败!?
我需要一些帮助,这个HTTP请求失败的错误让我很头疼。我尝试在本地服务器和在线服务器,但仍然没有工作,我试图将我的表数据导出为.PDF或.XLS格式。这是我的控制器Php 无法打开流:HTTP请求失败!?,php,laravel,laravel-5.2,Php,Laravel,Laravel 5.2,我需要一些帮助,这个HTTP请求失败的错误让我很头疼。我尝试在本地服务器和在线服务器,但仍然没有工作,我试图将我的表数据导出为.PDF或.XLS格式。这是我的控制器 public function export() { $format = Input::query('type'); $filename = Carbon::now()->format('Ymd_') . "ProductsList"; $file = Excel::create($filename,
public function export()
{
$format = Input::query('type');
$filename = Carbon::now()->format('Ymd_') . "ProductsList";
$file = Excel::create($filename, function ($excel) {
$excel->sheet('Product Cost and 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'));
});
});
这是我的看法
<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 as $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>
{{HTML::style('dist/css/table.css')}
#
品名
数量
再订购量
单位成本
销售成本
税率
类别
@foreach($products as$product)
{{$i}
{{$product->productName}
{{$product->amount}
{{$product->reorderAmount}
{{$product->unitCost}
{{$product->销售成本}
{{$product->productTaxRate}}
{{$product->categoryName}
@endforeach
我在几个小时内就遇到了这个问题,但仍然无法解决这个问题。如果有人愿意帮助我,我很高兴,谢谢你的关注我看不出你在哪里提出HTTP请求。加载任何网页都是一个请求,Halcyon。你能添加日志文件中的内容吗?
公共函数导出()
似乎与我无关。它不在任何地方使用,也没有任何明显的副作用。@apokryfos这是我的日志文件,我使用Maatwebsite导出.xls和.pdf文件。