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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - plehmz

Pages: [1]
1
Subst, Hello, for example in the app created n amount of tables and transform them into the QTStandardItemModel list, so there are also n quantity models, when I use LimeReport::ReportEngine *report=new LimeReport::ReportEngine; List<QStandardItemModel> models. for(int i=0; i<models.size();++i){
   report->dataManager()->addModel("model_"+QString::number(i), models, true);
}
then report->designReport(); or report->previewReport(); methods called,when report->designReport(); this method called , Lime Designer app opens, and in the left side of the designer, there is datasource panel, I can see there my added models,  here is my question,  how to display or place the data sources dynamically in the report page, because as I told models quantity is unlimited, 1 to ... n may be

2
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
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

5
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.

6
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.

7
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]