Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedding google sheet cells that can be sorted by viewers

I'd like embed a google sheet to my HTML website that would show only cells with data (no header, row numbering, letter-named columns, border etc.) and it could be filtered by the viewers. Viewers could temporarily filter the data but it shouldn't change the original filtering.

I have google sheet that has multiple columns with title and data below. I've filtered data (including title) using google sheets 'filter' option. I'm aware that there's a way to embed sortable google sheet if I use share link that allows viewing or editing. But when I am using that edit or view link, I cannot use almost any url parameters.

  • Example edit/view link: https://docs.google.com/spreadsheets/d/{spreadsheet-key}/edit?usp=sharing

  • Best try so far is using url parameter &rm=minimal but it still shows other sheets, numbered rows and letter-named columns

I can use url parameters on link that I get from File -> Publish to the web -> Embed. Here's the link:

< iframe frameborder="0" height="440" scrolling="no" src="https://docs.google.com/spreadsheets/d/{spreadsheet-key}/pubhtml?gid=0&amp;single=true&amp;range=A1:N20&amp;widget=false&amp;chrome=false&amp;headers=false" style="float: left;" width="761"></iframe >

=> I get visually just what I want: a clean spreasheet embedded containing only data. But now it can't be filtered.

Here's best iframe so far (sortable but not clean):

< iframe height="440" frameBorder="0" src="https://docs.google.com/spreadsheets/d/{spreadsheet-key}/edit?usp=sharing&rm=minimal" width="761"></iframe >

Is there a way to show only data cells and still allow sorting?

like image 501
G4mo Avatar asked Oct 24 '15 12:10

G4mo


People also ask

Can viewers sort Google Sheets?

If the Sheet is View-Only, then you shouldn't need the formulas, filters or otherwise. Just create a new Sheet, or even a new Spreadsheet that has the values and formatting, but not the formulas. Then your viewers can sort and view, without the formulas getting messed up. The sheet is not frozen.


1 Answers

The filter/sort functionality gets lost when embedding a google sheet with html; same is true when freezing rows/columns. Google has not solved this yet, although it has been requested for years. It is possible to do this when embedding via Excel Online though, but that one is a bit slow.

like image 98
Jota455 Avatar answered Oct 20 '22 05:10

Jota455