I have a Report Builder report that I'm trying to dynamically size the height of the detail band. Here's the code:
If dm.tblOutput.FieldByName('Unique').AsInteger = firstNonZero Then
ppDetailBand1.Height := 0.6979;
lnOptional.Visible := True;
lblOptionalPricing.Visible := True;
lnOptional.Visible := False;
lblOptionalPricing.Visible := False;
If dm.tblOutput.FieldByName('Unique').AsInteger > firstNonZero Then
ppDetailBand1.Height := 0.5000;
Basically, I'm trying to display/hide a line and a label on the detail band based on the FieldByName('Unique').As Integer value. If it's greater than firstNonZero, I just hide the label and line and shrink the Height of ppDetailBand1 to 0.5000 to eliminate white space.
This code works perfectly the first time the report is run in my program. But when it's run more than once, the ppDetailBand1.Height stays at 0.5000, so there's not enough space to display the line and label properly. I don't understand why it won't reset back to 0.6979 when the report is run a second time??!!
How can I make this work?