LimeReport Forum
General Category | Основное => Discussion | Обсуждение => Topic started by: corveejet on February 03, 2021, 12:44:11 pm
-
Hi everyone,
My problem is that: i want to hide a GroupHeaderBand (which contains different shapes and a Text label) depending on if my datasource is empty.
I try to make in condition fields of GroupHeaderBand :
$S{
THIS.isVisible = true
if($D{recipe.heading5} === "")
{
THIS.isVisible = false
}
}
but no success.
Can you help me please ?
Regards.
-
I think so.. try to look the printIsEmpty property of bands. It must be to false.
And to labels too
-
thanks for your answer,
I have already put that. I not describe all. I arrived to hide a single goupbandheader (1 groupbandheader connected to band) but i not arrive to hide several groupbandheader (groupbandheader connect to another which is connect to band for example) or i have a strange behavior with a groupheader hide and other not. I put my lrxml in attachments if you want.
-
corveejet, Hi!
If you need to hide a whole band you can use beforePrint event from this band.
For example, you can write in the init script something like this:
ReportPage1_GroupBandHeader1.beforeRender.connect(BFP);
function BFP(){
ReportPage1_GroupBandHeader1.isVisible = getField("orders.OrderID")!="10062"
}
-
Arin Alex, Thanks.
It's work perfectly.
Just another question, i'm not very good in js but is there a better way to connect each object to different function?
Reportpage1_GroupBandHeader24.beforeRender.connect(BFP_heading1);
Reportpage1_GroupBandHeader25.beforeRender.connect(BFP_heading2);
function BFP_heading1()
{
Reportpage1_GroupBandHeader24.isVisible = (getField("recipe.heading1") != "");
}
function BFP_heading2()
{
Reportpage1_GroupBandHeader25.isVisible = (getField("recipe.heading2") != "");
}
I would like somethings like this, but it doesn't work.
Reportpage1_GroupBandHeader24.beforeRender.connect(BFP(Reportpage1_GroupBandHeader24 "recipe.heading1"));
function BFP(object, header)
{
object.isVisible = (getField(header) != "");
}
regards.
-
corveejet,
You can use something like this:
Reportpage1_GroupBandHeader1.beforeRender.connect(()=>{BF(Reportpage1_GroupBandHeader1, "master.CustomerID")})
function BF(object, field){
object.isVisible = (getField(field) != "ANATR")
}
-
Arin Alex, ok thank you very much.
This Topic is closed now. ;)