|
On Thu, 14 Feb 2002, Wills, Mike N. (TC) wrote: > > I have some questions related to printing a report. I am trying to see if > there is a way to do some of this besides counting the lines manually. > > 1) Is there a way to print a footer on the bottom of each page? I generally tackle this issue by setting my "overflow line number" so that I can print my footer when the overflow indicator comes on. (So that I don't have to count the lines) Here's some code to go with that thought: FQSYSPRT O F 132 PRINTER OFLIND(*INOF) F FORMLEN(66) FORMOFL(56) C except somedata c if *inof c except footer c except newpage c endif > > 2) Is there a way to specify that a particular printed record should be on a > certain line? Like a total for an invoice should always be on line 60 for > instance. This line will be printed in 'top-to-bottom" order so I won't have > to print anything else up further on a page. Yes. In a program-described printout, you'd use the "skip before" column of the output spec, which means "skip to line xxx before printing": .....OFilename++DF..N01N02N03Excnam++++B++A++Sb+Sa+....... OQSYSPRT E Total 60 In an externally defined print file, there's a few different ways. the "SKIPB" keyword is designed to work just like the RPG thinggy (above). you can also specify the line number directly in the "Line number" column: Here's an example of the footer I use on one of my company's pick slips which demonstrates that technique: ********* ** PICKSLIP5F: ** PRINT THE PICKING SLIP'S "FOOTER" INFORMATION ********* A R PICKSLIP5F A PRCONTMSG 25 54 26FONT(2304 (*POINTSIZE 20)) A PRNOTEMSG 25 55 27 A PRMSG1 25 56 27 A PRMSG2 25 57 27 A PRMSG3 25 58 27 A PRTITLE 18 63 33FONT(2304 (*POINTSIZE 20)) > > 3) Is there a easy way to say that this is "Page ? of ?" rather than that > this is "Page ?" No. The computer writes the data to the spool as you execute the except or write statement. Since it does not yet have any idea how many pages you will eventually accumulate, it cannot (easily) do what you're requesting. There are a few possible solutions. One involves writing all of the data into a "temp file" and while writing it there, figuring out how many pages it ends up being. Then read that temp file and create the actual printout. (OR, instead of a temp file, you could use a spool file (on hold) or a user space, or a stream file, or an array, etc... all pretty much the same thing from a conceptual point of view) Another (less robust) way would be to calculate the number of pages based on how many records exist to be processed. There are situations where this will work, and others where it won't, you have to be the judge. Yet another way that's not as robust would be to run the reporing program twice. The first time through, save the page total, and then print it onto the report the second time. The only problem here is that the report can potentially be different the second time around, which would mess everything up... but in some situations, it's a good solution. For more info on the "page x of y" topic, you might try searching the archives. I know that I've seen long heated discussions about it in the past... ;)
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.