Label across

yvesarchambaultyvesarchambault Lacolle, Qu?©bec
edited 2:39AM in FastReport 4.0
Hi, I need a label report to print labels on a standard letter sheet so there is 2 label across and 8 down.
I use a masterdata band to put all 5 fields like:
Firstname + name
Address1
Address2
Town
PostalCode

The problem is that sometime Address2 is empty so I write code to make the line visible or not but this make the heigth of the label different of the one beside him so label are not all of the same height.

Is there a way to tell FR that all my label are of same dimension ?
Is it better for label to use dot matrix report ?
Do you have an example of label report ?

Thanks

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 2:39AM
    size the master band height to the size of the label height + the gap between labels ,
    use 1 memoview with expresions for each field. write code in the oad event of the memoview to stip empty spaces.

    [datsetname."Address1"]
    [datasetname."Address2"]

    procedure memoview1OnAfterData(Sender: TfrxComponent);
    var i: integer;

    begin
    for i := TfrxMemoView(Sender).Lines.Count - 1 downto 0 do
    begin
    if TfrxMemoView(Sender).Lines.Strings = '' then
    TfrxMemoView(Sender).Memo.Delete(i);
    end;
    end;
    set the page columns to 2 for vertical printing
    1 4
    2 5
    3 6

    for hrizontal set the bands columns
    1 2
    3 4

    if you look back about 3 yrs ago in the binaries news group
    you will find a self contained label demo topic.
  • yvesarchambaultyvesarchambault Lacolle, Qu?©bec
    edited 2:39AM
    Hi, after a lot of tests.
    wrote:
    size the master band height to the size of the label height + the gap between labels ,
    use 1 memoview with expresions for each field. write code in the oad event of the memoview to stip empty spaces.
    This is ok, I used 1 memoview and put all fields in it so this memo will have several lines.
    wrote:
    procedure memoview1OnAfterData(Sender: TfrxComponent);
    var i: integer;

    begin
    for i := TfrxMemoView(Sender).Lines.Count - 1 downto 0 do
    begin
    if TfrxMemoView(Sender).Lines.Strings = '' then
    TfrxMemoView(Sender).Memo.Delete(i);
    end;
    end;
    I don't understand why the number of line is always = 0.
    My TfrxMemoView object is named Memo1 so is used also the following code without success, always = 0
    procedure memoview1OnAfterData(Sender: TfrxComponent);
      var i: integer;
    begin
      for i := Memo1.Lines.Count - 1 downto 0 do
      begin
        if Memo1.Lines.Strings[i] = '' then
          Memo1.Memo.Delete(i);
      end;
    end;
    
    wrote:
    set the page columns to 2 for vertical printing
    1 4
    2 5
    3 6

    for hrizontal set the bands columns
    1 2
    3 4
    There is a columns property in the page setting, I had already set it to 2, that's ok
    but for horizontal I don't understand what you mean, sorry.

    Thanks for your help
  • gordkgordk St.Catherines On. Canada.
    edited 2:39AM
    vertical output is down one column then starts down at the top of the next column of the matrix.
    horizontal output is accross then down to the next row
  • yvesarchambaultyvesarchambault Lacolle, Qu?©bec
    edited 2:39AM
    procedure memoview1OnAfterData(Sender: TfrxComponent);
    var i: integer;

    begin
    for i := TfrxMemoView(Sender).Lines.Count - 1 downto 0 do
    begin
    if TfrxMemoView(Sender).Lines.Strings = '' then
    TfrxMemoView(Sender).Memo.Delete(i);
    end;
    end;
    I don't understand why the number of line is always = 0.

    Ok I have found my error and now it is working well.

    Thanks

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.