From 0d12ce50e575e9eee41764d5aae1dc999089f9a9 Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Thu, 6 Jun 2024 22:44:02 +0300 Subject: [PATCH] Background color rendering has been fixed --- demo_r1/demo_reports/1.4/1_simple_list.lrxml | 311 +++++++++++++----- ..._change_subband_visibility_by_script.lrxml | 150 ++++++--- limereport/lrreportrender.cpp | 2 +- 3 files changed, 345 insertions(+), 118 deletions(-) diff --git a/demo_r1/demo_reports/1.4/1_simple_list.lrxml b/demo_r1/demo_reports/1.4/1_simple_list.lrxml index 7eb6add..853794a 100644 --- a/demo_r1/demo_reports/1.4/1_simple_list.lrxml +++ b/demo_r1/demo_reports/1.4/1_simple_list.lrxml @@ -1,34 +1,38 @@ - + - + page1 - + + - - + - + + ReportPage1 - + - + DataBand1 - + - + TextItem2 - + DataBand1 - + + + + @@ -37,7 +41,7 @@ - + @@ -57,17 +61,25 @@ + + + + + - + TextItem3 - + DataBand1 - + + + + @@ -76,7 +88,7 @@ - + @@ -96,17 +108,25 @@ + + + + + - + TextItem4 - + DataBand1 - + + + + @@ -115,7 +135,7 @@ - + @@ -135,17 +155,25 @@ + + + + + - + TextItem5 - + DataBand1 - + + + + @@ -154,7 +182,7 @@ - + @@ -174,17 +202,25 @@ + + + + + - + TextItem6 - + DataBand1 - + + + + @@ -193,7 +229,7 @@ - + @@ -213,21 +249,33 @@ + + + + + ReportPage1 - + + + + + + + + customers @@ -238,21 +286,25 @@ + - + DataHeaderBand1 - + - + TextItem7 - + DataHeaderBand1 - + + + + @@ -261,7 +313,7 @@ - + @@ -281,17 +333,25 @@ + + + + + - + TextItem8 - + DataHeaderBand1 - + + + + @@ -300,7 +360,7 @@ - + @@ -320,17 +380,25 @@ + + + + + - + TextItem9 - + DataHeaderBand1 - + + + + @@ -339,7 +407,7 @@ - + @@ -359,17 +427,25 @@ + + + + + - + TextItem10 - + DataHeaderBand1 - + + + + @@ -378,7 +454,7 @@ - + @@ -398,17 +474,25 @@ + + + + + - + TextItem11 - + DataHeaderBand1 - + + + + @@ -417,7 +501,7 @@ - + @@ -437,41 +521,56 @@ + + + + + ReportPage1 - + + + + + DataBand1 + + + - + ReportHeader1 - + - + TextItem1 - + ReportHeader1 - + + + + @@ -480,7 +579,7 @@ - + @@ -500,37 +599,53 @@ + + + + + ReportPage1 - + + + + + + + + + - + PageFooter11 - + - + ShapeItem11 - + PageFooter11 - + + + + @@ -543,16 +658,19 @@ - + TextItem12 - + PageFooter11 - + + + + @@ -561,7 +679,7 @@ - + @@ -581,48 +699,76 @@ + + + + + ReportPage1 - + + + + + + + + + - + + + + - + + + + + + + + + + + + + - + datasources - + db QSQLITE @@ -632,10 +778,11 @@ + - + customers Select * from customer @@ -645,12 +792,22 @@ + - + - + function BeforeDataRender(){ + setVariable("TEMP", "11") + if (getField("customers.Company") === "Unisco") { + ReportPage1_DataBand1.backgroundColor = LimeReport.color("red") + setVariable("TEMP","FIIL") + } +} + +DataBand1.beforeRender.connect(BeforeDataRender) + diff --git a/demo_r1/demo_reports/1.4/7_change_subband_visibility_by_script.lrxml b/demo_r1/demo_reports/1.4/7_change_subband_visibility_by_script.lrxml index 0ebccf2..15b6aa0 100644 --- a/demo_r1/demo_reports/1.4/7_change_subband_visibility_by_script.lrxml +++ b/demo_r1/demo_reports/1.4/7_change_subband_visibility_by_script.lrxml @@ -1,44 +1,51 @@ - + - + page1 - + + - - + - + + ReportPage1 - + - + DataBand1 - + - + TextItem2 - + DataBand1 - + + + + $S{ -if ( $D{master.CustomerID} == "ALFKI") THIS.fontColor=QColor("red");""}$D{master.CompanyName} + if ( $D{master.CustomerID} == "ALFKI") + THIS.fontColor=LimeReport.color("red");""} + $D{master.CompanyName} +} - + @@ -58,17 +65,25 @@ if ( $D{master.CustomerID} == "ALFKI") THIS.fontColor=QColor("red");""}$D{master + + + + + - + TextItem1 - + DataBand1 - + + + + @@ -77,7 +92,7 @@ if ( $D{master.CustomerID} == "ALFKI") THIS.fontColor=QColor("red");""}$D{master - + @@ -97,21 +112,33 @@ if ( $D{master.CustomerID} == "ALFKI") THIS.fontColor=QColor("red");""}$D{master + + + + + ReportPage1 - + + + + + + + + master @@ -122,21 +149,25 @@ if ( $D{master.CustomerID} == "ALFKI") THIS.fontColor=QColor("red");""}$D{master + - + SubDetailBand1 - + - + TextItem5 - + SubDetailBand1 - + + + + @@ -145,7 +176,7 @@ if ( $D{master.CustomerID} == "ALFKI") THIS.fontColor=QColor("red");""}$D{master - + @@ -165,17 +196,25 @@ if ( $D{master.CustomerID} == "ALFKI") THIS.fontColor=QColor("red");""}$D{master + + + + + - + TextItem6 - + SubDetailBand1 - + + + + @@ -184,7 +223,7 @@ if ( $D{master.CustomerID} == "ALFKI") THIS.fontColor=QColor("red");""}$D{master - + @@ -204,65 +243,94 @@ if ( $D{master.CustomerID} == "ALFKI") THIS.fontColor=QColor("red");""}$D{master + + + + + ReportPage1 - + + + + + DataBand1 + + + + - + + + + - + + + + + + + + + + + + + - + datasources - + db QSQLITE - ./demo_reports/northwind.db + /home/alex/Work/C++/Projects/LimeReport/demo_r1/demo_reports/northwind.db + - + master Select * from customers limit 5 @@ -272,24 +340,26 @@ if ( $D{master.CustomerID} == "ALFKI") THIS.fontColor=QColor("red");""}$D{master + - + - SubDetailBand1.afterData.connect(SB1AfterData); + ReportPage1_SubDetailBand1.afterData.connect(SB1AfterData); function SB1AfterData(){ if (getField("master.CustomerID")=="ALFKI") { SubDetailBand1.isVisible = false; - TextItem2.fontColor = QColor("red"); + TextItem2.fontColor = LimeReport.color("red"); TextItem1.content = "sub band is not visible" } else { - TextItem5.fontColor = QColor("red"); + TextItem5.fontColor = LimeReport.color("red"); TextItem1.content = "sub band is visible" } } + diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index 9551811..2ae479b 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -606,7 +606,7 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign if (patternBand->isFooter()) m_lastRenderedFooter = patternBand; - bandClone->setBackgroundColor(makeBackgroundColor(patternBand)); + bandClone->setBackgroundColor(makeBackgroundColor(bandClone)); patternBand->emitBandRendered(bandClone); m_scriptEngineContext->setCurrentBand(bandClone);