jQuery UI Widgets › Forums › TreeGrid › Export PDF to local variable
This topic contains 4 replies, has 2 voices, and was last updated by ramona86 9 years, 1 month ago.
-
Author
-
Hi guys!
I was reading this post:
http://www.jqwidgets.com/community/topic/must-use-the-server-side-function-to-export-grid/#post-26669
And i’m doing something similar to this:var exportInfo; $("#excelExport").click(function () { exportInfo = $("#jqxgrid").jqxTreeGrid('exportdata', 'xls'); });and then i use that
exportInfovariable for creating the file and download it under the browser.
It works fine forcsvandxlsbut not forpdf, any idea? When trying to open file it says “failed to load”, like if it were malformed.
Thanks in advance!
RegardsHi ramona86,
You should read the docs about TreeGrid. It is not the same widget as the Grid and the exporting process is a bit different as shown in the demos.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Thanks for your response!
What do you mean by different?
I read documentation and see this:
Exports TreeGrid Data to Excel, HTML, XML, JSON, CSV or TSV. See also the exportSettings property
but then inmediately after that it says:
Parameter Type Description
exportDataType String ‘xls’, ‘html’, ‘xml’, ‘json’, ‘csv’, ‘tsv’ or ‘pdf’So it’s not very clear if you allow or not pdf. If i try your examples, with tree grid and server export, pdf works, but if i assign it to a variable, then it doesn’t.
Can you please help me here?
ThanksHi ramona86,
Did you look at the exportSettings? I guess you did not, because there you specify whether to export or not to a variable.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Yes, i did, for sure, i’m using this options:
{ exportSettings: { columnsHeader: true, hiddenColumns: false, serverURL: null, recordsInView: true, collapsedRecords: true, fileName: null } }
As i already mentioned, i have it working for csv and xls (exporting to a variable). The only problem is with PDF, that’s why i wanted to know if it has a different behavior. -
AuthorPosts
You must be logged in to reply to this topic.