Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
readme.txt | 2020-05-11 | 4.3 kB | |
rpt_length_ex2.4gl | 2020-05-11 | 2.6 kB | |
scr_prt.4gl | 2020-05-11 | 9.4 kB | |
varlgthrpt.4gl | 2020-05-11 | 6.0 kB | |
Totals: 4 Items | 22.4 kB | 0 |
From: dennisp@informix.com (Dennis Pimple) Newsgroups: comp.databases.informix Subject: Re: different report length Date: 10 Sep 94 22:13:16 GMT Peter Schubert <100043.1556@CompuServe.COM> writes: >We need diffent report length on unknown printers. >(e.g. Lineprinter Length 72, Laserprinter Length 66 ...) >Is there a way to use variables for the PAGE LENGTH parameter ??? No, BUT ... Below are two attacks I've made concerning using a single REPORT function break at different page lengths. The first is a complete program and uses PAGE LENGTH 1 and a lot of duplicate code in each report control block to handle page breaks. As a demo, it handles either 24 or 60 page output (for screen or printer output, natch) The second is a REPORT function from an actual report I wrote last week for a client that wanted the report to go to either legal or standard paper (78 or 66 lines, on this system). It's not as complete as the first, and doesn't show how to handle page footers, although I'm sure it wold be doable with a bit of duplicate code and LINENO testing. It uses the idea of setting PAGE LENGTH to the highest desired number and TOP OF PAGE "^L", which is used to send a top-of-page signal when breaking pages rather than the ole' Informix standard of repeated blank lines to fill out the pages. I hope it's commented well enough to be of use. And if Walt is watching, he should feel free to add these to the repository. ======================================================================= Dennis J. Pimple dennisp@informix.com Opinions expressed Senior Consultant -------------------- are mine, and do not Informix Software Inc Voice: 303-850-0210 necessarily reflect Denver Colorado USA Fax: 303-779-4025 those of my employer. -------------------- CUT HERE FOR scr_prt.4gl ------------------------- ########### # INFORMIX PROFESSIONAL SERVICES ####### # ## Denver, Colorado ###### # ### ================================================== ##### # #### File: %M% SCCS: %I% %P% #### # ##### Program: scr_prt.4go ### # ###### Client: Example ## # ####### Author: Dennis J Pimple # ########### Date: %G% %U% # Example of how to use the same REPORT function to run to either # screen or printer, with appropriate page breaks. # The general approach we take is to handle PAGE HEADERs & TRAILERs # in the ON EVERY ROW section of the REPORT, to avoid any forced page # breaks. This example will output 60-line pages to a printer, # or 23-line pages to a screen (70 lines of report output) From: dennisp@informix.com (Dennis Pimple) Newsgroups: comp.databases.informix Subject: Re: Page Line Length Date: 30 Oct 1995 16:22:14 GMT M J Spuffer (spuffer@clark.net) wrote: : I'm a new kid to the the Informix world. My group is just learning about : 4gl and all it's tricks. Having lived in the Pick world for many years, : its quite and adjustment. Now for the question: How do you write one : report which will run on a lazer printer (57 print lines) or a line : printer (66 lines) without replicating the entire report section? At : first thought and IF statement around the PAGE LENGTH statement would : seem proper, but to no avail. Any ideas would be appreciated. If you can live with it, set your page length to the minimum in the OUTPUT section of the REPORT functions (PAGE LENGTH 57 in your example), and set TOP OF PAGE to control-L so that the report sends a page feed to break pages instead of the default behavior of padding blank lines to break pages (TOP OF PAGE "^L" in the OUTPUT section). This would work, although you're wasting some space on the line printers. If you can't live with the wasted space (e.g. you want the same report to run to screen (24 lines) as well as to printer (66 lines) with appropriate headers always in view, etc.), try the code below. It's a straight 4gl solution, although I can envision a c solution that would involve creating 2 or 3 seperate reports (Page Header, Page Trailer, and Body), and then calling a c-function that would know to paste the header and trailer to every n lines of body text. (sounds like an interesting weekend project - any takers?) Some duplication within control blocks is required, and with more group headers/trailers things might get sticky.