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 - Arin Alex

Pages: 1 ... 49 50 [51] 52 53 ... 67
751
Discussion | Обсуждение / Re: Соединения с БД
« on: December 27, 2016, 08:01:06 PM »
Повторить не удалось. Можете в режиме отладки посмотреть место в котором крашится ?

752
Quote
if (db.open())
   {
      m_customers = new QSqlQuery(m_strQuerySql, db);
      QSqlQueryModel* customersModel = new QSqlQueryModel();
      customersModel->setQuery(m_strQuerySql);
      report->dataManager()->addModel("ds1", customersModel, true);
      report->loadFromFile(m_strReprotName);
      report->previewReport();
      delete customersModel;
   };
   delete report;

If you have added a model to the report and made the report an owner of this model then you must not to delete the model by yourself

753
Sergei_sR, Некоторый костыль я приделал :)  можете проверить. В дальнейшем прикручу скриптование бандов, покамест времени категорически не хватает 

754
I will thinking about it  :)

755
Hi
It's hard to say :) Your compiler knows it better :)
What I see at once and it's alarming me LimeReport::ReportEngine instance is created but not deleted  - it is memory leak.
Another part of the code, as I understand it, you've got from the demo and it is correct
Can I ask you why you use callbackDatasource instead sending a model to LimeReport ?

756
Sergei_sR, Проблему понял постараюсь поправить

757
Discussion | Обсуждение / Re: Image content as variable
« on: December 06, 2016, 12:58:19 AM »
Hi !
Thanks. I tried that, its not as clean as what you did on your categories example. Using Image we can take advantage of scale, keepAspectRation, etc.
I have added resourcePath property to ImageItem. From now you can use something like this ":report/images/pin" in this property

Something is strange, if I put a Image on Data Band and set Resource and Field on it, on the slot & signal mechanism I can set a QImage to data and it works fine. But if I put the Image on the group header, of footer, no matter if I put it on columnData or not, it gets fetched (more than once by the way) on the callback function but setting QImage to data (QVariant) does not work. Is it a bug or a limitation?

It's very strange :) I have tried to repeat that case but I didn't get same result.

I have used next callback slot :
Code: [Select]
void MainWindow::slotOneSlotDS(LimeReport::CallbackInfo info, QVariant &data)
{
    QStringList columns;
    columns << "Name" << "Value" << "Image";
    switch (info.dataType) {
            case LimeReport::CallbackInfo::RowCount:
                data = 4;
                break;
            case LimeReport::CallbackInfo::ColumnCount:
                data = columns.size();
                break;
            case LimeReport::CallbackInfo::IsEmpty:
                data = false;
                break;
            case LimeReport::CallbackInfo::ColumnHeaderData: {
                data = columns.at(info.index);
                break;
            }
            case LimeReport::CallbackInfo::ColumnData:
                if (info.columnName == "Image")
                    data = QImage(":/report//images/logo32");
                else {
                    data = info.columnName+" "+QString::number(info.index);
                }
                break;
            default: break;
        }
}

and attached report
and I got the result that you can see on the attached image

[вложение удалено администратором]

759
I think I understand  :)
At first in your code
Quote
Code: [Select]
case LimeReport::CallbackInfo::IsEmpty:
            qDebug() << "P2 IsEmpty - r " << this->_currentRow << " - " << info.columnName;
            data = true; //!ds->first();
            break;
data should be false otherwise callback dataset will be empty

Secondly all fields which you want to use in the report should be described by ColumnHeaderData

Code: [Select]
void ReportsGenerator::LRGetCallbackData2(LimeReport::CallbackInfo info, QVariant &data) {
    switch (info.dataType) {
        case LimeReport::CallbackInfo::RowCount:
            qDebug() << "P2 RowCount - i" << info.index << " - " << info.columnName << " - r " << this->_currentRow;
            data = 4;
            break;
        case LimeReport::CallbackInfo::ColumnCount:
            qDebug() << "P2 ColumnCount - i" << info.index << " - " << info.columnName << " - r " << this->_currentRow;
            data = 5;
            break;
        case LimeReport::CallbackInfo::IsEmpty:
            qDebug() << "P2 IsEmpty - r " << this->_currentRow << " - " << info.columnName;
            data = false; //!ds->first();
            break;
        case LimeReport::CallbackInfo::ColumnHeaderData: {
            switch(info.index) {
                case 0:
                    data = "Name1";
                    break;
                case 1:
                    data = "Value1";
                    break;
                case 2:
                    data = "Name2";
                    break;
                case 3:
                    data = "Value2";
                    break;
                case 4:
                    data = "SamplesGroup";
                    break;
            }
            qDebug() << "P2 HeaderData - " << info.index << " - " << data.toString();
            break;
        }
        case LimeReport::CallbackInfo::ColumnData:
            qDebug() << "P2 Requested - i - " << info.index << " - " << info.columnName << " - r " << this->_currentRow;
            if (info.columnName == "SamplesGroup")
                data = "Resultados Gerais";
            else {
                data = "Data";
            }
            break;
        default: break;
    }
}



760
Hi maurosanjo !
The GroupBandHeader and GroupBandFooter bands are designed to create a data grouping
and you must specify a field that will be used for grouping (groupField property of the GroupBandHeader)
when value in that field is changed new group is created.
There is a sample how to use GroupBandHeader and GroupBandFooter. (only for version 1.4 and higher)
If you want simple data header and footer you should use DataHeader and DataFooter bands

[вложение удалено администратором]

761
Can you send me an example ?

762
Discussion | Обсуждение / Re: Image content as variable
« on: December 02, 2016, 02:34:37 AM »
Hi !
Thank you for your kind words to the LimeReport :)
You can use TextItem for printing images from application resources. To do this you should allowHtml in TextItem and specify the path to the resource like this <img source=":/report//images/pin"/>

763
Сейчас гляну :) Кусок кода где валится можешь кинуть ?

764
Дарк куда-то пропал :) 
Хотя Дарк писал
Quote
Если просто $D{table_model.4} выводит все правильно (0, 1, 2), а с условием все время в else попадает
$S{
if({$D{table_model.4}}=='0')
"<img src='/home/dark/Pictures/Icons/chip_1.png'>"
else ""
}
Из этого я делаю вывод, что данные проброшены нормально

765
Subst, Да не, специально сейчас пересобрал версию с SF, именно этих глюков я не наблюдаю.
SF конечно надо обновить :) Я вот просто не пойму толь 1.3.12 запилить на мастере толь уже 1.4 в мастер смержить и выложить на SF

Pages: 1 ... 49 50 [51] 52 53 ... 67