public Request setCellsStyle(int sheetId, int startRowIndex, int endRowIndex, int startColumnIndex, int endColumnIndex, boolean center, int fontSize, String fontFamily, boolean bold) { return new Request().setRepeatCell(new RepeatCellRequest() .setCell(new CellData().setUserEnteredFormat(new CellFormat().setHorizontalAlignment(center ? "CENTER" : null).setTextFormat( new TextFormat().setFontSize(fontSize).setFontFamily(fontFamily).setBold(bold)))) .setRange(new GridRange().setSheetId(sheetId) .setStartRowIndex(startRowIndex).setEndRowIndex(endRowIndex) .setStartColumnIndex(startColumnIndex).setEndColumnIndex(endColumnIndex)).setFields("*")); }
)) .setFormat(new CellFormat().setTextFormat( new TextFormat().setForegroundColor( new Color().setRed(0.8f))