Questions tagged [laravel-excel]

Import and export Excel and CSV files in Laravel (based on PhpSpreadsheet)

Import and export Excel and CSV files using Laravel code. Supported formats: XLSX, CSV, TSV, ODS, XLS, HTML.

Reference

563 questions
28
votes
2 answers

Reading excel file and uploading to database Laravel 5

I have this project where I should be able to upload an excel file and read the contents then upload the information to the database. So I decided to use a library to help me out which turns to be Maatwebsite/Laravel-Excel But I tried reading the…
jackhammer013
  • 2,295
  • 11
  • 45
  • 95
25
votes
7 answers

How can you include column headers when exporting Eloquent to Excel in Laravel?

I am trying to allow users to download Excel, using Laravel Excel files with product information. My current web route looks like this: Route::get('/excel/release', 'ExcelController@create')->name('Create Excel'); My current Export looks like…
Jaquarh
  • 6,493
  • 7
  • 34
  • 86
13
votes
4 answers

Class 'App\Http\Controllers\Excel' not found in Laravel

In my controller I have the code as below: Excel::create('Laravel Excel', function($excel) { $excel->sheet('Excel sheet', function($sheet) { $sheet->setOrientation('landscape'); }); })->export('xls'); In…
Lulzim
  • 547
  • 4
  • 9
  • 22
11
votes
1 answer

Ambiguous class resolution in laravel phpexcel update

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"…
Deenadhayalan Manoharan
  • 5,436
  • 14
  • 30
  • 50
8
votes
5 answers

Laravel excel get total number of rows before import

Straight forward question. How does one get the total number of rows in a spreadsheet with laravel-excel? I now have a working counter of how many rows have been processed (in the CompanyImport file), but I need the total number of rows before I…
Kaizokupuffball
  • 2,703
  • 8
  • 38
  • 58
8
votes
7 answers

How to get excel to array in maatwebsite

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…
Niklesh Raut
  • 34,013
  • 16
  • 75
  • 109
8
votes
1 answer

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

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…
jones
  • 1,423
  • 3
  • 35
  • 76
8
votes
2 answers

Insert image with Laravel-Excel

I'm using this package to generate excel documents with Laravel: https://github.com/Maatwebsite/Laravel-Excel However, documentation doesn't say anything about inserting images from files into my excel document. I'm pretty sure it's possible with…
Boring person
  • 443
  • 1
  • 5
  • 12
7
votes
1 answer

Call to a member function all() on array laravel excel

i'm using laravel maatwebsite excel, i tried passing variable and do some action and return as array to export, So i get the Error when i tried to pass array to the main controller for excel export(download) my main controller public function…
teenage vampire
  • 339
  • 1
  • 5
  • 13
7
votes
3 answers

How do I enable error reporting in Laravel?

I'm using Laravel 5.2 and I'm trying to import an excel sheet which contains more than 18000 records. the error below appeared. The localhost page isn’t working localhost is currently unable to handle this request. HTTP ERROR 500 I tried to…
Mohamed Shawky
  • 807
  • 2
  • 8
  • 14
7
votes
1 answer

PHPExcel how to set collapse and expands for groups of row?

Suppose I want to set collapse and expand for row 2 up to 4 as one group, and 8 up to 12 the second group. It means when user want to click on expand + icon of group 1, rows from 2 up to 4 should be visible, and for group 2 row from 8 up to 12…
jones
  • 1,423
  • 3
  • 35
  • 76
7
votes
4 answers

Laravel Excel , exporting from a model, styling issues

I am trying to export some data from my model to excel scheet with "Laravel excel", I have done it, but my result is far away from what I really need That is what I`ve got in downloaded file: And that is what i really want to accomplish: My…
Zanshin13
  • 980
  • 4
  • 19
  • 39
6
votes
1 answer

How Can I set dynamic number format with separator in laravel excel maatwebsite?

I have an amount column and I want to set integer format when the number does not have a decimal and double format when the number has a decimal. in both ways, I want to add separators to numbers. currently, I use bindValue but excel cells don't…
6
votes
1 answer

Laravel excel add complex headers to an export

I need to export a sheet with a complex heading via Laravel Excel. I need a main heading and another sub-level heading after. I'm trying like this, use Maatwebsite\Excel\Concerns\FromQuery; use Maatwebsite\Excel\Concerns\WithHeadings; class…
vimuth
  • 5,064
  • 33
  • 79
  • 116
6
votes
5 answers

PhpOffice\PhpSpreadsheet\Reader\Exception Failed to load .... as a DOM document

When I try to export datas as excel file on the specific request I got below error PhpOffice\PhpSpreadsheet\Reader\Exception Failed to load path_to_project\storage\framework\laravel-excel\laravel-excel-pz23rYwVENIOZUw7vnvhKaNjUkkNLNT8.html as a DOM…
Vpa
  • 703
  • 2
  • 9
  • 30
1
2 3
37 38