Page 1 of 1

Dynamically Enable/Disable a Report Band (object)

Posted: Sun Jan 10, 2016 3:21 pm
by ybrit
How can you enable or disable a report object prior to render with source code?

Like disable/enable a detail field or GroupHeader/Footer.

The goal is to have one report spec that covers a few display options.

Re: Dynamically Enable/Disable a Report Band (object)

Posted: Mon Jan 11, 2016 1:11 pm
by HighAley
Hello.

You could do this in different ways.
You could find a component in the report and change its property.

Code: Select all

var gHeader = report.getComponentByName("GroupHeaderBand1");
gHeader.enabled = false;
As other way you could do it in BeforePrint event.

Thank you.

Re: Dynamically Enable/Disable a Report Band (object)

Posted: Mon Jan 11, 2016 7:28 pm
by ybrit
Thank you.

How do you refer to a field in a component such as a field in DataBand1 .. is this the name in the design properties?

Re: Dynamically Enable/Disable a Report Band (object)

Posted: Tue Jan 12, 2016 7:04 am
by HighAley
Hello.

Yes, this is a name of the component.
We should notice that this way you get component from report template but not from the rendered report.

Thank you.

Re: Dynamically Enable/Disable a Report Band (object)

Posted: Tue Jan 12, 2016 9:10 pm
by ybrit
This is great .. it works as very well.

Thank you

Re: Dynamically Enable/Disable a Report Band (object)

Posted: Wed Jan 13, 2016 6:09 am
by HighAley
Hello.

We are always glad to help you.
Let us know if you need help.

Thank you.