Add setRow and setColumn
This commit is contained in:
+16
-1
@@ -26,7 +26,22 @@ int main()
|
||||
sheet->write("C5", "=44+33", format2);
|
||||
sheet->write("D7", true, format2);
|
||||
|
||||
QXlsx::Format *format3 = workbook.addFormat();
|
||||
format3->setFontBold(true);
|
||||
format3->setFontColor(QColor(Qt::blue));
|
||||
format3->setFontSize(20);
|
||||
sheet->write(10, 0, "Hello Row Style");
|
||||
sheet->write(10, 5, "Blue Color");
|
||||
sheet->setRow(10, 40, format3);
|
||||
|
||||
QXlsx::Format *format4 = workbook.addFormat();
|
||||
format4->setFontBold(true);
|
||||
format4->setFontColor(QColor(Qt::magenta));
|
||||
for (int row=20; row<40; row++)
|
||||
for (int col=8; col<15; col++)
|
||||
sheet->write(row, col, row+col);
|
||||
sheet->setColumn(8, 15, 5.0, format4);
|
||||
|
||||
workbook.save(DATA_PATH"TestStyle.xlsx");
|
||||
workbook.save(DATA_PATH"TestStyle.zip");
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user