Coder Social home page Coder Social logo

Comments (6)

jecovier avatar jecovier commented on August 28, 2024 1

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.

6000850 avatar 6000850 commented on August 28, 2024 1

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.

ljm42 avatar ljm42 commented on August 28, 2024

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.

Julien76 avatar Julien76 commented on August 28, 2024

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.

AlenaR7 avatar AlenaR7 commented on August 28, 2024

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.

1ucas-eng avatar 1ucas-eng commented on August 28, 2024

Hello @jecovier,
So, is there any way for creating the excel file with several sheets?

from vue-json-excel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.