Comments (6)
Hello @Julien76 sorry for the late response,
I think is posible with xls files, maybe add a extra layer to the data so every first level items represents a excel sheet and in css file just stack the data (?). I don't know, let me think about it.
from vue-json-excel.
Hello @jecovier,
So, is there any way for creating the excel file with several sheets?
Hi . Did you find a way to make multiple sheets?
from vue-json-excel.
I think the simplest solution would be to switch to the "XML Spreadsheet 2003" format, described here:
https://en.wikipedia.org/wiki/Microsoft_Office_XML_formats
Here is a basic script that creates in that format:
https://www.sencha.com/forum/showthread.php?309246-Exporting-Excel-with-Multiple-worksheets
The XML format is not that different from the HTML that we have now.
The main downside is that it does NOT solve the problem of Excel complaining that the "file format and extension don't match" (unless we change the file extension to .xml)
I believe the only way around that is to switch to the full .xlsx format, but it is quite a bit more complex...
This library appears to be full-featured:
https://github.com/SheetJS/js-xlsx
But it is heavy! The minimized core file is 466kb, much too large for what we are trying to do in my opinion.
https://github.com/SheetJS/js-xlsx/blob/master/dist/xlsx.core.min.js
This is the simplest alternative I can find:
https://github.com/jsegarra1971/MyExcel
But it still requires jszip, which is 350kb on its own.
I'd vote for the "XML Spreadsheet 2003" format because it allows this project to export multiple sheets in a single file while keeping the project small and simple.
from vue-json-excel.
Hello @Julien76 sorry for the late response,
I think is posible with xls files, maybe add a extra layer to the data so every first level items represents a excel sheet and in css file just stack the data (?). I don't know, let me think about it.
Hi,
Thanks for your answer.
I moved away from vue-json-excel for this particular problem (but I still use it where I only to export one set of data, and it works great). I use js-xlsx to export multiple sheets. It is heavy as mentioned in the post above, but as it's wrapped in an electron app, it does not matter too much for my problem.
I' struggling with time to explore your idea. When I found time, I will have a look.
Thanks again.
from vue-json-excel.
Hello @jecovier!
I add a extra layer to the data, but it did not help.
Сode example:
json_fields1: {
'asd': {
'Complete name': 'name',
'City': 'city',
'Telephone': 'phone.mobile',
'Telephone 2' : {
field: 'phone.landline',
callback: (value) => {
return Landline Phone - ${value}
;
}
},
},
'cbg': {
'Complete name': 'name',
'City': 'city',
'Telephone': 'phone.mobile',
'Telephone 2' : {
field: 'phone.landline',
callback: (value) => {
return Landline Phone - ${value}
;
}
},
},
},
json_data1:
{
'asd' : [
{
'name': 'Tony Peña',
'city': 'New York',
'country': 'United States',
'birthdate': '1978-03-15',
'phone': {
'mobile': '1-541-754-3010',
'landline': '(541) 754-3010'
}
},
{
'name': 'Thessaloniki',
'city': 'Athens',
'country': 'Greece',
'birthdate': '1987-11-23',
'phone': {
'mobile': '+1 855 275 5071',
'landline': '(2741) 2621-244'
}
}
],
"cbg" : [
{
'name': '1111',
'city': 'New York',
'country': 'United States',
'birthdate': '1978-03-15',
'phone': {
'mobile': '1-541-754-3010',
'landline': '(541) 754-3010'
}
},
{
'name': '11112',
'city': 'Athens',
'country': 'Greece',
'birthdate': '1987-11-23',
'phone': {
'mobile': '+1 855 275 5071',
'landline': '(2741) 2621-244'
}
}
],
},
An error is issued:
" [Vue warn]: Invalid prop: type check failed for prop "data". Expected Array, got Object "
Maybe there is still some possibility of creating tables on several excel sheets?
Thank you in advance for your response
from vue-json-excel.
Hello @jecovier,
So, is there any way for creating the excel file with several sheets?
from vue-json-excel.
Related Issues (20)
- export fields
- Is it possible to set column width or auto-width in the header? HOT 1
- [Vue warn]: Property "$createElement" was accessed during render but is not defined on instance. HOT 2
- Multi-Line in XLS files
- Export as csv garbled
- Is it possible to align everything to the center? With some PROP
- Loading state management not triggered
- The computed property "fields" is already defined as a prop.
- escapeCsv prop not working to eliminate =" value HOT 4
- This plugin does not support vue3 HOT 3
- This button cannot be disabled
- 在win11中导出异常
- json导出的文件其实是一个后缀.xls的html的文件 HOT 2
- Columns show as currecy
- [Bug] When I re-render the :fields property HOT 2
- scientific notation HOT 1
- How to modify component length?
- How add column No.
- Customize Headers HOT 1
- Excel Prompt HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-json-excel.