How to export ExtJS GridPanel to Excel? - extjs

I want to export my GridPanel to Excel. I searched too many times but I couldn't find any acceptable solution.
Can you help me about this problem?
P.S.: I use ExtJS 3.2 and 3.3.1

There isn't any good solution to generate xls/xlsx in javascript.
Your best catch is to do it server-side.
Send ajax request to http://your-website.com/generate_xls containing all the data, and return xls headers and then body.
Here is a good PHP library, in case that you are using PHP: http://phpexcel.codeplex.com/

This is a server side job. Here is what I use for generating tabular reports which are based on Grid data: http://xmlgraphics.apache.org/fop/
Also, you can generate a very nice, fully functional Excel spreadsheet from tabular data: http://msdn2.microsoft.com/en-us/lib...ffice.10).aspx

.With the launch of ExtJS 5, it's probably better to start porting your application to a newer version of ExtJS, at least 4.
We have created a front-end XLS(X) and CSV import and export tool that you can use in ExtJS 4 applications with a few lines of code. The user just drags the file on the grid and done. We just launched it, here is a description: http://2gears.com/2014/08/ext-js-excel-import-export-easy/
As said, the import and export is done ENTIRELY client side, so in applications with many concurrent users, this relieves the server from excessive load. In the next weeks also an import wizard will be added, that guides less capable users in importing files.
Hope it helps

Related

Excel like copy paste feature for adding data into grid using react and grid library

I am creating a kind of excel online application using react in frontend, Java in backend and Postgres database.I am using a library called ag-grid (community edition).
Now one of the feature i need is to copy and paste data in to rows
just as we do in excel.
The grid is going to be linked with the Postgres, all the data in the table in the DB is displayed into the grid and any change made into the grid will be reflected to the DB and vice-versa.
The specific need is, i need copy and paste feature, i need to paste the data which is, say copied from other excel in to my application. I should be able to create blank rows and i should be able to paste the data into those rows, if the blanks rows are less then it rows should get automatically added(as in excel) as soon as data (say multiple rows data) is pasted into a one or more rows.And when i choose to save the my application then data of grid should be saved to DB.
Is it possible to create this feature using ag-grid community ?
Is there any other library which is recommended for this purpose ?
If there is any resource or documentation available for this feature
then please point me.
Just in case if anyone stumbles upon this problem, I've found a solution from some another website. It uses processDataFromClipboard event of Ag Grid for a custom solution.
https://plnkr.co/edit/lM3OtCQxpJdapHQt?preview
The ag-grid community edition does not support CRUD operations with a server side model - the enterprise edition does:
https://www.ag-grid.com/javascript-grid-server-side-model-crud/
If you insist on using ag-grid community you will need to handle the editing/grid changes yourself, which should not be too hard. A good starting point would be the cell editing page:
https://www.ag-grid.com/javascript-grid-cell-editing/
In particular, you will need to listen to the cellValueChanged or rowValueChenged event:
https://www.ag-grid.com/javascript-grid-cell-editing/#event-cell-value-changed
The event params will provide you with the following properties:
newCalue
oldValue
column
colDef
which you can use to generate the update call.

Create and make analysis CortexDB

