Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Suppressing blank information

edited May 2002 in General
At the top of a report I have:

Name
Address1
Address2
City, State Zip

It currently prints a blank line for Address2 if there is no info in that
field.

How do make City, State Zip print right below Address1 if there is no
Address2

TIA,
Rob

Comments

  • edited May 2002
    Supress the visibility of the field if there is no data. ie.

    procedure TForm1.Address2Print(Sender: TObject);
    begin

    Address2.Visible := not(ppReport1.Pipeline['Address2'] = '');

    end;

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited May 2002
    Thanks for the quick response;

    This seems to behave the same. It already printed nothing where Address2 was
    to go. The problem is there is a space between Address1 and City, i.e:

    John Doe
    123 Main St.

    Washington, D.C. 20010


    What I want is:

    John Doe
    123 Main St.
    Washington, D.C. 20010

    I am just trying out the demo and have probably missed something easy. Is
    there a setting I need for my CityStateZip field that indicates to move up?



    "Alexander Kramnik (Digital Metaphors)" wrote
  • edited May 2002
    There are two options for supressing that space. One is to manually move up
    the other elements (City, State, Zip) when the Address2 field is empty. The
    other options is to place a Memo component instead, set it to Strech, and
    build the address string. ie

    lsAddress := Pipeline['Name'] + #10#13;
    lsAddress := lsAddress + Pipeline['Address1'] + #10#13;
    if (Pipeline['Address1'] <> '') then
    lsAddress := lsAddress + Pipeline['Address2'] + #10#13;
    lsAddress := lsAddress + Pipeline['City'] + ', ' Pipeline['State'] + ' '
    Pipeline['Zip'] + #10#13;

    ppMemo1.Lines := lsAddress;

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited May 2002
    You can also take a look at Demo 33 in the main Reports demo in
    Rbuilder/Demos/Reports.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

    "Alexander Kramnik (Digital Metaphors)" wrote
  • edited May 2002
    Thanks that works great.

    Sorry to bother you but I have one other problem. The space between the
    lines in the memo seems very large. I tried to adjust this using the
    leading property, but do not see any difference. I have used values
    from -.25 to -1000 with no noticable difference. There is no mention in the
    help what the units of the number is (twips?)

    -Rob
    "Alexander Kramnik (Digital Metaphors)" wrote
  • edited May 2002

  • edited May 2002
    The Leading property is in report units. There is a mamimum negative value
    past which the Leading setting will be ignored (when the text starts to
    overlap) so it is possible that -0.25 is too much.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

This discussion has been closed.