If you have questions or if you want to share your opinion about Aware IM post your message on this forum
#53628 by Jaymer
Tue Mar 31, 2020 2:12 pm
Jump to Solution


Per the recent thread, Excel export is still not working correctly.

I added
config.toolbar = ["excel"]

to Init Script, and it immediately showed a new non-aware export Button.
But at runtime, clicking that button does nothing.

And since I was using a custom header on my grid, I found a post to add this:
Code: Select all<a class="k-button k-button-icontext k-grid-excel" href="#"><span class="k-icon k-i-excel"></span>Export to Excel</a>
<a class="k-button k-button-icontext k-grid-pdf" href="#"><span class="k-icon k-i-pdf"></span>Export to PDF</a>


This gave me nice buttons, but still nothing happens when clicked.

Then, a post that talked about this:
Yes, the Excel configuration of the grid does not depend on the toolbar command. The only requirement is to add the k-grid-excel class to the excel export command as the click event is attached as follows:

container.on(CLICK + NS, ".k-grid-excel", function(e) {
e.preventDefault();

that.saveAsExcel();
});


But that syntax, using "container" doesn't work in Aware... there is no "container", so thats got to be "this" or "widget" or something... working on it.

Exporting to Excel is such a basic function in software today, its surprising that its so difficult to get this working from a grid to allow the user to get his data out of the db.
Last edited by Jaymer on Mon Apr 13, 2020 8:00 pm, edited 4 times in total.
#53629 by johntalbott
Tue Mar 31, 2020 5:08 pm
config.toolbar = ["excel"] is working consistently for me.

Have you tried this in a simple grid .. maybe CRM sample?
#53633 by Jaymer
Tue Mar 31, 2020 8:36 pm
Found this in my console:

kendo.all.js:11436 Uncaught Error: JSZip not found. Check http://docs.telerik.com/kendo-ui/framew ... quirements for more details.
at kendo.ooxml.createZip (kendo.all.js:11436)

currently, I'm getting this in my app.
But I saw this work in the CRM sample, then I monkeyed around and tried lots of variations in my app - pretty sure it worked a few times. Now, back to no action when clicking the button.
#53639 by johntalbott
Wed Apr 01, 2020 3:44 am
Do you try the fix described in the Kendo article?
#53640 by Jaymer
Wed Apr 01, 2020 3:55 am
I don't see why the fix would be BSV-specific.

It works on CRM sample, but not on my app.
hmm, maybe there's an internal threshhold for kicking in the Zip... if its a small export already (like Customers from CRM) then maybe no Zip is attempted.

k, will try that extra code.
#53641 by johntalbott
Wed Apr 01, 2020 6:17 am
You're right .. it shouldn't be BSV specific. I missed that it is working for you in CRM app.
#53660 by Jaymer
Sun Apr 05, 2020 12:37 am
I think it worked in sample CRM on Customers because it was a tiny amount of data.

Trying it in my main app now works after adding the JSZIP class specified in the Kendo error message above.

So, I get an Excel export now, but its only the 1st page - 20 records out of many.

I cannot get any combination of Init script lines to output all records:

config.toolbar = ["excel","pdf"];
config.excel.allPages = true;
--> Exception running initial script for query RO TypeError: Cannot set property 'allPages' of undefined

config.excel.AllPages = true;
--> Exception running initial script for query RO TypeError: Cannot set property 'AllPages' of undefined

config.Excel.AllPages = true;
--> Exception running initial script for query RO TypeError: Cannot set property 'AllPages' of undefined

config.Excel.allPages = true;
--> Exception running initial script for query RO TypeError: Cannot set property 'allPages' of undefined
#53661 by Jaymer
Sun Apr 05, 2020 12:46 am
This works for me, but as I said in the other thread, I get an error using the other syntax:
Screen Shot 2020-04-04 at 8.45.27 PM.png
Screen Shot 2020-04-04 at 8.45.27 PM.png (20.71 KiB) Viewed 1876 times


recap:
Aware Export button on grid only exports first page. Will not export all records in grid.
Even if you make Aware show more records per page, only the first 100 grid rows get exported to the file.

1) Added Kendo Excel Export Button for Excel & PDF (the toolbar line)
2) config.excel to export more than just the 1st page
3) added this to startup.html to include class to zip the excel file (not having this made the click on the button appear to do nothing - but a JS error was on the Console)
Code: Select all<script src="https://kendo.cdn.telerik.com/2020.1.219/js/jszip.min.js"></script>


ISSUE
1) Aware should fix this to work better. We should be able to access other Kendo export properties (filename, pagination/header/footer (PDFs), ExportAll)
2) Adding their excel/pdf toolbar makes a 2nd toolbar - which is not acceptable. If you MUST have HTML/CSV export, to my knowledge, those are only accessible using Aware, so you'll have those on 1 toolbar, and Excel/PDF on another toolbar.
Screen Shot 2020-04-04 at 9.00.43 PM.png
Screen Shot 2020-04-04 at 9.00.43 PM.png (21.74 KiB) Viewed 1876 times
#53662 by Jaymer
Sun Apr 05, 2020 1:31 am
NOTE

Remember that Aware supports "Export to CSV" as a Panel Operation.
This works "correctly" and exports all rows in the Grid.
And Excel is going to import a CSV "perfectly" - so, if you must have Excel data now, just do it via CSV.
#53729 by Jaymer
Mon Apr 13, 2020 8:00 pm
Aaarrrggghhh

Customer says clicking Excel Export button does nothing.
Checked it and sure enough... just dead.
This was using the Kendo toolbar method. (Hadn't changed to CSV yet in all places)

The JSZIP stuff is loading.
No Console error msgs.
Just a button that seems to do nothing.

Export to Excel just shouldn't be this tough.

Who is online

Users browsing this forum: Bing [Bot] and 17 guests