QXlsx icon indicating copy to clipboard operation
QXlsx copied to clipboard

how to write a hyper link in a cell

Open Aries1989 opened this issue 5 years ago • 1 comments
trafficstars

I want write some text in a cell with hyperlink

Aries1989 avatar Sep 15 '20 04:09 Aries1989

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; 
}

j2doll avatar Oct 11 '20 03:10 j2doll