Solved QXlsx and column format
-
Hi, I need to set the type of a column to string. Now if I use the method
write(1, 1, "001");
I obtain the first top left cell as string with the value "001" correctly.
I need that the empty cells of the same column can accept the value "001" as string but, after an user have inserted "001", excel change the value to "1". -
QXlsx::Document xlsx; QXlsx::Format textFormat; textFormat.setNumberFormat(QStringLiteral("@")); xlsx.setColumnFormat(1, textFormat); xlsx.write(1, 1, QStringLiteral("001")); xlsx.setColumnWidth(1,8.43); qDebug()<< QStandardPaths::writableLocation(QStandardPaths::TempLocation); xlsx.saveAs(QStandardPaths::writableLocation(QStandardPaths::TempLocation)+ QLatin1String("/rowcolumn.xlsx"));
-
QXlsx::Document xlsx; QXlsx::Format textFormat; textFormat.setNumberFormat(QStringLiteral("@")); xlsx.setColumnFormat(1, textFormat); xlsx.write(1, 1, QStringLiteral("001")); xlsx.setColumnWidth(1,8.43); qDebug()<< QStandardPaths::writableLocation(QStandardPaths::TempLocation); xlsx.saveAs(QStandardPaths::writableLocation(QStandardPaths::TempLocation)+ QLatin1String("/rowcolumn.xlsx"));