-
15 Jan 2009 1:43 AM #131
(By putting break point on FIREBUG) Check the,
var vExportContent = grid.getExcelXml();
parameter.
-
15 Jan 2009 9:23 PM #132
Hi,
I have put a break point in the firebug and found the result int the xml format. The problem which I am facing is not with firefox but with IE. The code is working fine with firefox and is not working with IE.
Please find the result of the variable vExportContnet as an attachment and at the same time I am sending my code to you.
Thanks,
Vishnu
-
16 Jan 2009 12:42 AM #133
Could your problem be something to do with not reading the very first line in ths thread?
This needs a browser that supports data URLs. FF, Opera and IE8 will support this.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
-
16 Jan 2009 1:18 AM #134
export gridpanel to excel
export gridpanel to excel
Hi Animal,
I have seen that line in the early conversations but there was a thread given by emredagli in which he specified that he could export the data into an excel using IE 7. So we have started to use that piece of code in your code.
Thanks,
Vishnu
-
16 Jan 2009 2:41 AM #135
Hi vvreddy,
unfortunately, I haven't work with jsp files. Actually I test my code by using aspx files in .NET.
I want to ask firstly, What did you mean as getting blank page? If when you try to open document in excel and getting improper format, The problem may related with:
In "company" field, it's type isn't declared.Code:fields: [ {name: 'company'}, {name: 'price', type: 'float'}, {name: 'change', type: 'float'}, {name: 'pctChange', type: 'float'}, {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'} ]
Or you can try by giving all formats as string (I used as string to all fields).
The second is if you change the part:
ASCode:if (Ext.isIE6 || Ext.isIE7 || Ext.isSafari || Ext.isSafari2 || Ext.isSafari3) { var dataURL = '../jsp/exportexcel.jsp'; params =[{ name: 'ex', value: vExportContent },{ name: 'FileName', value: 'excel.xls' }]; post_to_url(dataURL, params, 'post'); } else { document.location = 'data:application/vnd.ms-excel;base64,' + Base64.encode(vExportContent); }
You can test it in Firefox. Try this and look at the response you send in firebug.Code:var dataURL = '../jsp/exportexcel.jsp'; params =[{ name: 'ex', value: vExportContent },{ name: 'FileName', value: 'excel.xls' }]; post_to_url(dataURL, params, 'post');
And also I change the format of the file "result.txt" (you sended) as "result.xls". And I can open it in excel. (Problem probably related with jsp...
)
I hope you solve the problem.
Good luck.
-
6 Feb 2009 12:18 PM #136
Hi Animal.. great user extension and I was able to get this working in IE7 and FF3.
Quick question/possible bug in regards to the statement above.
I am using paging but decided to do it on the client side with Condor's extension. So I have all of the data on the client side in my grid's store. But when exporting to excel, I only get the rows visible to the grid. Any suggestions as to why?
Digging a lil into your code, I found the following comments and code
Does this piece actually take all data present in the store, because it does not seem to...Code:// Generate the data rows from the data in the Store for (var i = 0, it = this.store.data.items, l = it.length; i < l; i++) { t += '<ss:Row>'; var cellClass = (i & 1) ? 'odd' : 'even'; r = it[i].data; var k = 0; for (var j = 0; j < cm.getColumnCount(); j++) { if (includeHidden || !cm.isHidden(j)) { var v = r[cm.getDataIndex(j)]; if (cellType[k] !== "None") { 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++; } } t += '</ss:Row>'; }
Please let me know and thanks again for the extension.
-
7 Feb 2009 1:21 AM #137
Whuhhhhh?
MUST prevent myself going into Cox mode... MUST.....
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
-
7 Feb 2009 4:18 AM #138
I'm no sure I get you, I don't watch scrubs but I know dude in the pic is on that show.
If you're stating that this extension was just a way to illustrate the capabilities then yes, I understand you.
My concern was this this.store.data.items I thought this had all items in the store and not what was only loaded into the grid and I was paging locally and not on the server how could I get all of the records exported without loading the grid.
-
8 Feb 2009 3:01 AM #139
The Store can only expose what is in the current page, so you will only ever get the current page from the Store. If it didn't do this, it wouldn't be paged.
If you are using Condor's paging Store, then you need to ask him how to access the "real" Store containing the whole dataset, and use that.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
-
12 Feb 2009 6:52 PM #140
i try but have a error in my code:
unterminated string literal
in line:
'<ss:Cell ss:StyleID="title" ss:MergeAcross="' + (visibleColumnCount - 1) + '">' +


Reply With Quote