How i can use Report Functionality in Qt As Like Microsoft Report Viewer
-
i am using Qt 5.12.3 Version
And Kit Name Is : MSVC 2015 x64 BitDescription :
i have data in MySQL and i want to generate Report based that Data
also I want to display Report in Qt ControlSo please
Help Me To Slove this Problem -
Hi,
You might want to be more explicit about the kind of help you would like.
-
Hi
Qt does not come with any dedicated reporting tools but you can use
https://sourceforge.net/projects/qtrpt/
or
https://sourceforge.net/projects/qreport/
or
https://sourceforge.net/projects/limereport/ -
hello Friends
i am try to generate report using QTRPT
i am finished allmost work
but Data dosen't display in report my code is :void Report_Time::on_btn_generate_clicked()
{
QSqlQuery query(db);
query.prepare("SELECT * FROM test");
if(!query.exec())
{
qDebug()<<"Error in Query"<<endl;
}
else
{
QtRPT *report = new QtRPT(this);
while(query.next())
{
qDebug()<<query.value(0).toString()<<endl;
qDebug()<<query.value(1).toString()<<endl;
qDebug()<<query.value(2).toString()<<endl;report->loadReport(":/new/TestReport.xml"); connect(report,&QtRPT::setValue,[&](const int recNo, const QString paramName, QVariant ¶mValue, const int reportPage) { (void) reportPage; if(paramName == "id") { paramValue=(((recNo)),query.value(0).toString()); qDebug()<<paramValue<<endl; } if(paramName == "name") { paramValue=(((recNo)),query.value(1).toString()); qDebug()<<paramValue<<endl; } if(paramName == "city") { paramValue=(((recNo)),query.value(2).toString()); qDebug()<<paramValue<<endl; } }); } report->printExec(); }
}
My Output Is :