@@ -889,7 +889,7 @@ public ExcelWriter writeImg(File imgFile, int dx1, int dy1, int dx2, int dy2, in
889
889
public ExcelWriter writeImg (File imgFile , int imgType , int dx1 , int dy1 , int dx2 ,
890
890
int dy2 , int col1 , int row1 , int col2 , int row2 ) {
891
891
return writeImg (FileUtil .readBytes (imgFile ), imgType , dx1 ,
892
- dy1 , dx2 , dy2 , col1 , row1 , col2 , row2 );
892
+ dy1 , dx2 , dy2 , col1 , row1 , col2 , row2 );
893
893
}
894
894
895
895
/**
@@ -1097,30 +1097,57 @@ public ExcelWriter writeRow(Iterable<?> rowData) {
1097
1097
}
1098
1098
1099
1099
/**
1100
- * 给指定单元格赋值,使用默认单元格样式
1100
+ * 给指定单元格赋值,使用默认单元格样式,默认不是Header
1101
1101
*
1102
1102
* @param locationRef 单元格地址标识符,例如A11,B5
1103
1103
* @param value 值
1104
1104
* @return this
1105
1105
* @since 5.1.4
1106
1106
*/
1107
1107
public ExcelWriter writeCellValue (String locationRef , Object value ) {
1108
- final CellLocation cellLocation = ExcelUtil .toLocation (locationRef );
1109
- return writeCellValue (cellLocation .getX (), cellLocation .getY (), value );
1108
+ return writeCellValue (locationRef , value , false );
1110
1109
}
1111
1110
1112
1111
/**
1113
1112
* 给指定单元格赋值,使用默认单元格样式
1114
1113
*
1114
+ * @param locationRef 单元格地址标识符,例如A11,B5
1115
+ * @param value 值
1116
+ * @param isHeader 是否为Header
1117
+ * @return this
1118
+ * @since 5.1.4
1119
+ */
1120
+ public ExcelWriter writeCellValue (String locationRef , Object value , boolean isHeader ) {
1121
+ final CellLocation cellLocation = ExcelUtil .toLocation (locationRef );
1122
+ return writeCellValue (cellLocation .getX (), cellLocation .getY (), value , isHeader );
1123
+ }
1124
+
1125
+ /**
1126
+ * 给指定单元格赋值,使用默认单元格样式,默认不是Header
1127
+ *
1115
1128
* @param x X坐标,从0计数,即列号
1116
1129
* @param y Y坐标,从0计数,即行号
1117
1130
* @param value 值
1118
1131
* @return this
1119
1132
* @since 4.0.2
1120
1133
*/
1121
1134
public ExcelWriter writeCellValue (int x , int y , Object value ) {
1135
+ return writeCellValue (x , y , value , false );
1136
+ }
1137
+
1138
+ /**
1139
+ * 给指定单元格赋值,使用默认单元格样式
1140
+ *
1141
+ * @param x X坐标,从0计数,即列号
1142
+ * @param y Y坐标,从0计数,即行号
1143
+ * @param isHeader 是否为Header
1144
+ * @param value 值
1145
+ * @return this
1146
+ * @since 4.0.2
1147
+ */
1148
+ public ExcelWriter writeCellValue (int x , int y , Object value , boolean isHeader ) {
1122
1149
final Cell cell = getOrCreateCell (x , y );
1123
- CellUtil .setCellValue (cell , value , this .styleSet , false );
1150
+ CellUtil .setCellValue (cell , value , this .styleSet , isHeader );
1124
1151
return this ;
1125
1152
}
1126
1153
0 commit comments