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

a perplexing columns question



Hi all,

I have a or two question about columns.  I am at a client site and they
are attempting to print information in two columns.  The data that gets
printed is coming from a 'long' column in the database.  Here's what the
code looks like.

begin-procedure Terms-and-Conditions
  columns 5 50
  move 55 to #bottom_line
  let #terms_count = 0
  let $new_page = 'Y'

begin-SELECT
   let #terms_count = #terms_count + 1
   display #current-line
   display #terms_count
TNC.DESCR
TNC.COMMENTS_2000
   if #current-line >= #bottom_line
     next-column goto-top=1 at-end=newpage
     let $new_page = 'Y'
   end-if

   if $new_page = 'Y'
     position (+1,1,)
     let $new_page = 'N'
   else
     position (+2,1,)
   end-if

   do Print-Terms

FROM PS_STD_COMM_TBL_PO TNC
WHERE TNC.SETID            = $Setid
AND   TNC.STD_COMMENT_TYPE = $Comment_Type
AND   TNC.EFFDT       <= (select max(EFFDT)
                          from  PS_STD_COMM_TBL_PO
                          WHERE TNC.SETID = $Setid
                          AND TNC.STD_COMMENT_TYPE = $Comment_Type
                          AND EFFDT <= SYSDATE)
AND   TNC.EFF_STATUS       ='A'

end-select

end-procedure !Terms-and-Conditions

begin-procedure Print-Terms

let $terms_count = to_char(#terms_count)
let $Print_Descr = $terms_count || '. ' || &TNC.DESCR

Print $Print_Descr            (,,)    bold
Print &TNC.COMMENTS_2000      (+1,1,) wrap 40 30 strip = /\^@<13>

end-procedure !Print-Terms

So, the $Print_Descr string can be *very* long.  It has a problem with
the output.  Here is what the out putlooks like (shortened to conserve
space)

page 1

1) xxxxxxxxxx                     3) xxxxx xxxxx
xxxx xx x x xxxx xxx xxxxxxx      xxx xxxxxxxxxx xxxx x xxxxxxxxx
xx xxxxxx xx xx x x xxxxxxxx.     xxxxx x x xxxxxxx x x x x x x x
                                  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2) xxxxxxxxxxxx                   xxxxxxxxx x xxxxxxxx x xxxxx
xxxxxxxxxxxx xx xxxxxxxxxxxx      xxxxxxx xx xxxxxxx xxxxxx xxxx
x xxxxxxxxx x xxxxxxxxx x.        xxxxxx x x xxxxxxx x x xxxxxxxxx

page 2
                                  xxxxxx x x xxxxxxx xx x xxxxx xx
xxxxxx x x xxxxx x x x xxxxxx
xxxxxx.

4) xxxxxxxxxxx xx xxxxxxx
xxxxxxxx x x xxxxxxxxx xxxxxx
xxxxxx xxxxx xxxxxx  xxxxxx xx
xxxx xxx xxxx xxxxxxx xxx xxxx
xx xxxxx xxxxx xxxxxxx xxxxx.

5) xxxxxx xxx xx xxxxxxx xxxx
xxxxxx xxxxx xxx xxxxxx xxxxxx
xxxx  xxxxx xxxxx xxxxxx xxx.

page 3

6) xxxxxxxxxx                     8) xxxxx xxxxx
xxxx xx x x xxxx xxx xxxxxxx      xxx xxxxxxxxxx xxxx x xxxxxxxxx
xx xxxxxx xx xx x x xxxxxxxx.     xxxxx x x xxxxxxx x x x x x x x
                                  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
7) xxxxxxxxxxxx                   xxxxxxxxx x xxxxxxxx x xxxxx
xxxxxxxxxxxx xx xxxxxxxxxxxx      xxxxxxx xx xxxxxxx xxxxxx xxxx
x xxxxxxxxx x xxxxxxxxx x.        xxxxxx x x xxxxxxx.

Notice what happens on page 2.  Obviously, what they are looking for is
equal columns on all pages.  I *think* this may be related to the fact
that the $Print_Descr variable is a long type and the wrap command
screws up sqr's internal counters or something.  We have identified a
possible fix that involves complicated LEN and SUBSTR and other commands
to fix this, but I was wondering if anyone out there had experienced
this before and had a simpler solution.

thanks in advance,
live long and prospect

clark


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com