ag-Grid to mimic Excel with Angular 9 material components - excel

I'm building a web app with an Angular 9 front end (Typescript) and Django with SQLite back end. The main purpose of the app is data entry and database management. I'm using material components to build various forms within mat steppers. It's no problem building the forms and sending data to the back end when using the material components as is, but for one of the steps, I would like to implement a grid entry that has all the following:
Copy/paste feature directly from Excel
Calculated fields in each row based on the pasted data
Drop down fields where the options are pulled from the current data
For example, I'd like the ability to have a grid where, for each row, some columns are populated by choosing an option from a drop down, some are populated by pasting in directly from excel, and some are populated as calculations using the pasted data + other columns. All this data should then be pushed to the back end and stored in the database upon a button click.
All of this would be one step within a larger form.
Is all of this actually possible with the ag-grid community version? Additionally, are there any other packages that would help pull this off? It doesn't look too likely based on my research, but I'm still new to Angular, ag-grid etc.
Please let me know if I can clarify anything as I understand my requirements might be a bit confusing.

Related

Repeat table header in html-pdf library while creating PDF from data in node.js

I have one scenario in which I have multiple tables to print by creating PDF. For say, I have 4 tables together and the third table is having number of rows resulting in page change. I want to repeat that table's header on the next page also before printing the rows of that specific table. For any table out of 4 tables, if table's data extends to another page, it should repeat the header also for current table on next page. Is that possible in any way?
Any experts, can you please suggest me on this as I am really looking for it.
I am working on node.js to perform this task. Currently using this library-
"html-pdf": "3.0.1"
https://www.npmjs.com/package/html-pdf?activeTab=readme
I have achieved this task perfectly and also with some more advancements in my PDF.
Whosoever is looking for the same, and unable to find any solution, I suggest you to use PdfMake NPM for the same. I have attached playground url of that NPM, where you can test various things and you can start work on your task,.
http://pdfmake.org/playground.html

Azure Logic Apps not inserting a row for each instance in Google sheet

I am using a form site- Cognito Forms. Multiple students can register per form. The following happens using Microsoft Azure Logic Apps: The form is linked to a webhook. For each student a new row should be inserted into a google sheet. When I look at the run data, the input and output data is correct and the correct number of rows are being created. However When I check the google sheet, sometimes only some of rows are being inserted and in no particular order.
This is an old question, but maybe someone can still benefit from an answer. I think I had a similar problem and I was able to solve it by adding the rows sequentially.
I am assuming you are trying to add the rows using "For each". You can configure it to insert the rows sequentially by going to settings, switch concurrency control on, and set the degree of parallelism to 1.
My guess is that if you don't add the rows sequentially, several inserts hit the Google api at more or less the same time and some of the inserts overwrite other inserts.

Same spreadsheet structure and formulas but different data

I have a dozen spreadsheets with identical structure and formulas, essentially tables, only the data differ, say one spreadsheet per country.
For example there is a spreadsheet to manage the US employees, another for the UK employees, and another for the Canada employees.
They are exactly the same except that each will store a different set of employees.
The spreadsheets act both as a database to store data and a user-interface to interact with data.
Each change (updating or adding a formula, updating some drop-downs values, changing style...) has to be replicated in all the spreadsheets which is time consuming and error-prone.
As an example I could change the formula to compute the seniority of each employee by editing the 3 spreadsheets.
I was wondering if there was a reasonably simple way to avoid duplicating the common parts, only having different data.
I'd like to avoid a full-blown development with plenty of VBA code, a complete database, some user input forms... but if really necessary I can write some VBA and build some database to fill in the blanks if there is no out-of-the-box solution.
With a full-blown development I would do something like:
store all the employees in a single SQL database table
develop a single spreadsheet
when opening the spreadsheet ask the user to choose a country to only load the this country's employees
save the data changes to the database
If you're effectively talking about an efficient way to handle version control so that input sheets that have previously been distributed to users match a master template, then I'm afraid there is no out-of-the-box solution.
I use something along the lines of http://datapigtechnologies.com/blog/index.php/building-version-control-in-excel/ to force users to download the latest template should they be using an older one.
In addition, I also place a big note at the top to prompt users to download a new template each time, rather than recycle an old one, because if a user didn't enable macros the automatic download of the latest template won't kick in.
Note that the above screenshot shows a form that I've built in Excel's grid itself, using shudder merged cells. (i.e. It is not a userform)
If the templates need to preserve user-submitted data that isn't held centrally, then you're probably going to need to develop an add-in along the lines of what the authors do in the book Professional Excel Development.

Pulling all info from open Access subform into excel

