0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-09-30 19:19:56 +03:00
This commit is contained in:
Sergey Popovichev
2016-02-17 10:19:50 +03:00
parent 81d855f52c
commit 0a16bed249
55 changed files with 906 additions and 193 deletions

BIN
demo/r1/lr1.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

BIN
demo/r1/lr6.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

View File

@@ -65,7 +65,8 @@ MainWindow::MainWindow(QWidget *parent) :
m_customers->first();
m_orders = new QSqlQuery(m_db);
m_orders->prepare("Select * from orders where CustomerID = :id");
m_orders->bindValue(":id",m_customers->value("CustomerID"));
int index = m_customers->record().indexOf("CustomerID");
m_orders->bindValue(":id",m_customers->value(index));
m_orders->exec();
};
}
@@ -160,7 +161,7 @@ void MainWindow::prepareData(QSqlQuery* ds, LimeReport::CallbackInfo info, QVari
data = ds->record().fieldName(info.index);
break;
case LimeReport::CallbackInfo::ColumnData:
data = ds->value(info.columnName);
data = ds->value(ds->record().indexOf(info.columnName));
break;
}
}
@@ -177,7 +178,7 @@ void MainWindow::slotChangePos(const LimeReport::CallbackInfo::ChangePosType &ty
if (!ds) return;
if (type == LimeReport::CallbackInfo::First) result = ds->first();
else result = ds->next();
m_orders->bindValue(":id",m_customers->value("CustomerID"));
m_orders->bindValue(":id",m_customers->value(m_customers->record().indexOf("CustomerID")));
m_orders->exec();
}