dwqs / js2excel Goto Github PK
View Code? Open in Web Editor NEW:relieved: :smiley: :imp: A simple module for excel and json converts each other, which works in the browser.
License: MIT License
:relieved: :smiley: :imp: A simple module for excel and json converts each other, which works in the browser.
License: MIT License
Normally I would use a more supported library to know it works for sure but there's a lack of options. Is the current build passing? Here's the data I used.
testData = [{
"name": 'aa',
"otherField": 55,
}, {
"name": 'bb',
"otherField": 22,
},]
try {
json2excel({
testData,
name: 'user-info-data',
formateDate: 'yyyy/mm/dd'
});
} catch (e) {
console.error('export error');
}
Also I think the doc is missing a comma after data
try {
json2excel({
data
name: 'user-info-data',
formateDate: 'yyyy/mm/dd'
});
} catch (e) {
console.error('export error');
}
..and is formate
in formateData
a typo?
Thanks
This is more of a request than an issue, but could you add support for multiple sheets when going from json to xls?
Basically I would like to be able to use this data (that comes out of xls2json) and convert it back to xls
Hello Everyone,
I am trying to import json2excel in my angular component, everything works except it gives an error on import on component, i have tried like this :
import { json2excel } from 'js2excel';
or like this :
import * as json2excel from 'js2excel';
And gives me this error when i compile :
ERROR in src/app/components/dashboard/transitions/transition/transition.component.ts(14,10): error TS2305: Module '"/home/arsen/Downloads/frontend/node_modules/js2excel/types/index"' has no exported member 'json2excel'.
Thanks.
After adding in the fix #9 compiling in angular 7 is fine but then I run into this error. Please test if this is compatible with Angular 7
js2excel.min.js:1 Uncaught ReferenceError: global is not defined
at js2excel.min.js:1
at push../node_modules/js2excel/dist/js2excel.min.js.Zd (js2excel.min.js:1)
at Object../node_modules/js2excel/dist/js2excel.min.js (js2excel.min.js:1)
at webpack_require (bootstrap:78)
at Module../src/app/download/download.component.ts (main.js:264)
at webpack_require (bootstrap:78)
at Module../src/app/app-routing.module.ts (main.js:74)
at webpack_require (bootstrap:78)
at Module../src/app/app.module.ts (app.component.ts:12)
at webpack_require (bootstrap:78)
Is this supported? Or is there a work-around for json2excel to result in a csv file?
Hello, I have a problem. When i use this library in react components, after download excel file on my computer, my site, DOM tree break down. I must refresh site.
Node 8.15.1 (why would anybody run the script in browser?):
Error: ReferenceError: Blob is not defined
at json2excel (.../node_modules/js2excel/dist/js2excel.min.js:1:655436)
Should use this instead of Blob:
let buffer = Buffer.from(arraybuffer);
let arraybuffer = Uint8Array.from(buffer).buffer;
https://stackoverflow.com/questions/14653349/node-js-can%C2%B4t-create-blobs
i try to run the example in the description but i get this error "blob is not defined",
is a tyscript file and i importing by commonjs method,
if i try to import is as es6 with
import excel from "js2excel";
this give me this error :
Cannot read property 'json2excel' of undefined
Is it possible to give download file name as "download_file.xlsx" and its sheet name as "user info"
How can i add headers for the sheet
It works fine on my local machine but breaks when i deploy on heroku with this error message
Uncaught Error: Corrupted zip : can't find end of central directory at f.readEndOfCentral (js2excel.min.js:3664) at f.load (js2excel.min.js:3676) at new f (js2excel.min.js:3621) at a.t.exports [as load] (js2excel.min.js:2937) at new a (js2excel.min.js:2902) at js2excel.min.js:28217 at cp (js2excel.min.js:28210) at FileReader.r.onload (js2excel.min.js:28957)
On Reactjs
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.