How to use the xlsx.utils.book_new function in xlsx

To help you get started, we’ve selected a few xlsx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Enalean / tuleap / plugins / testplan / scripts / test-plan / src / helpers / Export / Exporter / XLSX / download-xlsx.ts View on Github external
export function downloadXLSX(
    gettext_provider: VueGettextProvider,
    milestone_title: string,
    report: ExportReport
): void {
    const book = utils.book_new();
    const sheet = transformAReportIntoASheet(report);
    utils.book_append_sheet(book, sheet);
    writeFile(
        book,
        gettext_provider.$gettextInterpolate(
            gettext_provider.$gettext("Test Report %{ milestone_title }"),
            { milestone_title }
        ) + ".xlsx",
        { bookSST: true }
    );
}
github apache / zeppelin / zeppelin-web-angular / src / app / visualizations / table / table-visualization.component.ts View on Github external
exportFile(type: 'csv' | 'xlsx', all = true) {
    const wb = utils.book_new();
    let ws: WorkSheet;
    if (all) {
      ws = utils.json_to_sheet(this.rows);
    } else {
      ws = utils.json_to_sheet(this.nzTable.data);
    }
    utils.book_append_sheet(wb, ws, 'Sheet1');
    writeFile(wb, `export.${type}`);
  }
github HalitTalha / mat-table-extensions / dist / cdk-table-exporter / fesm2015 / cdk-table-exporter.js View on Github external
createContent(worksheet, options) {
        /** @type {?} */
        const workBook = utils.book_new();
        if (!options) {
            options = (/** @type {?} */ ({}));
        }
        this.correctType(options);
        utils.book_append_sheet(workBook, worksheet, options.sheet);
        return write(workBook, options);
    }
    /**
github HalitTalha / mat-table-extensions / dist / cdk-table-exporter / fesm5 / cdk-table-exporter.js View on Github external
function (worksheet, options) {
        /** @type {?} */
        var workBook = utils.book_new();
        if (!options) {
            options = (/** @type {?} */ ({}));
        }
        this.correctType(options);
        utils.book_append_sheet(workBook, worksheet, options.sheet);
        return write(workBook, options);
    };
    /**
github apache / zeppelin / zeppelin-web-angular / src / app / pages / workspace / notebook / paragraph / result / result.component.ts View on Github external
exportFile(type: 'csv' | 'tsv'): void {
    if (this.tableData && this.tableData.rows) {
      const wb = utils.book_new();
      let ws: WorkSheet;
      ws = utils.json_to_sheet(this.tableData.rows);
      utils.book_append_sheet(wb, ws, 'Sheet1');
      writeFile(wb, `export.${type}`, {
        bookType: 'csv',
        FS: type === 'tsv' ? '\t' : ','
      } as WritingOptions);
    }
  }