Welcome, Guest. Please login or register.
Did you miss your activation email?

Recent Posts

Pages: [1] 2 3 ... 10
1
I don’t fully understand what you want to achieve; when you register a data source, you just indicate where to get the data from. When you call report generation, this data will be used in the form in which it is in the data source
2
Discussion | Обсуждение / the data sources to be dynamically allocation
« Last post by plehmz on June 20, 2024, 02:00:29 PM »
if datasources are dynamically created every time, this means, the app created by QT c++ user may create n tables, and export to the lime report by IDataSourceManager::addModel(const QString& name, QAbstractItemModel *model, bool owned) command. I want the data sources to be dynamically allocated. is it possible?
3
Hi!

look the
Code: [Select]
IDataSourceManager::addModel(const QString& name, QAbstractItemModel *model, bool owned)
and look UserManualEng.pdf for "External data sources"
, I did this, and the model was shown in the lime report designer datasources tab, I placed this model report page. everything worked. But, my models dynamically changed, sometimes 1 sometimes 10 or n quantity, I want to dynamically place the model in the report page
4
Hi!

look the
Code: [Select]
IDataSourceManager::addModel(const QString& name, QAbstractItemModel *model, bool owned)
and look UserManualEng.pdf for "External data sources"
5
I have created an app, when users create multiple tables, in form multiple tableviews created and showed. How can be handled to set dynamically datasources tables to the lime report
6
Hi. You have to set datasource property on the databand that will point to the data source
7
Hi!

QTableView dot't store any data it's own.
The data exists in the model.
This model You have been added to report.

Now You can just call
Code: [Select]
report->designReport() to show LRDesigner, and your model must be shown in datasources
thank you, I tried and succeeded , I saw the model in the data sources panel, and When I tried with columns, it shows only the first item of the model, how can I achieve this to show all items which I set with qt created app.
8
Subst, thank you, I tried and succeeded , I saw the model in the data sources panel, and When I tried with columns, it shows only the first item of the model, how can I achieve this to show all items which I set with qt created app.
9
Hi!

QTableView dot't store any data it's own.
The data exists in the model.
This model You have been added to report.

Now You can just call
Code: [Select]
report->designReport() to show LRDesigner, and your model must be shown in datasources
10
I want to set QTableView data to Lime report, I tried with this code void MainWindow::loadJsonData()
{
    QFile file(":/data/sample.json");
    if (!file.open(QIODevice::ReadOnly))
    {
        qWarning("Couldn't open the file.");
        return;
    }

    QByteArray data = file.readAll();
    QJsonDocument document = QJsonDocument::fromJson(data);
    QJsonArray jsonArray = document.array();

    model->setColumnCount(3);
    model->setHeaderData(0, Qt::Horizontal, "Name");
    model->setHeaderData(1, Qt::Horizontal, "Age");
    model->setHeaderData(2, Qt::Horizontal, "City");

    for (const QJsonValue & value : jsonArray)
    {
        QJsonObject obj = value.toObject();
        QList<QStandardItem *> items;
        items.append(new QStandardItem(obj["name"].toString()));
        items.append(new QStandardItem(QString::number(obj["age"].toInt())));
        items.append(new QStandardItem(obj["city"].toString()));
        model->appendRow(items);
    }
}

void MainWindow::on_generateReportButton_clicked()
{
    report->loadFromFile(":/reports/sample_report.lrxml");
    report->dataManager()->addModel("jsonData", model, true);
    report->previewReport();
}
but I don't know how to handle with limereport designer,
Pages: [1] 2 3 ... 10