CanShrink Option

Hello,

I am trying to shrink a field when no data exists. In my case I have several address fields. If my second and third address lines are blank I want the fields below to move up and not print blank lines.

I have found some references to a CanShrink property for the .Net version. Is there something similar for the VCL version?

End users are going to be customizing this report so I really don't want a lot of script to make this work.

So for my specific example I have
[Address Line 1]
[Address Line 2]
[Address Line 3]
[City]
[State][Zip]

If Address Line 2 and 3 are blank I don't want blank lines between Line 1 and the City field.

Comments

  • fcsfcs
    edited 2:13AM
    Hello,

    You can put [Address Line 1] and [Address Line 2] and [Address Line 3] into one Memo and set the StretchMode = smMaxHeight.
    The other way is use for [Address Line 2] and [Address Line 3] code like this (my Z_Uwagi = yours AddressLine2)
    procedure Z_UwagiOnBeforePrint(Sender: TfrxComponent);
    begin
     if trim(<Z_Uwagi>)='' then begin
       Z_Uwagi.Lines.clear;
       Z_Uwagi.height:=0;
       Z_Uwagi.Printable:=false;
      // Child2.Height:=0;  // set the height of band to 0 in your case AdressLine2 and 3 should be store on child bands  
     end else begin
       Z_Uwagi.Printable:=true;
       // Child2.Height:=0.5;
     end;'
    end;
    

    Regards
    Michal

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.