Using jsPDF-AutoTable with large tables - jspdf

I have a need to print a large table across multiple pages which contains both header rows and a “header" column. Representative of what I would like to achieve is:
https://github.com/EricG-Personal/table_print/blob/master/table.png
I do not want the contents of any cell to be clipped, split between pages, or auto-scaled to be smaller. Each page should have the appropriate header rows and each page should have the appropriate header column (the ID column).
The only aspect not depicted is that some of the cells would contain image data.
Can I achieve this with jsPDF-AutoTable?

Related

Google Sheets - Split Rows From Within One Cell and Drag adjacent Names to Match

I want the title in Cell A1 (Example Title) to be in a row next to each entry in Cell B1 so my desired result is:
In Excel OR Google Sheets. I only see "Split Text To Columns"
There are many ways to go about this. I'll suggest one of them.
Suppose that your raw data is in Sheet1!:A2:B. Add a "Sheet2" and make sure that A:B is empty. Then place the following formula in Sheet2!A1:
=ArrayFormula(QUERY(SPLIT(FLATTEN(SPLIT(REGEXREPLACE(CHAR(10)&Sheet1!B2:B,CHAR(10),"~"&Sheet1!A2:A&"|"),"~",1,1)),"|"),"Select * WHERE Col2 Is Not Null"))
To understand how this works, you need to work from the inside out.
First, an extra line break (CHAR(10)) is added to the start of each cell in B2:B. This is to create a uniform breaking point before every entry in the Column-B cells.
That now-uniform CHAR(10) is replaced by REGEXREPLACE with a concatenation of a tilde (~), the Sheet1!A2:A data for that row and a pipe symbol (|). Thus far, all of the virtually-held data for Sheet1!B2:B will still be within its original cell space.
SPLIT now splits that new data at the tilde to create individual horizontal cells that each now contain a separate copy of the Sheet1!A2:A label, a tilde, and one of the list items from Sheet1!B2:B.
This new virtual horizontal and vertical grid is then FLATTENed into one column.
Again, SPLIT is applied to separate the Sheet1!A2:A label from each of the now-individual Sheet1!B2:B entries, resulting in two columns.
'QUERY` is applied to keep only those results which are not null in the second column (ruling out any results for blank rows in the raw data or errors in column one formed by the previous functions, particularly those caused with the assumption that your number of individual data points in each cell of Sheet1!B2:B will vary).

Extracting multiple sections of text from google sheets cell

I'm trying to grab a subset of covid data from a cell in google sheets that contains a lot of superfluous data.
Specifically, the LDH vaccine information tab here has a tab containing "Vaccination by Gender by Parish" which has two things repeated 64 times: A line containing information on total series initiated and completed per parish, and a chart showing the percentage breakdowns by gender for that parish.
I'm importing this tab by copy/pasting into a google form (splitting it in 2 halfway through to get around the character limit). It returns a massive cell (or, two cells rather) containing 32(x2) instances of both the lines containing parish vaccine data and several lines containing the chart data.
Is there a way I'm not seeing to create an array formula that will isolate the two segments? I don't need the gender breakdown information, just the top-line numbers per parish. If I can get the top-line numbers into a separate cell together, I can use a split function on them, but can't separate everything correctly using the split function from a single cell.
This is the shortest of three lists/charts that display the information as a raw string (on the front-facing side, which I need to use because other people will be inputting this data into the sheet).
Edit: Here's a viewable version of the sheet.
To get to the correct tab, click "Vaccination Information" at the top of the ArcGIS dashboard. Then, click the left arrow at the bottom of the dashboard until it displays "Vaccination by Gender by Parish."
Since it is not possible to use automatic import using formulas and you have to use copy-paste, you can get the result you want faster this way.
Copy from the site and paste the data on the sheet.
Filter and remove unnecessary rows.
Split the text into columns using the "-" separator.
Search and replace, remove text and spaces from the data columns.

How to delete empty cells and shift up in Google Sheets?

