-
19 Feb 2009 8:08 AM #1
Export Extjs/ Grid Filter to Excel:
Export Extjs/ Grid Filter to Excel:
First I would like to thank ambience who created the Grid Filter plug-in (wonderful job) and Animal for the great export to excel plug-in.
At my job I was required to create a Grid-Filter that exports Excel based on the filter, after making a research I reached a point that I could achieve it.
The example shows the Grid Filter (with php), I added the page exportxml.php which exports the filtered results into Excel and I added the folder (App_data) inside it the config.php file and class.mysql.php with checkurl.php.
The export is done from the mysql query not from the Javascript.
I’m new in php not much familiar most probably you will find the code not clean but I hope I can help others to achieve better coding.
In the excel if your using easy php on windows there is two declaration errors but in case of Linux no such errors.
Tested on IE8, FF, Chrome, Safari.
Best Regards,
Gabriel
-
19 Feb 2009 8:33 AM #2
You should really use mysql_*escape functions on all input values in php instead of doing error-prone blacklisting of selected SQL terms - especially seeing that you are filtering REQUEST_URI while taking your values $_REQUEST instead of $_GET, which makes it easy for a possible attacker to circumvent your filter by submitting bad values via POST.
-
20 Feb 2009 12:07 AM #3
-
7 Mar 2009 12:32 PM #4
Hi,
Works nice on filters but how do you export to excel?
Couldn't find any button for that.
Thanks
-
8 Mar 2009 2:06 AM #5
In the example its already added.
In the file grid-filter.js:
Code:var grid = new Ext.grid.GridPanel({ id: 'example', title: 'Grid Filters Example', ds: ds, cm: cm, enableColLock: false, loadMask: true, plugins: filters, height:400, width: 700, el: 'grid-example', autoExpandColumn: 'company', bbar: new Ext.PagingToolbar({ store: ds, pageSize: 15, plugins: filters, buttons: [{ id: 'grid-excel-button', text: 'Export to Excel...', handler: function(){ document.location = 'exportxml.php'; } }] }) }); grid.render();Last edited by mystix; 8 Mar 2009 at 6:32 PM. Reason: POST CODE IN [CODE][/CODE] TAGS. see http://extjs.com/forum/misc.php?do=bbcode#code
-
8 Mar 2009 11:16 AM #6
OK found it, thanks.
I was unzipping the content to the wrong ext folder:P
Is there a way to customize the excel headers (add some color, width, etc..)?
Thanks
-
20 Feb 2011 11:26 AM #7
Hi, I have tried that.. the grid appears, but there is no record at all..
-
11 Mar 2011 3:46 PM #8
Thanks
Surinder singh Mattaur (Matoo)
Extjs Excel copy/paste Grid
Extjs Photo Uploader
Extjs Filter Row
Extjs Grid Query Builder
Extjs Simple Form
Extjs Form Phone Field
Extjs Form Week Field
Sencha Cube Carousel
Sencha Date Picker
Sencha Touch Themes Builder
http://www.developerextensions.com
http://www.developerextensions.net
-
6 Oct 2011 6:36 AM #9
Hi Angelga,
Thanks for your Efforts for this kinda of brilliant development. I tested this in Extjs 3.2.1 and IE8, Chrome 9.0 and FF7.0..but this is functioning in FF only.Can you please help me to come out of this problem so that i can use this in my project.
Thanks in Advance.


Reply With Quote

