If i scroll the spreadsheet ,header field of the rows are hidden and I need bold text format in the same spreadsheet.
Question
Can I set the freeze rows and styles through the spreadsheet api - Is it possible?
Go to the top menu in Google Sheets. Then, click on the “View” tab. And, select the “Freeze” option. From the drop-down, select the option to Freeze any number of rows.
Freeze and Unfreeze Columns and Rows in Google SheetsSelect the column or row you want to freeze. You can do this by clicking the column letter or row number. Click View from the menu. Go to Freeze and choose what you would like to freeze from the pop-out menu.
Open a spreadsheet in the Google Sheets app. Tap a cell, then drag the blue markers across nearby cells you want to select. In the "Text" tab, choose an option to format your text. In the "Cell" tab, choose an option to format your cell.
This is now available in the v4 API.
Here is the reference for the JAVA API implementation: 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)
Here is the API documentation: https://developers.google.com/sheets/reference/rest/v4/spreadsheets#gridproperties
If you want to do it w/ an App Script you can as well: https://developers.google.com/apps-script/reference/spreadsheet/sheet#setFrozenRows(Integer)
This is the request I made w/ the Ruby API:
update_sheet_properties: {
properties: {
sheet_id: 'YOUR SHEET ID HERE',
grid_properties: { frozen_row_count: 4 }
},
fields: 'gridProperties.frozenRowCount'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With