QXlsx
QXlsx copied to clipboard
how to write a hyper link in a cell
trafficstars
I want write some text in a cell with hyperlink
Dear @Aries1989
-
Sorry for not responding for a long time. I am currently working in a place where the internet is not available. Internet access is only a few days a month. (It's the 21st century now...)
-
See TestExcel example.
int WriteExcel(bool isTest)
{
if (!isTest)
return (-1);
Document xlsx;
xlsx.write("A1", "Hello QtXlsx!"); // current file is utf-8 character-set.
xlsx.write("A2", 12345);
xlsx.write("A3", "=44+33"); // cell value is 77.
xlsx.write("A4", true);
xlsx.write("A5", "http://qt-project.org");
xlsx.write("A6", QDate(2013, 12, 27));
xlsx.write("A7", QTime(6, 30));
xlsx.write("A8", QDateTime(QDate(2049,7,23), QTime(23,5,32), Qt::LocalTime));
if (!xlsx.saveAs("WriteExcel1.xlsx"))
{
qDebug() << "[WriteExcel1] failed to save excel file";
return (-2);
}
return 0;
}