laravel-excel

How can I make default page number to every sheet on maatwebsite?(laravel-excel)

混江龙づ霸主 提交于 2019-12-17 21:18:30
问题 I use laravel 5.6, php 7.1 and maatwebsite 3.1 My script to display page number like this : $event->sheet->getHeaderFooter()->setOddFooter('&R&P'); It works. But my problem is I have 3 sheet. On the every sheet display page number start of 1 I want in the sheet 1, it display page number 1-3. In the sheet 2, it will display page number 4-6. And the sheet 3, it display page number 7-9 I want like that. I had searching reference, but I don't find it Please help me to solve this problem. I need

Laravel Excel is converting dates from heading into some numbers

浪子不回头ぞ 提交于 2019-12-11 07:31:47
问题 I have a problem which is connected with Laravel Excel. I have heading filled with dates for example: 2018-05-23. But when I read it with excel extension by using: $data = Excel::load($request['file'], function($reader) {})->get(); The extension is not treating the heading dates as dates. Instead of that it converts the dates into some numbers - for example: 43243 . Here is dd of the sheet: Important note: When the date is in a normal row (not in heading) then the date is converted well.

Laravel Excel Download using Controller

吃可爱长大的小学妹 提交于 2019-12-10 18:04:27
问题 So I created a PHP Controller to handle exporting data which is posted by JS. The problem is I can see it creates something in the console but the file download never starts. I tried using ->store (laravel excel) and keeping it in an export folder but again when I try to use return \Response::download($result); it still won't start the download. The problem I'm having is just getting the download to start. Angular Controller $scope.exportMatrix = function () { var postData = {list: $scope

Laravel Excel: how to get value of a cell?

血红的双手。 提交于 2019-12-10 15:19:39
问题 I've loaded .xls file with Laravel Excel: Excel::load('public/files/20160621.xls', function($reader) { // read a cell value }); How do I read values of cells of the loaded excel file? Documentation seems to be unclear on that part. 回答1: public function get() { $excelFile ... return Excel::load($excelFile, function($doc) { $sheet = $doc->getSheetByName('data'); // sheet with name data, but you can also use sheet indexes. $sheet->getCell('A1'); $sheet->getCellByColumnAndRow(0,0); }); } You're

How to get excel to array in maatwebsite

南楼画角 提交于 2019-12-10 07:14:39
问题 I am trying to convert an Excel file to an array using the latest version of Laravel-Excel (3.1.9) The code below will download the file: return Excel::download(new SalesOrderExport('columns'),'test.xlsx') But I need to convert it to get an array only. I don't want to store this Excel data in a database at this point. I tried with the code below but it did not work as the load method is not available in version 3. Excel::load($request->file('sampledata'), function ($reader) { return response(

How can I pass parameter in the laravel excel?

青春壹個敷衍的年華 提交于 2019-12-07 18:28:17
问题 I get tutorial from here : https://laravel-excel.maatwebsite.nl/docs/3.0/export/basics <?php ... use App\Exports\ItemsDetailsExport; class ItemController extends Controller { ... public function exportToExcel(ItemsDetailsExport $exporter, $id) { //dd($id); I get the result return $exporter->download('Summary Detail.xlsx'); } } My export like this : <?php namespace App\Exports; use App\Repositories\Backend\ItemDetailRepository; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite

Laravel Excel how to load a view to specific row or cell?

末鹿安然 提交于 2019-12-05 04:06:37
I'm using Laravel Excel, I want to load a view file and set it to specific row. Is it possible to do it with laravel excel? bellow is the code for loading view in to the sheet: Excel::create('New file', function($excel) { $excel->sheet('New sheet', function($sheet) { $sheet->loadView('folder.view'); }); }); It seems like the package doesn't offer that I this time but maybe you could do something like this. Create a wrapping view that you can pass some parameters to, such as a target row number, column number and inner view to include. Excel::create('New file', function($excel) { $excel->sheet(

Ambiguous class resolution in laravel phpexcel update

北战南征 提交于 2019-12-05 01:33:14
I try to update the laravel with php excel while installing i found the below warning in the composer. Error: Warning: Ambiguous class resolution, "SettingsController" was found in both "C:\xampp\htdocs\mti\app\controllers\SettingsController.php" and "C:\xampp\htdocs\mti\app\controllers\SettingsControllerBackup.php", the first will be used.Warning: Ambiguous class resolution, "ClassModel" was found in both "C:\xampp\htdocs\mti\app\models\ClassModel.php" and "C:\xampp\htdocs\mti\ app\models\LoginModel.php", the first will be used. SettingsController: <?php class SettingsController extends

Laravel excel 3.1 add extra rows betweem iterations

老子叫甜甜 提交于 2019-12-02 15:52:42
问题 Sorry for my english. I have one to many relationship between two tables one is "alquileres" (rents) and the other is "cobros" (payments). I need to show the totals of each rental like this: what i need But obtain this: result This is the code of my export: class ComprobantesExport implements FromCollection, WithMapping, WithHeadings, ShouldAutoSize, WithEvents { use Exportable, RegistersEventListeners; protected $alquileres; public function __construct($alquileres = null) { $this->alquileres

Laravel excel 3.1 add extra rows betweem iterations

岁酱吖の 提交于 2019-12-02 09:08:11
Sorry for my english. I have one to many relationship between two tables one is "alquileres" (rents) and the other is "cobros" (payments). I need to show the totals of each rental like this: what i need But obtain this: result This is the code of my export: class ComprobantesExport implements FromCollection, WithMapping, WithHeadings, ShouldAutoSize, WithEvents { use Exportable, RegistersEventListeners; protected $alquileres; public function __construct($alquileres = null) { $this->alquileres = $alquileres; } /** * @return \Illuminate\Support\Collection */ public function collection() { return