diff --git a/limereport/lrscriptenginemanager.cpp b/limereport/lrscriptenginemanager.cpp index 3c16fbb..94dc11f 100644 --- a/limereport/lrscriptenginemanager.cpp +++ b/limereport/lrscriptenginemanager.cpp @@ -1797,12 +1797,28 @@ QObject* ComboBoxWrapperCreator::createWrapper(QObject *item) return 0; } +bool DatasourceFunctions::first(const QString& datasourceName) +{ + if (m_dataManager && m_dataManager->dataSource(datasourceName)){ + m_dataManager->dataSource(datasourceName)->first(); + return true; + } + return false; +} + bool DatasourceFunctions::next(const QString &datasourceName){ if (m_dataManager && m_dataManager->dataSource(datasourceName)) return m_dataManager->dataSource(datasourceName)->next(); return false; } +bool DatasourceFunctions::prior(const QString& datasourceName) +{ + if (m_dataManager && m_dataManager->dataSource(datasourceName)) + return m_dataManager->dataSource(datasourceName)->prior(); + return false; +} + bool DatasourceFunctions::isEOF(const QString &datasourceName) { if (m_dataManager && m_dataManager->dataSource(datasourceName)) @@ -1810,6 +1826,14 @@ bool DatasourceFunctions::isEOF(const QString &datasourceName) return false; } +bool DatasourceFunctions::invalidate(const QString& datasourceName) +{ + if (m_dataManager && m_dataManager->dataSource(datasourceName)){ + m_dataManager->dataSourceHolder(datasourceName)->invalidate(IDataSource::DatasourceMode::RENDER_MODE); + return true; + } + return false; +} #ifndef USE_QJSENGINE void ComboBoxPrototype::addItem(const QString &text) diff --git a/limereport/lrscriptenginemanager.h b/limereport/lrscriptenginemanager.h index 30c5d38..bbdef99 100644 --- a/limereport/lrscriptenginemanager.h +++ b/limereport/lrscriptenginemanager.h @@ -302,8 +302,12 @@ class DatasourceFunctions : public QObject{ Q_OBJECT public: explicit DatasourceFunctions(IDataSourceManager* dataManager): m_dataManager(dataManager){} + Q_INVOKABLE bool first(const QString& datasourceName); Q_INVOKABLE bool next(const QString& datasourceName); + Q_INVOKABLE bool prior(const QString& datasourceName); Q_INVOKABLE bool isEOF(const QString& datasourceName); + Q_INVOKABLE bool invalidate(const QString& datasourceName); + private: IDataSourceManager* m_dataManager; };