I expose my problem: I have recently started using CortexDB, a NoSQL software to database analysis. I have read the (poor) documentation on https://docs.cortex-ag.com/en/CortexDB/CortexDB/, and purchased a free license to evaluate the operation of the program. As the documentation is unclear I would have some questions to ask you:
1) How do I create a database?
2) how can I import a database contained in an excel file (.csv)?
3) how do I create charts or analyzes regarding the data entered?
Thanks
because the question is very old I hope I can still help you.
First of all: you should download the latest release of the free version (simple registration and download)
if you downloaded the free version you got the server and two databases. A server process handles one database. For a second database you have to start a second server (different port of course). If you start the free version you should have an empty database (or the filled and configured demo db). If you want to create a complete new one without any predefined configuration, you have to start the server process with the command line and the parameter -n (ctxserver64 -n). If you did that you have to configure everything by hand with the tool ‘remote admin’.
the question is not clear for me. Do you mean how to import a csv file into a CortexDB or do you mean how to import the database content into an excel file?
If you want to import the csv file into a CortxDB, the easiest way is to use the tool CortexImplex. It’s completely explained in the online docs (https://docs.cortex-ag.com/en/CortexImplex/CortexImplex-Basics/)
If you want to export datasets as csv file the only thing you have to do is to configure a list in the CortexUniplex as a view for your datasets and export them as csv (you find the export function in the list menu).
I would do the charting with d3j. For this you can use the so called ‘DataService’ of the CortexUniplex. It’s a kind of an API for posting requests and getting JSON objects. If you have a completely configured UniPlex you can use all of your configuration as json objects for other apps (for example charts or an individual application).
The full version has a simple dashboard inside of the CortexUniplex. Maybe the vendor offers it in the free free version.
By the way: it’s always good to write an email to the info address. Because this database is not so famous and known, the guys are very helpful. Or contact them via twitter or other channels (see at the bottom of the cort ex-ag.com webpage).

Export Phabricator tasks to spreadsheet / csv

I spent more than 15 minutes on Phabricator to look for the Export to spreadsheet feature without success. I have seen there that this feature exist. My goal is to migrate away from Phabricator.
You need to implement PHPExcel and add it into your php config include_path.
Then you can use the Export To Excel on each Maniphest page with the built ind queries and your custom queries.
If you need a custom format you need to customize the existing ones. Therefore see files in ./t/phabricator/src/applications/maniphest/export/

How to load/export grid data into excel?

Is their any way to create the excel sheet with the data loaded from grid in extjs.
Going through this link,I have not clearly understood the appraoch and how to achieve my goal.Other related questions were e.g here,but could not get anything out of it.Please help me resolve this.Any help is appreciated.Thanks.
The general concept is that an Excel file is actually XML, at least in the more recent versions of Excel. You can create plain XML that just contains the data. Or you can add a lot of formatting, use the rich presentation that Excel provides. I would suggest that you start off as simply as possible, with just the data, and then add complexity.
To learn how to do this, you need to understand how to generate any XML, then the particular XML that Excel requires, and then how to return that mime type to the browser.
Here is one place (of many) that you can find the XML for Excel.
The better option is for export to be handled from the server side rather than from the client-side script. A new request for export can be sent to the server with the currently applied filters and get the file in generated in excel using Apache FOP or similar libraries(http://xmlgraphics.apache.org/fop/).
Export from extjs raises some problems like
1) what data would you expect for a paged grid.
2) what about the filters applied on the grid

How do I elegantly import an Excel file into Sql Server via a Coldfusion HTML form?

Does anyone have an elegant suggestion for how to get the contents of an Excel spreadsheet into SQL Server via a web form? I need to allow our clients to upload modest amounts of structured data, and I need that data to ultimately reside in a sql table. I really can't expect the clientele to produce anything but an Excel file, but I could require that it be an xlsx.
The web app is written in Coldfusion; it doesn't need to be able to handle huge numbers of simultaneous requests, but I don't want to consider some sort of server-side batch job processing or shunt the user to an asp.net page (which is what we are doing now).
Any recommendations (or examples of how others are successfully doing this) would be appreciated. Due to the sensitivity of the data, we really can't do anything to compromise the security of the web or sql servers.
If you are using CF9, then you could easily use the cfspreadsheet tag too. I mention this one specifically because Shawn's link did not (presumably due to its being relatively new on the CF scene). Here's the livedoc link: http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec17cba-7f87.html
For full use, I would create a web form with a standard file upload field. On the backend handling the form submission, get a copy of the file with
<cffile action="upload" destination="uploaded.xls".....>
Then use:
<cfspreadsheet action="read" query="myExcelData" src="uploaded.xls" ...>
At which point, your spreadsheet content will be available as a query object. You can then loop over this query, running insert queries into your sql server each time you loop. That should do it.
Here are the most notable options to help point you in the right direction; choose what you are most comfortable with (Source: Charlie Arehart).
CFXL
JXLS
CFX_Excel
My personal recommendation is to go the CFX_Excel route. Although a commercial product, it will grant you the most functionality/flexibility of the options listed.

Resources