3
votes

So I've started migrating items over to the the new google spreadsheets to take advantage of some of the limits being lifted.

I've run into a problem with the new spreadsheets not having an option to publish specific cells rather then the entire sheet. Ideally, I just want a specific cell range published so when it's on the site it remains clean and contained without the need to scroll. I've tried to fiddle with the links and the src to match the old code but it doesn't seem to work.

Here is an example of the old code that works:

<iframe width='544' height='249' frameborder='0' src='https://docs.google.com/spreadsheet/pub?key=0AkC6q_6fzB6WdDNGeTk2X1RGNzBJLVhaaWpld19FUlE&single=true&gid=4&range=B1%3AE11&output=html&widget=false'>

The publish dialogue in the old spreadsheet actually has the ability to select specific cell ranges where the new one doesn't appear to have that option.

Here is a sample of the new spreadsheet code that doesn't work:

<iframe  width='544' height='249' src="https://docs.google.com/spreadsheets/d/1HqS9DqBK4r7Qtff8Ecy7wKRPsiSUW_03i9x95OwuW74/pubhtml?widget=true&amp;headers=false"></iframe>

Finally here is a fiddle comparing the two: http://jsfiddle.net/blintster/N2qbv/

As you can see the first example is much cleaner.

3
Did you ever find a solution to this. I've run into the same problem with my sheets.DarkUFO
@DarkUFO - Not that I can find. I believe the solution posted below allows you to pull the data and create your own tables - but that could result in a significant amount of html work depending on how much formatting is in your spreadsheet. Hopefully other solutions (or google fix) comes soon.blintster
Here is a thread were a few people are discussing the problem: productforums.google.com/forum/#!topic/docs/Hhaeq9K3Q8gblintster

3 Answers

3
votes

SOLVED:

This is the code I used for the new google spreadsheets to publish only the cell range I wanted

<iframe width = "431"
    height = "21"
    frameborder = "0"
    scrolling = "no"
    src = "https://docs.google.com/spreadsheets/d/1HKjkaqDlCJwycKH4mlPnrZHzx4RMOyY6JXCsmH4/pubhtml?single=true&amp;gid=35&amp;range=D10:M10&amp;widget=false&amp;chrome=false"
    style = "overflow: hidden;"> 
</iframe>

Replace the spreadsheet key with your own (go to Publish to the Web to find your own spreadsheet key)

gid=35 (This is the sheet id, you'll have to find this by publishing a sheet and seeing what number it comes up with)

range=D10:M10 (This is your cell range you want to show - no longer do you need to use a named range)

0
votes

It is still possible to get specific cells using the feeds for the old Data apis but you then have to do some work in javascript to format the table from the json representation but you do end up with full control of the look. Here is a working feed:

https://spreadsheets.google.com/feeds/cells/19WD1dqLpctWWfDn0Gazs3pJz8OiV_P55QIXZcQ1mznk/od6/public/values?min-row=2&max-row=5&min-col=1&max-col=2&alt=json-in-script&callback=x

There are a few posts around dealing with the json-p eg Use a Google Spreadsheet as your JSON backend

0
votes

M. Amedeo Tumolillo posted a way to embed iframes from the the new Google Sheets: http://hellotumo.com/2012/11/28/how-to-embed-specific-cells-when-embedding-a-google-spreadsheet/