Hey there!
There is a lot of people that have been asking how can we export data from our Data Collections to a real MS Excel file. You can export data inside the data manager as CSV and then open that in MS Excel.
But if you want this function for your clients / site visitors it hasn’t been that easy right?
I have found out that there is actually a really simple way to do this. MS Excel will parse any HTML formatted table with table rows and table cells as columns and cells. So what I did was to test if I could find code snippets to create tables from JSON formatted data and I did.
Then I managed to make some code to actually export that HTML table to a file that the browser will think is a pure MS Excel file.
The only thing you will need is a Data Collection to use, a button that someone will click on and a hidden html component with some code inside. That’s it! It seem to work really well from my testing.
So watch the video I just made for you all and download the source code for your HTML Component at the button of this post. I hope you will enjoy this, any feedback is greatly appreciated from you all.
@andreas-kviby To take certain data from a collection and have it displayed in a pdf format. So for example if I wanted to create a pdf schedule or receipt or a catalog perhaps…
@Andreas Kviby Is there a way to just export a few columns to excel? Because now I get also the columns of the ID and Creation Date etc. Also does this code work for .xlsx too?
Thanks a lot!