#30449 - 10/09/09 02:14 PM
second page information
|
Junior Member
Registered: 06/19/09
Posts: 14
Loc: Indiana
|
Not sure how to word this question. What I am trying to do is take a text file...format it...and print it. This I have accomplished with help from here. Now, I have discovered that sometimes the information requires a second page. I would like to take the first page, which contains a header and information in the header(gathered from the text file), reprint it with the extra lines of data on the second page. I use the following code in 'User-Defined Emulation'
search(&str,'T=') set(¤t.line,¤t.line + 1) store(¤t.line,&str) doform() set(&NumLineItems, 0) %added clearpage() endsearch() set(¤t.line,¤t.line + 1) store(¤t.line,&str) set(&NumLineItems, &NumLineItems + 1) %added if(ge(¤t.line,¤t.lpp)) doform() clearpage() endif() if(&NumLineItems = 13) set(&NumLineItems,¤t.line + 1) doform() clearpage() endif
The second page does contain the extra lines of data, but, the header informaiton is repopulated with 'garbage'. Any suggestions Thanks, Brian
|
Top
|
|
|
|
#30450 - 10/15/09 12:51 PM
Re: second page information
|
OL Expert
Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
|
brianp,
Usually, overflow is not handled through the user emulation, but through data selections.
Instead of generating a second data page for the overflowing data, have all your data on the same page. Then, create a data selection that selects the first line of data. Then go to it's Repeat properties, select "Line Repeat", and repeat from 1 to 0, where "0" means "maximum number of lines per pages". (you may have it end at a different position, if you know the maximum number of data lines) Then, for the "condition to exit and overflow", you can use something line this: =¤t.iterationcount = 20
This means that every 20 lines, it's going to create a new page, and continue with the remaining data. You can, of course, set it to any number you want.
Try it out, let me know if it works.
Regards, Rapha
|
Top
|
|
|
|
#30451 - 10/16/09 02:31 PM
Re: second page information
|
Junior Member
Registered: 06/19/09
Posts: 14
Loc: Indiana
|
I have used the feature that you mentioned on other forms, but it does not help me on this one. The information is a truck route, so there are multiple stops and at each stop there are multiple items. I use a run page with a loop...until to display the information, along with re-generating headers for each stop. (May not be the easiest way, but it does it very well). My problem comes from this, as I can not carry over the driver information to the second page and the load information is placed in the driver's fields. Then, the rest of the route is displayed as on the first page. What I need to know is if there is a way to carry the driver information to the second page, populate the right fields with the right information and then continue to the main section and print the remaining route info.
Thanks, Brian
|
Top
|
|
|
|
|
|