2014-05-09 92 views
5

如果我滾動電子表格,行的標題字段被隱藏,我需要在同一電子表格中加粗的文本格式。凍結行並使用Google電子表格API設置樣式

問題
我可以設置通過電子表格API凍結行和風格 - 這可能嗎?

+1

也許可以使用Google-apps-script,但不可能使用gdata樣式google-spreadsheet-api – eddyparkinson

+0

我真的很喜歡這個功能。將標題行設置爲粗體和凍結會很好。 – Locane

回答

4

現在可以在v4 API中使用了。

這裏是Java API實現的參考: https://developers.google.com/resources/api-libraries/documentation/sheets/v4/java/latest/com/google/api/services/sheets/v4/model/GridProperties.html#setFrozenRowCount(java.lang.Integer)

這裏的API文檔: https://developers.google.com/sheets/reference/rest/v4/spreadsheets#gridproperties

如果你想這樣做瓦特/一個應用程序腳本,您可以和: https://developers.google.com/apps-script/reference/spreadsheet/sheet#setFrozenRows(Integer)

這是我由W/Ruby的API請求:

update_sheet_properties: { 
    properties: { 
    sheet_id: 'YOUR SHEET ID HERE', 
    grid_properties: { frozen_row_count: 4 } 
    }, 
    fields: 'gridProperties.frozenRowCount' 
} 
+0

順便說一下,我花了一段時間去「最終」的解決方案。將此答案與https://stackoverflow.com/questions/41547008/unknown-name-update-sheet-properties合併爲一個「完整解決方案」。請記住,在google API中,駱駝大小寫和下劃線符號是等效的。 – aiguofer

相關問題