From 8d6cf97a4813dc3c6b198efa63e7828584836fd0 Mon Sep 17 00:00:00 2001 From: wartime Date: Sun, 15 Dec 2019 14:23:27 +0800 Subject: [PATCH] Increase line number for every group header --- limereport/lrreportrender.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index c17973d..f0a4c5a 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -1,4 +1,4 @@ -/*************************************************************************** +/*************************************************************************** * This file is part of the Lime Report project * * Copyright (C) 2015 by Alexander Arin * * arin_a@bk.ru * @@ -636,10 +636,23 @@ void ReportRender::renderDataBand(BandDesignIntf *dataBand) bandDatasource->next(); datasources()->setReportVariable(varName,datasources()->variable(varName).toInt()+1); - foreach (BandDesignIntf* band, dataBand->childrenByType(BandDesignIntf::GroupHeader)){ - QString groupLineVar = QLatin1String("line_")+band->objectName().toLower(); - if (datasources()->containsVariable(groupLineVar)) - datasources()->setReportVariable(groupLineVar,datasources()->variable(groupLineVar).toInt()+1); + + QList bandList; + QList childList; + + bandList = dataBand->childrenByType(BandDesignIntf::GroupHeader); + while (bandList.size() > 0) + { + childList.clear(); + foreach (BandDesignIntf* band, bandList) + { + childList.append(band->childrenByType(BandDesignIntf::GroupHeader)); + + QString groupLineVar = QLatin1String("line_")+band->objectName().toLower(); + if (datasources()->containsVariable(groupLineVar)) + datasources()->setReportVariable(groupLineVar,datasources()->variable(groupLineVar).toInt()+1); + } + bandList = childList; } renderGroupHeader(dataBand, bandDatasource, false);