maatwebsite-excel

How to design excel sheet using maatwebsite in laravel

橙三吉。 提交于 2020-01-04 23:06:38
问题 I have exported excel CSV file using maatwebsite package in laravel . But when I export it, it's show the raw data, how can I design this excel for show every data separately with it's title. Here, is my exported data image link. http://prntscr.com/i08up8 Here is excel export code. public function export() { $items = DB::table('userinformations') ->join('users', 'userinformations.user_id', '=', 'users.id') ->select('userinformations.fname','userinformations.lname','users.email') ->where(

How do I make automatic height row based on content in the maatwebsite version 3 laravel excel?

好久不见. 提交于 2019-12-29 09:31:56
问题 I had search reference and the reference say to try like this : <?php ... class ReportExport implements ShouldAutoSize, FromView, WithColumnFormatting, WithEvents { ... public function registerEvents(): array { return [ AfterSheet::class => function(AfterSheet $event) { ... $event->sheet->getDelegate()->getRowDimension(37)->setRowHeight(-1); $event->sheet->getDelegate()->getStyle('R37:Z37')->getAlignment()->setWrapText(true); }, ]; } } I try like that, but the result like this : Should the

How to validate content of Excel file properly, when I use Maatwebsite\Excel package and it's ToCollection concern?

为君一笑 提交于 2019-12-25 01:38:37
问题 I'm trying to import new users to the system, using Maatwebsite\Excel package. Default package concern ToModel is not suitable for me, because I need to assign default role for each imported user and to send an email for him/her. I am trying to use ToCollection concern, as it is described in the last chapter of this documentation page: https://docs.laravel-excel.com/3.1/imports/validation.html . The problem is that I can't validate the contents of Excel file properly: error messages don't

Import utf-8 headings Maatwebsite Laravel

怎甘沉沦 提交于 2019-12-24 17:08:26
问题 I'm using Maatwebsite in Laravel and it's very good option for excel works but I have one problem .. I have excel sheet with arabic heading, so when I import it , it converted to understand-less english character to fit array key .. So What is the solution for my problem? 回答1: I know it's too late, but for someone else that may have the same problem, you should change the value of "heading" key to "original" in "import" array of config/excel.php file.. 'import' => [ ... 'heading' => 'original

Import utf-8 headings Maatwebsite Laravel

别说谁变了你拦得住时间么 提交于 2019-12-24 17:08:11
问题 I'm using Maatwebsite in Laravel and it's very good option for excel works but I have one problem .. I have excel sheet with arabic heading, so when I import it , it converted to understand-less english character to fit array key .. So What is the solution for my problem? 回答1: I know it's too late, but for someone else that may have the same problem, you should change the value of "heading" key to "original" in "import" array of config/excel.php file.. 'import' => [ ... 'heading' => 'original

Laravel excel library(Maatwebsite) : How to create a drop down list in exports

梦想的初衷 提交于 2019-12-23 07:35:20
问题 I am creating an excel template which should contain a dropdown list. I see its possible with the phpexcel library (PHPExcel Multiple Dropdown list that dependent). I was wondering if it could be done with the laravel-excel library provided by maatwebsite. I need the syntax for functions like dropdown,NamedRange, datavalidation,setFormula, etc. 回答1: public function index() { \Excel::create('file', function($excel) { require_once("/apppath//vendor/phpoffice/phpexcel/Classes/PHPExcel/NamedRange

Laravel excel library(Maatwebsite) : How to create a drop down list in exports

こ雲淡風輕ζ 提交于 2019-12-23 07:33:11
问题 I am creating an excel template which should contain a dropdown list. I see its possible with the phpexcel library (PHPExcel Multiple Dropdown list that dependent). I was wondering if it could be done with the laravel-excel library provided by maatwebsite. I need the syntax for functions like dropdown,NamedRange, datavalidation,setFormula, etc. 回答1: public function index() { \Excel::create('file', function($excel) { require_once("/apppath//vendor/phpoffice/phpexcel/Classes/PHPExcel/NamedRange

Laravel Excel html to excel conversion not working

和自甴很熟 提交于 2019-12-20 07:10:18
问题 I'm using Laravel 5.6 version and laravel-excel.maatwebsite version 3.1. I want to convert html to excel file. In official documentation they have not given enough information to convert html views to excel. I'm having hard time. Below is the Code for App\Exports\AttendanceExport <?php namespace App\Exports; use App\Models\Student\StudentAttendenceModel; use Illuminate\Contracts\View\View; use Maatwebsite\Excel\Concerns\FromView; use Maatwebsite\Excel\Concerns\FromCollection; class

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

Angular 6 CSV download

∥☆過路亽.° 提交于 2019-12-12 12:56:59
问题 I'm new to angular, currently i'm working in a project which needs an csv export. Here i'm using Angular 6 as frontend and laravel as backend This is how i wrote laravel function using mattwebsite/excel // Lead export to csv public function downloadExcel(Request $request) { $credentials = $request->only('token'); $token = $credentials['token']; $userid = $this->getUseridFromToken($token); $type = "xls"; $data = DB::table('user_mailbox AS A') ->select('A.id', 'A.name', 'A.email', 'A.phone', DB