We are using a access front end that is being developed externally. It displays a form that contains numerous points of data and a few subforms.
I am trying to code a excel sheet that would pull data from various places in the currently open form.
I have gotten as far as to be able to access all the points of data in the main form and the first line in the subforms using the following code (In this example, the "pnum", is the left most field displayed in the subform):
Set objacc = GetObject("xxxxx\Database.accdb").Application
Debug.Print objacc.Forms("mainform").Controls("main subform").Controls("Pnumber")
This works and gets me the value of the very first element named "Pnumber" in the main subform.
However, the way the subform is formulated, it can have anywhere between 1 and 30+ "Pnumber" fields.
I need a way to pull everything that the currently visible (filtered down) subform contains regardless of how many lines there are.
Thanks!
If I were the developer of that Access application, and you asked me for this feature, I would code an API for you to automate getting the right data.
One approach I can think of in this particular case would be to populate some temporary tables, on request from Excel VBA, and have Excel use the Access database file as an external source of data. Or Access could be coded to push the right data into the open Excel worksheet.
The way you would get access to the data in its current state in the form (filtered, sorted, etc.) would probably be best through the RecordsetClone property of that (sub)form. At least that's what I imagine I would use to implement that feature.

Why is my Crosstab being cut off in Excel?

I'm attempting to create an excel spreadsheet using BIRT. The spreadsheet is a crosstab mapping two objects together. The number of rows and columns are dynamic based on values in a MySQL database. Currently I have a working implementation of the report for PDF output. Now, I am trying to create a second version of the report for Excel.
I have copied the report design and begun adjusting it to work with Excel. Everything looks good, but only the first 3 columns are displayed after the header. All rows appear correctly.
I have tried the following:
I tried setting Overflow to Visible on every element on the page. This had no effect.
I tried setting the master page's height and width to ridiculously large values. All of the information displayed correctly, but I am hoping for a solution without hard coded values. In the future the data width might exceed my arbitrary value again and be cut off.
I am constrained in the following ways:
I am not able to switch reporting engines (I have to use BIRT).
I am not able to switch Excel emitters.
This blog entry mentions my problem:
http://www.spudsoft.co.uk/2011/10/the-spudsoft-birt-excel-emitters/
but it does not offer a solution other than an emitter switch. The specific quote is "The files also have problems with page layout that I could not work around (specifically wide reports would be cut off)."
Beyond the one blog entry my googlefu has failed me. Any help is appreciated! Thank you!
There are two questions here. The first one is relatively easy, the second is complex.
1.Why is my Cross tab being cut off in Excel?
2.How do I dynamically adjust the master page width based on the number of columns in the report at runtime?
A1: The Cross tab is being cut off because column widths have been manually set, where the number of columns will expand past the set width of the Master page. Anytime you grab report design element and adjust, BIRT assumes you know what your doing and does not override your setting.
The solution is to recreate the report element (Table or Cross Tab) and not manually adjust any sizes. When run in HTML or Excel all the columns will be automatically set to display in the available master page width.
Screen shot of a BIRT 4.2 Cross Tab, Report Item with a 2 inch master page width and 30 columns
A2: This is not easy, and I will not be providing the answer at this time. I will point toward the solution and identify a couple of the road blocks. A valid solution to this question must include a functioning solution using the Sample Database.
(as of BIRT 4.2.1)
Challenge1 - The Master Page Width is set BIRT Report Scripting in events prior to report Table or Cross Tab item being completed. You can not simply count how many columns are in the report;
If you wanted to count, columns --
Report Design intialize
columnCount = 0;
Cross Tab, onCreate
columnCount ++;
In my research there are two paths suggested for counting columns prior to the Cross Tab item being created. Either
Run the data set in the beforeFactory (this means two queries to the data base, one to count and one for the report), then get a count and use it.
Calculate the value in your intial query and harvest it in the Data Set, onFetch.
I followed the Data Set, onFetch, option using a computed column but did not get it working.
Challenge2 - The Width Property of the Master Page must be set on or before the Report Design, beforeRender. With the beforeFactory being the most often recommended. Additionally the Width Property of the Master Page is only available when the Master Page "Type" is set to "Custom", in my attempts I set this manually in the Property Editor General.
Passing Values from the onFetch to beforeFactory must be done using a PersistentGlobalVariable which can only pass strings, not integers. I found all kinds of way for this to not work. Even passing "12in" in PersistentGlobalVariable failed to adjust the master page Width
Either of these codes in beforeFactory will adjust the Master Page Width (when Type = Custom)
Pass the Value
reportContext.getReportRunnable().designHandle.getDesignHandle().findMasterPage("Simple MasterPage").setProperty("width","12in");
Calculate a value and pass it
increaseWidth = 20;
reportContext.getReportRunnable().designHandle.getDesignHandle().findMasterPage( "Simple MasterPage").setProperty("width",((2+increaseWidth)+"in"));
In the end I have been unable to find or create a functional report that adjusts the Master Page Width passed on the number columns generated at report run time. I think it is possible, but doing so is beyond my current skills.

Resources