[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Rpt and Labels in same loop



I'm trying to print to a report and to 2 column labels in the same select
loop.  The report is fine, but the labels keep printing on top of each
other.

If anyone has a sample of doing this, that they wouldn't mind sharing, I'd
appreciate it.

Or, if anyone sees what I am doing wrong, I'd appreciate input on that,
too.  Here's the main code:

begin-setup
  declare-report nohs_rpt
    layout=rpt_layout
  end-declare

  declare-report nohs_lbl
    layout=lbl_layout
  end-declare

  declare-layout rpt_layout
    line-width = 133
    page-depth = 55
  end-declare

  declare-layout lbl_layout
    line-width = 81
    page-depth = 6
    formfeed   = no
    top-margin = 0
  end-declare
end-setup

...
     input $label_type  'Label Type (1,2, or 3 across)' maxlen=1 type=number
...

begin-procedure define_columns

  columns 1
  let #length = 30
  let #first_line = 1

  if $label_type = '2'
     columns 1 43
     let #first_line = 2
  end-if

  if $label_type = '3'
     columns 1 28 56
     let #length = 25
     let #first_line = 2
  end-if

end-procedure

...

begin-select
...
     do print_report
     do print_label

from  ...

begin-procedure print_report

  use-report nohs_rpt
  print &ssn                  (+1,1)
...

end-procedure

begin-procedure print_label

   use-report nohs_lbl

   print &sname                     (#first_line,1,#length)

   if &zpvnap1_street_line1 != ''
      print &zpvnap1_street_line1   (+1,1,#length)
   end-if
   if &zpvnap1_street_line2 != ''
      print &zpvnap1_street_line2   (+1,1,#length)
   end-if
   if &zpvnap1_street_line3 != ''
      print &zpvnap1_street_line3   (+1,1,#length)
   end-if
   if &csz != ''
      print &csz                    (+1,1,#length)
   end-if

   position (6,1)
   next-column at-end=newpage

end-procedure
...