0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-25 00:54:39 +03:00

CallbackDatasourse has been fixed

This commit is contained in:
Arin Alex 2016-03-14 16:16:19 +03:00
parent a373c28485
commit afa3613542

View File

@ -157,7 +157,7 @@ void MainWindow::prepareData(QSqlQuery* ds, LimeReport::CallbackInfo info, QVari
break; break;
case LimeReport::CallbackInfo::HasNext: case LimeReport::CallbackInfo::HasNext:
data = ds->next(); data = ds->next();
if (data.toBool()) ds->previous(); ds->previous();
break; break;
case LimeReport::CallbackInfo::ColumnHeaderData: case LimeReport::CallbackInfo::ColumnHeaderData:
if (info.index < ds->record().count()) if (info.index < ds->record().count())
@ -179,10 +179,12 @@ void MainWindow::slotChangePos(const LimeReport::CallbackInfo::ChangePosType &ty
{ {
QSqlQuery* ds = m_customers; QSqlQuery* ds = m_customers;
if (!ds) return; if (!ds) return;
if (type == LimeReport::CallbackInfo::First) result = ds->first(); if (type == LimeReport::CallbackInfo::First) {result = ds->first(); m_nextCount=0;}
else result = ds->next(); else {result = ds->next(); m_nextCount++;}
if (result){
m_orders->bindValue(":id",m_customers->value(m_customers->record().indexOf("CustomerID"))); m_orders->bindValue(":id",m_customers->value(m_customers->record().indexOf("CustomerID")));
m_orders->exec(); m_orders->exec();
}
} }
void MainWindow::slotGetCallbackChildData(LimeReport::CallbackInfo info, QVariant &data) void MainWindow::slotGetCallbackChildData(LimeReport::CallbackInfo info, QVariant &data)