0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-09-23 16:39:07 +03:00

Nested group bands render has been fixed

This commit is contained in:
Arin Alexander
2016-09-28 02:24:55 +04:00
parent 7c4d3bf8da
commit fc271d6a3b
5 changed files with 44 additions and 21 deletions

View File

@@ -42,18 +42,24 @@ namespace {
}
namespace LimeReport {
QString findDatasourceName(BandDesignIntf* band){
if (!band) return "";
if (!band->datasourceName().isEmpty()) return band->datasourceName();
else return findDatasourceName(band->parentBand());
}
QWidget *GroupFieldPropItem::createProperyEditor(QWidget *parent) const
{
ComboBoxEditor *editor = new ComboBoxEditor(parent,true);
editor->setEditable(true);
GroupBandHeader *item=dynamic_cast<GroupBandHeader*>(object());
if (item){
DataBandDesignIntf* dataBand = dynamic_cast<DataBandDesignIntf*>(item->parentBand());
BandDesignIntf* dataBand = dynamic_cast<BandDesignIntf*>(item->parentBand());
if (dataBand){
int propertyIndex = dataBand->metaObject()->indexOfProperty("datasource");
if (item && propertyIndex>0){
editor->addItems(item->reportEditor()->dataManager()->fieldNames(dataBand->property("datasource").toString()));
QString datasourceName = findDatasourceName(dataBand);
if (!datasourceName.isEmpty()){
editor->addItems(item->reportEditor()->dataManager()->fieldNames(datasourceName));
}
}
}