You are reading help file online using chmlib.com
|
Rave Reports Visual Designer Hiding Bands or Components . |
Top Previous Next |
QUESTION: How do I hide a band based upon a DataText value?
SOLUTION: There is a "Visible" property for almost all of the components, including the band components. The description of this property is that it "determines whether the component will be printed or not. Typically, set through scripting in the OnBeforePrint or OnBeforeReport events". You do this by putting a script that sets the "visible" property in a parent of the component you want to control (or in another component). Do not put a script that changes visibility in the same component you want want to control as it will run until it is "false" but will not run after that as both the component and event "are no longer visible". This example shows a header band event that controlling the visibility of a footer band.
{ Event for HeaderBand.OnBeforePrint } function Header_OnBeforePrint(Self: TRaveBand); begin if Frac(DvInventoryLastEdit.AsFloat) < 0.25 then BandRowFooter.visible := True; elseif Frac(DvInventoryLastEdit.AsFloat) > 0.75 then BandRowFooter.visible := True; else BandRowFooter.visible := False; end if; end OnBeforePrint; |
You are reading help file online using chmlib.com
|