Download the PHP package lab36/excel-report without Composer

On this page you can find all versions of the php package lab36/excel-report. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package excel-report

ExcelReport

Latest Version on Packagist Total Downloads

This package allows you to generate Microsoft Excel files from any collection or array. You can easily apply formatting, styles or themes. It comes bundled with beautiful themes ready to use.

This php library is a wrapper around PhpSpreadsheet library.

Motivation

We needed to export beautiful excel reports and with as little boilerplate as possible. PhpSpreadsheet does a good job working with excel files and we needed something on top just to avoid the repetitive work.

✨ Features

Basic Usage

Just create a file in anywhere in your app folder or use an artisan command:

This by default will create the file ProjectDetailsExcelReport.php with folder app\ExcelReport.

In your controller:

For more examples follow this link.

Installation

You can install the package via composer:

and then publish the config

Options

First thing you need the ExcelReport file. It's just a php class that extends ExcelReport. You can use

Column mappings

The ExcelReport file must have a columnMappings function. This function maps array/collection values to Spreadsheet columns.

Exemple: Let's say we have an array

the columnMappings function would be:

columnMappings values would become the header for the excel report. If you want to ignore a column from the array just omit it from columnMappings. You can also use translations here.

Column alignment

By default PhpSpreadsheet does a good job aligning data. If you want to provide some exceptions you can implement columnAlignment function and specify the alignment.

Possible values:

You can specify only the columns for which you need to change the alignment.

Column formats

You can specify column formats by implementing the function columnFormats

You can also specify any PhpSpreadsheet format by using the function addColumnFormats(), which will merge default formats with the one specified.

Column width

You can define any custom column width in character units implementing the following function.

By default PhpSpreadsheet tries to guess the correct width for the column but there are cases when they become too long so we need to adjust. When a column gets smaller width, data in that column will wrap. Depending on your settings (default_row_height) rows will adjust to wrapping.

Special row positioning

You can override the default positioning for title, header and filters. For this you must call the coresponding setters.

In your Controller you can have

Choosing a theme

This package comes with two themes. The default theme is set in the config file. You can create other themes by implementing ExcelThemeInterface.

Filter reports

This filters represent the values used to obtain data for the report. If the filter doesn't have a corresponding column it will appear after the last column.

Filters are an array in form:

[column_name => filter_value, ...]

Download/store

You can choose to download or store on the server the created file. You can provide the file name to be used.

To store the file you must specify the path

OverrideCell

To override any cell of the report you can implement the overrideCell method in you ExcelReport file with the following parameters:

Here you can override data, formatting, styling, alignment, etc. You can use any PhpSpreadsheet function available for the active sheet.

If you are not using a flat array with overrideCell you can pick the values that you want to appear in your cell. You can check the example here.

Config file

In the config file you can define

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of excel-report with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
illuminate/support Version ^5.7|^5.8|^6.0|^7.0|^8.0
phpoffice/phpspreadsheet Version ^1.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lab36/excel-report contains the following files

Loading the files please wait ....