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

[sqr-users] on-break and multi-line printing



Apologies in advance for the length of this post.

I have been programming SQR a very long time, but I have never gotten the 
following to work.  I always end up doing my own on-break logic to get what 
I want.  Seems silly to have to do that;  someone here must have done it 
right by now.

Consider the following data, which arrives in the order (observation, sex 
desc, group) shown:

Observation     Sex     Group
=========================
Dopey           M       1
Dopey           M       2
Dopey           M       3
Dopey           F       1
Dopey           F       2
Dopey           F       3
Lazy            M       1
Lazy            M       2
Lazy            M       3
Lazy            F       1
Lazy            F       2
Lazy            F       3
Silly           M       1
Silly           M       2
Silly           M       3
Silly           F       1
Silly           F       2
Silly           F       3

I want to print like this:

Dopey
    M   1
        2
        3
    F   1
        2
        3

Lazy
     M  1
        2
        3
     F  1
        2
        3

Silly
    M   1
        2
        3
    F   1
        2
        3

That is, I want to skip a line when Observation changes, and then print the 
Observation on a line by itself. Then I want to print each sex-group 
combination on a line, but print the value of sex only when it changes or 
at top-of-page.  Of course I want to print Observation again at top-of-page 
if that happens in the middle of an Observation.

The closest I've gotten is this:

observation     (+1,1)  on-break print=change/top-page skiplines=1 level=1
sex             (+1,3)    on-break print=change/top-page level=2
group           (,14)

This is almost right, except that it skips a line after every sex-group 
line; apparently the "+1" spacing command is interpreted whether or not the 
value of sex is printed.  So I tried

observation     (+1,1)  on-break print=change/top-page skiplines=1 level=1
sex             (,3)    on-break print=change/top-page skiplines=1 level=2
groupnumber     (,14)

that is, taking out the +1 and adding skiplines.  This got rid of the blank 
line between sex-group lines, all right, but the first one doesn't skip, so 
it prints right on top of the observation line.

A further slight complication is that you don't want Observation to print 
as the last line on the page, with the first sex-group on the next.

Can anyone offer a solution?  PLEASE, PLEASE don't dream something up and 
say "try this." Believe me, I have tried everything I can think of, 
including next-listing with and without need= and no-advance. It's like 
squeezing Jello -- something always spurts out somewhere else.  But if you 
have solved this problem -- "always skip a line, but print only on changes" 
-- please tell me how.

Thanks to all for reading.

Dave





_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users