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

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.

Related

Is it possible to share filters between reports in Google Data Studio?

Google's Data Studio documentation makes some vague references to filtering functionality which does not appear to exist in the actual product. They say "Once you've added a filter to a report, you can use it in other components or even other reports."
However, there is no mention about how to do this. If I create a filter using the Filter Manager ( Resource > Manage filters ), the same filter does not magically become available in any of my other reports.
So is this a case of outdated documentation about a feature which has since been removed, or is there still some way to share filters between reports?
Copy a table or chart from an existing report that has the filter you want into a new one and the filters go with it. It's the only way I've found of moving filters from one report to another

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

Manipulate Database from Drupal

I'm new to Drupal 7. Right now I'm trying to use D7 to build an interface that allows me to directly manipulate the tables in the database.
I have installed a couple modules such as Data, Migrate, Feeds, and etc. I managed to create a view to display the table that I created using Data Module, but I need to add and update the rows from the interface.
Furthermore, is it possible to set up relational tables so that I can update or delete related rows at the same time using Drupal?
Thanks in advance
Using the data module that is quite easy because it comes with the "Data Entity" submodule that creates an entity form for you. This allows you to update data table rows. It should add an edit button at the end of your data view for the table.
Using some basic custom code you can always create a form to add/update data to the table as well. For form creation please have a look at:
http://api.drupal.org/api/drupal/includes%21form.inc/group/form_api/7

Merging ACCESS projects (transferring a switchboard)

I am enhancing and fixing the forms/queries/VBcode etc. for an access 2007 database. The current version is being actively used and when I am done with my changes I need to transfer in my changes without disrupting the data stored in the tables already in the running mdb.
I'm not entirely sure how to handle the "merge" when the time comes. As an experiment I have a local backup copy of the version I started working on and used the import external Access data option. This imported the new forms, queries, vb, etc. But the only hang up is that the switchboard form isn't the new. Switchboard forms of course are guided by the switchboard manager but I was hoping that all that logic is held inside the form itself somehow. It seems this is not the case. After the import there is a new form of the same name with a number after it as expected, and the correct create/modify date. But when open it looks exactly the same as the old switchboard.
Any ideas?
It sounds to me as if you have both the data and the forms etc in the one database. This is not a good idea at all and if you are updating, it is the ideal time to correct the problem. If you split the database, any updates to forms and code can be simply copied to the user without worrying about the data. You will find some notes here: http://office.microsoft.com/en-us/access-help/split-an-access-database-HA010342026.aspx
The Access switchboard manager uses a table named Switchboard Items to dynamically populate switchboard form pages. You will need to transfer the updated version of that table to make your revised switchboard pages available in the other project.

Auto populating data into an existing Excel template

I was given an Excel template and have to automate filling it.
It is supposed to be uploaded every month into the grand central DB of our company. Grand central accepts nothing other than an Excel file with that template.
I tried reproducing the same using SSRS but it looks like SSRS has no control over rendering the looks and data in Excel (it keeps hiding columns and rows which is not acceptable). I have created a SQL connection on the Excel to get the stored procedure data into Excel.
Now I have to make sure the data goes into the template into appropriate fields. I think it needs groupings and page breaks also.
Please help..
You're on the right track with dumping SSRS as a way to export into the template. I've also found that the Excel rendering extension in SSRS does a lot of hiding and merging cells with certain report designs.
You will probably end up needing to write a script in your language of choice to load the data into appropriate cells on the template.
Here are some Powershell articles on Excel automation:
http://blogs.technet.com/b/heyscriptingguy/archive/2006/09/08/how-can-i-use-windows-powershell-to-automate-microsoft-excel.aspx
http://winpowershell.blogspot.com/2007/03/powershell-and-excel-com-object.html
Also take a look at Perl and the Win32::OLE module:
https://metacpan.org/pod/Win32::OLE
http://www.perlmonks.org/?node_id=153486

Resources