0.1.2 • Published 6 months ago

@smarterp/excel v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

SmartERP Excel

Exmaple

Import on resource/js/app.js

import { SmartExportExcel } from "@smarterp/excel"

export default {
    ...
    SmartExportExcel
}

Simple HTML

<!DOCTYPE html>
<html lang="en">
<body>
    <table id="studentList">
        <thead>
            <tr>
                <th>No</th>
                <th>Name</th>
                <th>Gender</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>1</td>
                <td>Danit</td>
                <td>Male</td>
            </tr>
            <tr>
                <td>2</td>
                <td>Lyly</td>
                <td>Female</td>
            </tr>
        </tbody>
    </table>
    <button type="button" onclick="exportExcel()">Export</button>

    <script>
        function exportExcel () {
            const options = {
                filename: 'Excel',
                selector: '#studentList',
                title: 'Student List',
                titleKh: 'បញ្ជីសិស្ស',
                dateFrom: '15-11-2023',
                dateTo: '30-11-2023',
            };
            new SmartExportExcel(options);
        }
    </script>
</body>
</html>

Uage Option

OptionDescriptionDefault Value
selectorRequire table (class, id, attr, tag) you want to exportnone
fileNameSet excel file nameExcel
sheetNameSet excel sheet namefileName
titleSet header titlefileName
titleKhSet header Khmer titlenone
subtitleSet header Subtitlenone
dateFromSet date from in headernull
dateToSet date to in headernull
customDateCustomize date you want (HTML, CSS)null
extensionSet excel extension.xls
selectShow or hide select tag when exporttrue
checkboxShow or hide checkbox when exporttrue
fontSizeSet excel font size15px
fontHeadEnSet excel header font-family titleTimes New Roman
fontHeadKhSet excel header font-family Khmer titleKhmer OS Muol Light
removeCellRemove item(s) with (class, id, attr, tag)none
zoomSet zoom percent when export100
image{src}Set header image urlnone
image{width}Set header image width133
image{height}Set header image heightauto
image{alt}Set header image altTurbotech
borderSet table border width (thin, 1px, etc)none
borderStyleSet table border style (solid, dotted, double, etc)none
borderColorSet table border color (rgb, hex, etc)none
tableBorderSet only table border outsidenone
setTopTheadHTMLCustomize header on top of table (HTML, CSS)none
setTheadHTMLCustomize table's thead (HTML, CSS)none
setTfootHTMLCustomize table's footer (HTML, CSS)none
setHeaderHTMLCustomize header (HTML, CSS)none
setFooterHTMLCustomize footer (HTML, CSS)none
footer{show}Show or hide footer for signaturefalse
footer{topstart}Set top start point from table1
footer{leftspan}Set signature left span1
footer{rightspan}Set signature right span1
footer{inner}Set inner table footer (include border with table)true
0.1.2

6 months ago

0.1.1

6 months ago