Hi!
The simplest way to add an external data source is to realize one slot callback data source.
Just do something like this:
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::ColumnHeaderData: {
data = columns.at(info.index);
break;
}
case LimeReport::CallbackInfo::ColumnData:
qDebug() << info.index <<info.columnName;
if (info.columnName == "Image")
data = QImage(":/report//images/logo32");
else {
data = info.columnName+" "+QString::number(info.index);
}
break;
default: break;
}
}
.....
callbackDatasource = report->dataManager()->createCallbackDatasource("oneSlotDS");
connect(callbackDatasource, SIGNAL(getCallbackData(LimeReport::CallbackInfo,QVariant&)),
this, SLOT(slotOneSlotDS(LimeReport::CallbackInfo,QVariant&)));