IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#19117 - 09/28/05 04:34 AM Setting Up a billing document
Roshan J Offline
OL User

Registered: 08/31/05
Posts: 79
Loc: Melbourne, Australia
Hi,

I am trying to design a billing document that prints a telephone bill. Data file format used is multi-record type variable length text file. Each record is stored in a single line with the first two characters identifying type of record. ie,

01TYPE01FIELD1 TYPE01FIELD2 TYPE01FIELD3
02TYPE02FIELD1 TYPE02FIELD2 TYPE02FIELD3

Each bill is printed as:
Page1 - Customer Details + Payment Details
Page2 - Static Marketing Messages
Page3 - Usage Summaries (Overflow Pages)
Page4 - Itemized Call summary (Overflow Pages)

Question:
1) How do I stabilize this data using User Defined Emulation ? Each bill starts with the record type 01 (1 Record Per Invoice). There are some bills which are quite huge (Approx.3000 Pages) So it may not be possible to load the entire bill onto a single data page. However, there is an additional record type 05 used as a physical page break within the invoice data.

2) If the data pages were split into physical pages using the page break record (05), How do I control which page to print ?

Any comments/suggestions would be greately appreciated.

Thanks.

Top
#19118 - 10/07/05 11:31 AM Re: Setting Up a billing document
Anonymous
Unregistered


Hello,

It would be better to split the data at the page break record (05) and store the bill info in global variables. Here is a sample code for the user defined emulation. I assume there is a page break record at the end of each record (even the last one).
Code:
 
if(@(&current.line,1,2) = '01')
  &GlobalVariable1 := @(&current.line,1,80)
endif()
if(@(&current.line,1,2) = '05')
  doform()
  clearpage()
endif()
set(&current.line,&current.line + 1)
store(&current.line,&str)
if(ge(&current.line,&current.lpp))
  doform()
  clearpage()
endif()
Use advanced conditions to control the printing of each document page. For example
=(@(1,1,2) = '01')
on page 1 to have it printed only if the current datapage is the start of a bill.

Thanks.

Top
#19119 - 10/09/05 07:42 PM Re: Setting Up a billing document
Roshan J Offline
OL User

Registered: 08/31/05
Posts: 79
Loc: Melbourne, Australia
Hi,

Thanks for the suggestion. I've managed to get the user defined emulation working as suggested. As for printing each document page, I am using a Run Page to control each page. However, the problem I am having at the moment is that to print selected records in each data page. The position of each record within the data page varies apart from the first 2 records of each bill.

I was thinking of converting each data selection field into PPTalk code and loop through each record and find the correct record type to print. ie, to print the invoice total which would be in between records 3 & 6

define(&x,integer,3)
for(&x,3,1,6)
set(¤t.line,&x)
if( @(¤t.line,1,2)='03' )
%print invoice total
show(@(¤t.line,3,10)
exit()
endif()
endfor()

I beleive the execution of these pages will be quite slow (due to search routine), however, is this recommended ?

Thanks.

Top


Moderator:  cosimo, OL Newsgroup Support