-
15 Apr 2008 1:27 AM #11
Really nice extension, thanks for that animal.
Maybe a better solution would be to send the Excel xml to a backend and create a file? In this case you are not rely on any browser stuff...
-
15 Apr 2008 1:55 AM #12
Well, if there's going to be a backend involved, it's better that that should just produce the XML itself. It has all the data, so it should just be able to process it into a valid XML spreadsheet. In our app, we have an Excel export button, but it just requests a document to be generated from the server, it does not send any info up.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
15 Apr 2008 1:57 AM #13
Of course, you are rightit's better that that should just produce the XML itself. It has all the data, so it should just be able to process it into a valid XML spreadsheet.
-
15 Apr 2008 6:26 AM #14
-
16 Apr 2008 5:01 AM #15
I found some bug with a grid containing hidden columns, there is a mismatch between excel cells type and values when you have different types of data
when retrieving the cell types I added a specific var for incrementation:
It works for me with this updateCode:var k=0; for (var j = 0; j < cm.getColumnCount(); j++) { if (includeHidden || !cm.isHidden(j)) { var v = r[cm.getDataIndex(j)]; t += '<ss:Cell ss:StyleID="' + cellClass + cellTypeClass[k] + '"><ss:Data ss:Type="' + cellType[k] + '">'; if (cellType[k] == 'DateTime') { t += v.format('Y-m-d'); } else { t += v; } t +='</ss:Data></ss:Cell>'; k++; } }
One more thing : why don't you use a basic toolbar button for exporting, which will automatically refresh the data url like this :
Code:bbar: new Ext.Toolbar({ buttons: [{ id: 'grid-excel-button', text: 'Excel', handler: function(){ document.location='data:application/vnd.ms-excel;base64,' +Base64.encode(grid.getExcelXml()); } }] })
-
16 Apr 2008 6:55 AM #16
And it will only works on ie8+ ? @Galdaka: you tested it on IE6?
-
16 Apr 2008 11:18 AM #17
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
20 Apr 2008 12:51 PM #18
server side excel
server side excel
Great plugin Animal, I have a server side paging in my grid and I want to be able to export to excel , doing it on the server side is fine with me, but how do I bring up a file download dialog box once the data is back from the server? I am quite new to Ext and this simple thing is taking me a long time...
Also, in my toolbar I have a button "export to Excel" , and I want it to export only the data on the current page, not the whole store data, so how do I pass along the current data to the server side to generate a XML? any ideas ?
-
20 Apr 2008 12:57 PM #19
If you just want the current page, then you can do it on the client.
If you are doing it on the server, that's totally up to you.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
20 Apr 2008 2:59 PM #20
Hi,
I'm testing this but getting an error message:
Any help? please!PHP Code:unterminated string constant


Reply With Quote