Git commit 892b4912d67e646356d3c368546dfb1f99f59b13 by Jaroslaw Staniek, on= behalf of Adam Pigg. Committed on 11/09/2018 at 22:08. Pushed by staniek into branch 'D15438'. Support params in report queries Summary: Prompt for parameters in queries that use them Quite a small change. Minor issues exist: 1. When opening in design view, the data source is opened and therefore the= parameters are prompted for (twice) Bug: https://bugs.kde.org/show_bug.cgi?id=3D379694 Test Plan: Open a report using paramters, ensure they are prompted for, and= ensure they are used correctly Reviewers: staniek Subscribers: Kexi-Devel-list Tags: #kexi Differential Revision: https://phabricator.kde.org/D15438 M +13 -3 src/plugins/reports/KexiDBReportDataSource.cpp https://commits.kde.org/kexi/892b4912d67e646356d3c368546dfb1f99f59b13 diff --git a/src/plugins/reports/KexiDBReportDataSource.cpp b/src/plugins/r= eports/KexiDBReportDataSource.cpp index fdeddbc47..4bea737ad 100644 --- a/src/plugins/reports/KexiDBReportDataSource.cpp +++ b/src/plugins/reports/KexiDBReportDataSource.cpp @@ -19,6 +19,8 @@ = #include "KexiDBReportDataSource.h" #include "kexireportpart.h" +#include +#include = #include #include @@ -49,6 +51,7 @@ public: KDbQuerySchema *originalSchema; KDbQuerySchema *copySchema; KDbEscapedString schemaSql; + QList currentParams; }; = KexiDBReportDataSource::KexiDBReportDataSource(const QString &objectName, = const QString &pluginId, @@ -120,9 +123,9 @@ bool KexiDBReportDataSource::open() } else if ( d->copySchema) { - qDebug() << "Opening cursor.." - << KDbConnectionAndQuerySchema(d->tempData->connectio= n(), *d->copySchema); - d->cursor =3D d->tempData->connection()->executeQuery(d->copyS= chema, KDbCursor::Option::Buffered); + //qDebug() << "Opening cursor.." + // << KDbConnectionAndQuerySchema(d->tempData->connect= ion(), *d->copySchema); + d->cursor =3D d->tempData->connection()->executeQuery(d->copyS= chema, d->currentParams, KDbCursor::Option::Buffered); } = = @@ -171,6 +174,13 @@ bool KexiDBReportDataSource::getSchema(const QString& = pluginId) qDebug() << d->objectName << "is a query.."; qDebug() << KDbConnectionAndQuerySchema(d->tempData->connectio= n(), *query); d->originalSchema =3D new KDbQuerySchema(*query, d->tempData->= connection()); + + bool ok; + KexiUtils::WaitCursorRemover remover; + d->currentParams =3D KexiQueryParameters::getParameters(0, d->= tempData->connection(), d->originalSchema, &ok); + if (!ok) { + return false; + } } = if (d->originalSchema) {