-1

I want to create a Google Slide/s from a Google Sheet large table data, but I can't find a good example if it's even possible.

I found only examples of "generating Google Slides from the Google Sheets" table containing 5-6 rows that fit the Slide page perfectly.

A given week, I work on a data table that contains 15-30 rows, and some cells can also be bigger than others containing more text. I need to insert this data into a Google Slides presentation, typically 3-4 slides of the same table format, to fit everything.

Could anyone please guide me on how to check in AppsScript if X number of rows will fit the Google Slide page table size? If not, generate another Slide page containing a table with the remaining data.

Is there any size parameter I could use to determine the Google Slide table width/length to determine if I have to create a new Google Slide to fit the rest of the data?

Omen
  • 139
  • 2
  • 13
  • What do you mean by large table data? What is page size of your presentation? Also show what you tried and add a more specific description of your search efforts (i.e. include links to the most relevant related questions on this site). – Rubén Jul 19 '22 at 19:04

1 Answers1

2

You can't link a Spreadsheet Sheet to a Slide, only a Chart. You can build a table using GAS, get the values from the sheet and put the values into each cell of the table. However, I tried to build a large table and there are no scroll bars. Horizontally the table fills the page and cells get narrower as you add columns. Vertically it runs off the page and the bottom rows are not viewable.

TheWizEd
  • 7,517
  • 2
  • 11
  • 19
  • Thanks @TheWizEd. That is exactly the problem I thought I would face with larger tables. I was looking at a [PageElement](https://developers.google.com/apps-script/reference/slides/table) representing a table. I found methods `getHeight()`, which _Gets the element's height in points, which is the height of the element's bounding box when the element has no rotation._ . Maybe this way, I could determine the table size to fit on one slide, and if the generated table is too big, then move the remaining table into a new Slide. – Omen Jul 19 '22 at 20:14
  • Found just now the [Sizing and positioning page elements](https://developers.google.com/apps-script/guides/slides/moving-elements) for Google Slides. – Omen Jul 19 '22 at 20:45
  • One other note, I tried to create a table 100 rows, 26 columns and it takes a very long time. This is because you have to use table.getCell(i,j).getText().setText(value) for each cell of the table. This situration is similar to getValue()/setValue() for Google Sheets. And because the cell are so narrow, everything wraps. – TheWizEd Jul 19 '22 at 22:30