如何在第2行插入空白行?
BatchUpdateSpreadsheetRequest requestBody = new
BatchUpdateSpreadsheetRequest();
requestBody.Requests = new List<Request>();
Request r = new Request();
requestBody.Requests.Add(r);
r.InsertDimension = new InsertDimensionRequest();
var dr = new DimensionRange();
dr.SheetId = 0;
dr.Dimension="ROW";
dr.StartIndex = 0;
dr.EndIndex = 3;
r.InsertDimension.Range = dr;
r.InsertDimension.InheritFromBefore = false;
SpreadsheetsResource.BatchUpdateRequest bur =
service.Spreadsheets.BatchUpdate(requestBody, spreadsheetId);
bur.Execute();
此代码添加了2张空白行,如表
中所指定我正在引用页面https://developers.google.com/sheets/api/samples/rowcolumn