Back to Browse

Export Data To Excel With Multiple Sheets In Oracle VBCS | Create Excel Files In VBCS

235 views
Aug 11, 2025
16:42

Library : "https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.16.0/xlsx.full.min.js" JS Function: define([], function() { 'use strict'; var PageModule = function PageModule() {}; PageModule.prototype.downloadExcelFromSource = function (data) { var createXLSLFormatObj = []; var xlsHeader = ["First Name", "Last Name", "Age", "Department"]; createXLSLFormatObj.push(xlsHeader); $.each(data, function (index, value) { var innerRowData = []; innerRowData.push(value.firstName); innerRowData.push(value.lastName); innerRowData.push(value.age); innerRowData.push(value.department); createXLSLFormatObj.push(innerRowData); }); let filename = "MyDownload.xlsx"; //Specify the Sheet Name var ws_name = "Employee"; //The book_new utility function creates an empty workbook with no worksheets. let wb = XLSX.utils.book_new(); let ws = XLSX.utils.aoa_to_sheet(createXLSLFormatObj); //The aoa_to_sheet utility function walks an "array of arrays" in row-major order, generating a worksheet object. /* Add worksheet to workbook */ XLSX.utils.book_append_sheet(wb, ws, ws_name); //XLSX.utils.book_append_sheet(workbook, worksheet, sheet_name); //var new_name = XLSX.utils.book_append_sheet(workbook, worksheet, name, true); If the fourth argument is true, the function will start with the specified worksheet name. XLSX.writeFile(wb, filename); }; return PageModule; });

Download

0 formats

No download links available.

Export Data To Excel With Multiple Sheets In Oracle VBCS | Create Excel Files In VBCS | NatokHD