Is there a way to delete empty cells in a given range and shift the column up to the desired display as shown below? Closest I came was
=ARRAYFORMULA({A1:C1; TRANSPOSE(SPLIT(TRANSPOSE(QUERY(A2:C,,999^99)), " "))})
which removes empty cells, but splits the first names and surnames into separate cells, which I have not figured out how to avoid. Pfa a made-up sample of current and desired displays:
Current Display
Desired Display
I'm new at this, but I came up with a bit of a brute force method, which may help you.
={
{(A1:C1)};
{FILTER(A2:A100,A2:A100<>"");indirect("N1:N" & 100-counta(A2:A100))},
{FILTER(B2:B100,B2:B100<>"");indirect("N1:N" & 100-counta(B2:B100))},
{FILTER(C2:C100,C2:C100<>"");indirect("N1:N" & 100-counta(C2:C100))}}
Assuming your data block is in columns A1:C100, this formula filters blank cells from each individual column, and then pads each column with blank cells at the bottom, to make the three arrays equal in length/dimension.
Note that in "100-counta(...", the 100 is the expected maximum length of your data column.
This could be calculated, and must be the same for all three columns.
Note also that the first array is horizontal (ends with a semi-colon), followed by the three columns, stacked beside each other (ends with a comma).
Here is a working example.
https://docs.google.com/spreadsheets/d/1MGaqqGrkmIliuAzEqxPtdEVZXWPN2K5W7jFFM-ZnwgE/edit?usp=sharing
If I missed something you were trying to achieve, let me know.
Also, I'm sure that there is a more elegant way to do this, or one not requiring the use of a block of "reserved" blank cells, but I couldn't think of that at the moment.
Edit: The formula as follows also works. But you need to remember to set the "100" value to be equal to the number of rows in your data block, since we pad the columns with the necessary number of blanks rows, after removing the blank cells in each column.
={
{(A1:C1)};
{FILTER(A2:A,A2:A<>"");indirect("N1:N" & 100-counta(A2:A))},
{FILTER(B2:B,B2:B<>"");indirect("N1:N" & 100-counta(B2:B))},
{FILTER(C2:C,C2:C<>"");indirect("N1:N" & 100-counta(C2:C))}}

How do I change the row that numbers are compared based on the data in another cell?

I am usually good with conditional formatting in excel/google sheets, but here is my current challenge. I am needing to format specific cells based on the data in a table at the top of the sheet where the row used for comparison changes based on the value in one cell. Here is the link to the sheet I am currently working on.
https://docs.google.com/spreadsheets/d/1t7pgvGjxs1Eb3cCcRnLDA6E9ov5riEDAjn-fX3A0s8I/edit?usp=sharing
-The table at the top of the is the reference table and does not change.
-the number in column E is the data that determines which row of the table to compare the data in columns G through AN
The Situation:
Let's look at Name 3.
The numbers in G18:AN18 are compared to the G12:AN12 because of the matching number in E18 and E12
If the number in G18 equals G12 - no formatting change
If the number in G18 is one less than G12 - fill color Yellow
If the number in G18 is more than one less than G12 - fill color Red
This is true for each cell in row 18 columns G:AN
- That's the easy part -
Now, when the number in E18 changes (from "9" to "10" for example), I need it to stop looking at row 12 and now look at row 13 because E18 now matches E13
I know that I can do it using nested IF/AND statements but I would have to do it for each and every cell individually. How can I do this more easily through google sheets?
You need to use INDEX/MATCH, so for the yellow formatting starting in G16:-
=G16=INDEX($G$4:$R$14,MATCH($E16,$E$4:$E$14,0),COLUMN(A:A))-1
The idea is that as you copy it across the column changes to B:B etc. so you get the next column of the top region and as you copy it down you get whichever row matches E16, E17 etc.
I'm sure you can modify it for the red formatting and also to take account of any blank cells.
Also, in this particular case that the numbers in E4:E14 are just the numbers 1-11, you could use E16:E25 to index directly into G4:R14 and make the formula a lot simpler like this:-
=G16=INDEX($G$4:$R$14,$E16,COLUMN(A:A))-1

Editing labels of series in Google Spreadsheets

I have data listed in columns as below and by highlighting it all including the names and the units and then clicking Insert -> Diagram..., I can easily make the following graph:
The labels are correct LabelA, Labelb, and LabelC in this case.
But if the label names are not in the same column as the data, then I cannot make this graph. In the data structure below where names and data are in different columns, I again highlight all data cells as well as their units and names (by holding down the ctrl button and clicking all the cells with the cursor):
It is clear that the software does not know that it should assign the names as labels. Is there a method to make the graph show the correct labeling as in the first scenario but with the second scenario's data structure?
you could combine the data in another place with formula:
={{A1,C1,E1};{B4:B6,D4:D6,F4:F6}}
and then plot the diagram as usual.

Resources