Question

Joel J.J. Heber

New Member
I am making a report, and wish to have it wider

The output is like this

asdfasdf asdfasdfasdf asdfasdf
sdsd sdsdd sdsdd

where the characters are fields.......but i want them like this

asdfasdf asdfasd asdad asdd asdad asdasd asd asdasdsdasd

here is the code............



define stream s1.

define variable v-filename as character initial
"/ecs/pdb/users/joh/taxidreport.txt".

define temp-table temp-table-tax-id
field tmp-prod-recno like so-trans-d.prod-recno
field tmp-product-id like prod-exp.product-id
field tmp-description like prod-exp.description
field tmp-reoccur as integer
field tmp-sell-qty as decimal format "zz,zzz,zz9.9999-"
field tmp-sell-amount as decimal format "zz,zzz,zz9.9999-"
field tmp-tax-lost as decimal format "zz,zzz,zz9.9999-"
field tmp-complete as logical
field tmp-back-order as decimal format "zz,zzz,zz9.9999-"
Index index-tmp is Primary tmp-prod-recno Ascending.

def frame f-header
HEADER "Date:" TODAY "Items that have no tax-id at time of sale" AT 32
"PAGE:" at 68 page-number(s1) FORMAT ">>>>9"
skip(1)
"Product Summary Report" at 32
skip(2)
with no-box page-top.


output stream s1 to value(v-filename) paged.

for each so-trans-d
where tax-id = ""
and line-date > 01/01/02
and order-qty > 0:

Find first temp-table-tax-id
where tmp-prod-recno = so-trans-d.prod-recno NO-ERROR.
if available temp-table-tax-id then DO:

tmp-reoccur = tmp-reoccur + 1.
tmp-sell-amount = (tmp-sell-amount + so-trans-d.sell-amount).
tmp-sell-qty = (tmp-sell-qty + so-trans-d.order-qty).
tmp-tax-lost = ((tmp-sell-amount * tmp-sell-qty) * 0.15).

end.

else do:

Find first prod-exp
where so-trans-d.prod-recno = prod-exp.prod-recno NO-ERROR.

create temp-table-tax-id.
assign tmp-prod-recno = prod-exp.prod-recno.
assign tmp-description = prod-exp.description.
assign tmp-product-id = prod-exp.product-id.
assign tmp-reoccur = 1.
assign tmp-sell-amount = so-trans-d.unit-price.
assign tmp-sell-qty = so-trans-d.order-qty.
assign tmp-tax-lost = ((tmp-sell-amount * tmp-sell-qty) * 0.15).
assign tmp-back-order = so-trans-d.back-ord-qty.
assign tmp-complete = so-trans-d.complete.
end.



end.



for each temp-table-tax-id:

View stream s1 frame f-header.
display stream s1
tmp-product-id
tmp-description
tmp-reoccur
tmp-sell-qty
tmp-sell-amount
tmp-tax-lost
skip.

end.

for each temp-table-tax-id:

ACCUMULATE tmp-product-id (count).
ACCUMULATE tmp-sell-amount (total).
ACCUMULATE tmp-sell-qty (total).
ACCUMULATE tmp-tax-lost (maximum minimum average).

end.

Display stream s1
skip (3)
"Number of different Product id's: " ACCUM COUNT tmp-product-id
"Total amount sold with no tax : " ACCUM TOTAL tmp-sell-amount
"Total #of items sold no tax : " ACCUM TOTAL tmp-sell-qty
"Maximum tax lost : " ACCUM MAXIMUM tmp-tax-lost
"Minimum tax lost : " ACCUM MINIMUM tmp-tax-lost
"Average tax lost : " ACCUM AVERAGE tmp-tax-lost
with TITLE "STATISTICS" WITH no-labels.





I think the problem lies within the Display stream clause, do i have to use output through......i used output to value(filename)
same thing

OS = Sco Openserver

I print with....

page ./taxidreport.txt | lp -dhp1 -o"-c,land,"

therefore landscape and compressed.....for smaller font......

Any help is much appreciated.......

If you find better techniques then mine in my code,,,,
let me know

Thanks Guys
JOEL
 

jongpau

Member
Hi Joel,

Looks like Progress is automatically breaking to the next line.

Try to play with the "width", "stream-io" and "no-attr-space" options of the display's frame... for instance:
Code:
display stream s1 
tmp-product-id 
tmp-description
tmp-reoccur
tmp-sell-qty
tmp-sell-amount
tmp-tax-lost 
skip
with [b]WIDTH 132 STREAM-IO NO-ATTR-SPACE[/b].

HTH
 

raymond

New Member
- You can use WIDTH argument for the DEFINE FRAME
- Use PAGE-WIDTH for you OUTPUT TO when using a printer as output device.

Default widht = 80, but a value of 255 is quite common.

Hope this answers your question
 
Top