Hi,
Let me explain mey way:
I will add these lines to header file
//For Lime Report
QSqlQueryModel *raporModel;
LimeReport::ReportEngine *mRapor;
//
And in the source code:
// to use LimeReport and fill the data into Model.
mRapor = new LimeReport::ReportEngine(this);
raporModel = new QSqlQueryModel(this);
raporModel->setQuery("SELECT * FROM tartim WHERE belge_no = '" + belge_no + "' ;");
//To load the LimeReport file.
if(!mRapor->loadFromFile(fileName))
{
QMessageBox::critical(this, "Hata!", fileName + " Dosyasına ulaşılamadı!");
return;
}
//And push the Model to Limereport. Because you fill the data to Model before.
mRapor->dataManager()->addModel("tartim", raporModel, false); //Use third parameter false if you don't want to delete Model after finishing job.
mRapor->setResultEditable(false);
mRapor->previewReport();
//mRapor->designReport();
//mRapor->printReport();
That's all. It's very easy. But the important thing create the LimeReport instance and the model just in time. Create them and use them. Otherwise the speed is going down.
Regards,
Mucip:)