It is possible to create designed xls file in PHP or Laravel?

141
March 29, 2019, at 10:50 PM

I am working as a freelancer and one of my clients asked me to create designed xls file for a Laravel project.

Using Laravel and Maatawebsite for xls files I have generated a xls file using this code:

   Excel::create('extract', function ($excel) use ($data) {
        $excel->sheet('mySheet', function ($sheet) use ($data) {
            $sheet->fromArray($data);
        });
    })->download('xls');

This function is generating a xls file like this one:

Generated xls file

It is possible to generate something designed like example from bellow using PHP or Laravel?

How xls file should look like

Answer 1

Of course it is possible, but you'd have to do alot of the styling stuff in your code.

There are a couple of good Excel libraries for PHP available, f.e.

https://github.com/PHPOffice/PhpSpreadsheet

Rent Charter Buses Company
READ ALSO
how to select every 1st 2nd 3rd … nth

how to select every 1st 2nd 3rd … nth

simply i wanted to do this for a loop containts 32 items;

166
How to get data from MySQL database to a javascript file of a GitHub repo?

How to get data from MySQL database to a javascript file of a GitHub repo?

I'm creating an ecommerce website for a vinyls store, and as a feature, I want to use this GitHub repo that I found called cratediggerjs, which simulates a crate wherein you can virtually "dig" through vinyl records

175
Auto provide routes to symfony from vendor bundle

Auto provide routes to symfony from vendor bundle

I'm wondering if there is a way to create a Symfony 4 bundle (will be used as a vendor in another Symfony 4 project) which will automatically provide routes and therefore nobody will needs to register the bundle's routes manually to the project?

126
Issue saving PDF file using TCPDF

Issue saving PDF file using TCPDF

I want to save some html to pdf file on a button clickThe problem is that I get the issue after the ajax call:

178