-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export #58
Comments
Hi there! Unfortunately there is no built-in feature for this at the moment... Sorry! |
Hey Nicolas! Do you mind if I pull a fork to try and implement? Do you have any pointers for me to start? I'll try to work on something over the weekend. |
No problem! I don't really have any pointers... It'll be easier for me to merge your changes in if you do it in CoffeeScript but if you prefer JavaScript I can port them by hand as well. |
would also be interested in this...thanks guys! |
+1 |
Are people wanting to export the input data or the resulting pivot table? |
Should be the pivot table result. |
People always want to export :) Le samedi 23 novembre 2013, Nicolas Kruchten a écrit :
Cordialement, Olivier Gamot 06 60 09 53 09 / 09 72 36 97 03 |
Guys, this is a holy grail: "everybody" wants to export to Excel from JS and there seems to be no universally applicable solution. IMHO this feature should not be built into this (or any) pivottable component: it generates a proper HTML table that can be exported (as Excel, PDF, etc) via other plugins (if there's any :)). |
+1 to @fastcatch I should add that the simplest way to "export" to Excel is simple copy-paste. If you select the whole table and copy it, you can then paste it into Excel and it keeps almost all of the formatting intact. |
tl;dr A live demo
//create root of xml
$root = $('<xml/>');
//create a workbook
$workbook = $('<ss:Workbook/>').attr({
"xmlns:ss":"urn:schemas-microsoft-com:office:spreadsheet",
"xmlns:x" :"urn:schemas-microsoft-com:office:excel",
"xmlns:o" :"urn:schemas-microsoft-com:office:office"
});
/*
* Add other elements here
*/
//add workbook to root
$root.append($workbook);
//retrieve full xml string
alert($root.wrap($('<div>')).parent().html())
xlsObject = 'data:application/vnd.ms-excel;base64,' + Base64.encode(testXML);
document.location = xlsObject Prettified xml file and result Edit: typo corrected |
Very Simple to resolve this:
to
Done! |
works like a charm |
Note that this is not a cross-browser solution. Most probably it won't work on ie :( |
is this true? does it not work in ie? |
I have see this, not tried it though.. |
Hi Thanks. I will take a look at it Eric Eric ten Westenend Screen INFOmatch Tel +31 73 6122 940 From: muturiken [mailto:[email protected]] I have see this, not tried it though.. — |
Try jsfiddle example I provided above and see if it works on ie10+ |
Problem is that i do not directly use HTML and JavaScript. I use Delphi with CGDevtools. They take care of the created HTML/Javascript |
Hi using the example of romulosilvacardoso i het an error in InnerHTML Uncaught type error, cannot read poperty ínnerHTML of null Eric |
I have used romulosilvacardoso method and its working in Firefox, however doesn't work in IE. Does anyone know how to resolve this? When i click on the button nothing happens. One other issue i have with Firefox is when the exel file opens the file name is a temporary file name followed by two extentions of .xls.xls therefore the browser asks "The file you are trying to open 'gGGl9L_M.xls.xls', is in a different format then specified by the file extension. |
Hello there, I've attempted to build a export method into the PivotUI, have a look and let me know what you think.. https://github.com/ashesnz/pivottable/tree/ExportToCSV |
+1 |
Issue was auto-closed by Github, which was a bit premature, but f636484 does implement, finally, reliable export functionality! You can see it in action here: http://nicolas.kruchten.com/pivottable/examples/mps_export.html |
I'm currently trying to export using PHP to be 1 worksheet in a much larger report. Was wondering if this was ever completely implemented? :) -Brian |
This is a client-side only library, so the backend technology (i.e. PHP) does not really come into play... Does the |
Is there any way to get the output of the table pivot into a string or something that I could easily pass to PHP or a file? Similar to the export method in the branch @ashesnz made |
Yes, with the |
I've been using this library on a reporting project, and I have something that might help out anyone wanting to export to PDF. This example uses jspdf, and should warn about "pvtAxisLabel" causing some problems if you do not exclude them
|
Thanks @LukeBrumfield ! |
@LukeBrumfield @nicolaskruchten thanks for the above snippet for export to pdf. It worked but had challenges with css, grouping and was shrinking so made following changes which worked like charm. var pdf = new jsPDF('landscape'); var specialElementHandlers = { pdf.addHTML($('.pvtTable')[0], 15, 30, { |
Hi, I am also struggling with the same problem. But I only want to download the output generated after selecting all the renderers and aggregators. How can I solve it? Thanks in advance :) |
I'm marking this as closed, given that the FAQ addresses it quite well: https://github.com/nicolaskruchten/pivottable/wiki/Frequently-Asked-Questions#exporting-renderer-output-to-excel-or-images |
romulosilvacardoso, thanks for the code snippets. Instead of editing the pivottable.js file (using CDN), I just did this: To remove the totals columns and bottom row, I did this:
|
Sir, How can i do excel export of particular cell data in this |
tried romulosilvacardoso solution via typescript, hits the function all codes are executed, no erros but nothing happens, can someone please guide me through this |
Guys, You can try this code// In body Export Table Data To Excel File
//In pivot.jspivot.js link in which can be used in which modification is already made Hope this will help you guys! |
I would like to get the data output values from the Pivot component, which I believe is in json format. Has anyone done this? |
This export to Excel work fine. Adding the Javascript function:
And the Html Code
|
Dear nicolaskruchten/pivottable,
This is a confirmation that we received your email and registered it as ticket #26248156. You can always reply to this email if you want to add additional information.
Kinds regards,
Team Dotmark
|
Hi! |
Dear nicolaskruchten/pivottable,
This is a confirmation that we received your email and registered it as ticket #26528206. You can always reply to this email if you want to add additional information.
Kinds regards,
Team Dotmark
|
Dear eusebiomarquesbenitez, or somone guide me how to edit excel style? using eusebiomarquesbenitez code |
Dear nicolaskruchten/pivottable,
This is a confirmation that we received your email and registered it as ticket #32901886. You can always reply to this email if you want to add additional information.
Kinds regards,
Team Dotmark
|
Hi there. I'm sorry if I'm writing this at the wrong place, but I was wondering if there's already something implemented to export the pivot table as an Excel file or anything like that. It doesn't have to be fancy or anything. Just the raw data used to form the current pivot table.
Thanks in advance!
The text was updated successfully, but these errors were encountered: