PDA

View Full Version : Exporting GXT Grid to Excel, PDF



myworld100us
31 Aug 2009, 4:16 PM
Is there any direct way to export Grid Data to Excel and pdf .

Feltros
1 Sep 2009, 3:22 AM
You could fairly easily write a system to export to CVS (output to plaintext with commas seperating each field and a new line for each record). Excel will read this fine (so long as none of your fields include any commas randomly and if they do you put them inside single/double [cant remember which] quotes), and from there you could use excel to convert to pdf.
Thats if your wanting it for your own use, if your wanting to allow a user to be able to download it in excel format i'm guessing you'll need something a bit more complex and maybe thats better off being done before you put the data into a grid (on the server side directly from the database before you format the data into a grid). May well be java libraries for this exact purpose if your using java.

brunonandolpho
1 Sep 2009, 3:29 AM
It will be great if exist a direct way to export Grid Data to Excel. , or any other format in the client side..so , we can permit the user to download this and it could be some type of report

Feltros
1 Sep 2009, 3:32 AM
I can't see it being done client side, as how would you make the file available to click on to download? Even just providing it as CVS (in a file not just rendered onto their page in text) requires a server side servlet to serve it up for download - as you need to provide different HTTP headers to make the browser realise its a download.

Thats the limit of how much I know on the subject though really.