Dynamically Enable/Disable a Report Band (object)

Stimulsoft Reports.JS discussion
Post Reply
ybrit
Posts: 21
Joined: Fri Oct 30, 2015 11:51 pm

Dynamically Enable/Disable a Report Band (object)

Post 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.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post 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.
ybrit
Posts: 21
Joined: Fri Oct 30, 2015 11:51 pm

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

Post 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?
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post 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.
ybrit
Posts: 21
Joined: Fri Oct 30, 2015 11:51 pm

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

Post by ybrit »

This is great .. it works as very well.

Thank you
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post by HighAley »

Hello.

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

Thank you.
Post Reply