Aging Report Sample |
Top Previous |
Aging Report Sample
To produce this aging report sample to a file, execute the following command:
uf90c -i sample3.txt -o aging.htm -p html –f samphtml.rul
You can substitute a different path/file name for "aging" to produce the HTML file elsewhere, such as in the HTML document tree of your Web server.
The form is called "aging" to distinguish it from other rule sets. If the "-r aging" option is used on the command line, then this set will be used.
[aging] A detect statement identifies a report as the one defined by this rule set. If no "-r ruleset" option is used on the command line, then this detect statement will be evaluated. If the text "Detail Aging" appears in any column on row 2, this rule set is used.
The HTML output will produce 132 columns and 66 rows per page. cols 132rows 66
Any text consisting of 3 or more dashes will be erased. This removes all the dashed underlines at customer totals. There are other ways to accomplish this, including defining a row set and using the suppress option, or using a prepage{} code block to erase such text from the text$[] array. hline "---" The title used in HTML output for this report will be "Aging Report".
title "Aging Report"
If this line were not commented out (with the #), then anytime this rule set was used and no "-o filename" was present on the command line, the output would go to "/tmp/aging.htm." #output "/tmp/aging"
This report will be generated in multiple files (one per page), with a table of contents page, and with an HTML frame construct. multipage=ytoc=yframe=y
Between each page will be an HTML <p> tag (a paragraph separator). Any HTML text could be supplied, including references to global strings inside square brackets ([variablename]). The hdron/hdroff keywords supply HTML codes to place before and after any column definition headings, defined with the hdr=text option in the coldef and rowdef keywords. pagesep <p>hdron=<i><b>hdroff=</b></i> This rowdef keyword defines a row set from row 1 for 5 rows. All column definitions within this row will default to a background color RGB hex value of FFE0E0 (lots of red, high green and blue content).
rowdef 1,5,bgcolor=#ffe0e0 For the above row set, there are three column sets: 1 through 10, 11 through 110, and 111 through 132. The columns are left, center, and right justified, respectively. Otherwise, except for the background color, the browser will use its default values for displaying the data.
coldef 1,10,leftcoldef 11,100,centercoldef 111,22,right This row definition causes UnForm to suppress display of rows 6, 7, and 8 (the column heading information). The rule set will define the column headers as necessary in other row sets. rowdef 6,3,suppress Each customer has a heading line, distinguished by the occurrence of a phone number in those rows. The initial quoted value "~\(...-...-....\)" instructs UnForm to search for a regular expression match that looks like a U.S. phone number in parentheses. From any and all such rows, it will start at 0 rows up or down, and continue for 1 row. This defines those and only those rows that contain the phone numbers. Columns defined for those rows will be bold, with blue text on a white background. As no columns are defined under this row definition, UnForm allocates one column set the full 132 columns wide, and applies the row defaults to the text.
# Customer headerrowdef "~\(...-...-....\)",0,1,bold,color #0000ff,bgcolor #ffffff The invoice detail lines represent the most complicated of the row definitions, as there are numerous columns with two different formats. We define constants for the two formats (left and right justification being the only difference.) Then the rows are defined as any rows that contain a date structure of 2 characters, a slash, 2 characters, a slash, and 2 more characters. Note that even though some heading rows have this structure, those rows have already been allocated by prior row definitions and won't confuse things here. UnForm searches for any row with a date. Then starting from that row (row offset of 0), it searches for a row that contains 5 dashes. If such a row is found, then the row set goes through the row before (row offset -1) the dashes. If no such row is found, then the row set goes through the last row on the page.
# Invoice linesconst LEFT="bgcolor=#e8e8e8,color=black"const RIGHT="bgcolor=#e8e8e8,color=black,right" rowdef "~../../..",0,"-----",-1
Each invoice line is made up of 13 columns of information. Each has been defined by the ccoldef keyword by starting and ending column values. Additionally, each is given a header value that will appear at the top of the column, and a constant that references other attributes defined earlier in the rule set.
ccoldef 1,10,hdr="Invoice",LEFTccoldef 11,20,hdr="Due Date",LEFTccoldef 21,31,hdr="PO Number",LEFTccoldef 32,39,hdr="Ord Number",LEFTccoldef 40,45,hdr="Terms",LEFTccoldef 46,52,hdr="Type",LEFTccoldef 53,64,hdr="Future",RIGHTccoldef 65,75,hdr="Current",RIGHTccoldef 76,86,hdr="30 Days",RIGHTccoldef 87,97,hdr="60 Days",RIGHTccoldef 98,108,hdr="90 Days",RIGHT,color=redccoldef 109,119,hdr="120 Days",color=red,RIGHTccoldef 120,132,hdr="Balance",right,bold,RIGHT The customer totals occur just below the row of dashes at the end of each customer's invoices. This row definition therefore searches for any rows containing 5 dashes, then starts 1 row down, and continues for just 1 row.
# Customer totalsrowdef "-----",1,1
The first 52 columns make up one column set. The report provides no text, so we include a code block for this column that sets row$ to "Customer Totals:". Note that if this row set contained more than a single row, we could say 'if row=1 then row$="Customer Totals:'. The remaining column sets just apply right justification to the column values.
ccoldef 1,52,right{row$="Customer Totals:"}ccoldef 53,64,rightccoldef 65,75,rightccoldef 76,86,rightccoldef 87,97,rightccoldef 98,108,rightccoldef 109,119,rightccoldef 120,132,bold,right
|