websix/xlsx-compiler

Xlsx compiler aimed in to be simple, fast and straight to the point

Installs: 28

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 0

Open Issues: 0

Language:JavaScript

1.1.3 2015-05-13 14:41 UTC

This package is auto-updated.

Last update: 2024-03-21 18:40:58 UTC


README

Build Status

Takes a JSON in format:

{
    "Sheet name": [
        {"A": "A1 Value", "B": "B1 Value"}, // Row
        ...
    ],
    ...
    "Last sheet name": [
        {"A": "A1 Value", "B": "B1 Value"} // Row
    ],
    "maxCols": 2 // Max number of columns to be presented in the sheet
}

And transforms into a .xlsx file.

Usage

Install the package:

composer require websix/xlsx-compiler

Use the XlsxCompiler class in your script:

<?php

...
uses Websix\XlsxCompiler\XlsxCompiler;

...
$compiler = new XlsxCompiler();

// Generate $json in the shown format before

$xlsx = $compiler->compileJson($json);

// In $xlsx you have the fileblob tha you can save into a .xlsx file or echo in
// the output for browser download

API

Namespace: Websix\XlsxCompiler;

Class name: XlsxCompiler

#compileJson($json) -> blob

Pass in $json a JSON formatted as above and the result will be the xlsx blob