Skip to main content  
        iSeries home   |   Easy400     |   CGIDEV2     |   MMAIL  
Freeware
 
Introduction
XLSGEN
Program development
TABLEXLS
TABLEXLS2
TABLEXLS Banners
Right to left
XLSUPD
Scott's demos
 
Appendixes:
Java products
 Parameter ALTCOLHDG
JVMSTARTUP
 
 Download
 
 

 
 
HSSFCGI
TABLEXLS - Parameter ALTCOLHDG

In generating worksheets, TABLEXLS would generally create a single row of column headers for each worksheet. The text for the column headers is retrieved from the File-Field descriptions related to the processed database file.

Though this is generally acceptable, there may be cases where one would need to have different text descriptions in some column headings or even extend the headings over more rows.

In command TABLEXLS you may use parameter ALTCOLHDG to replace the default column headings with your own headings. This can be done by specifying in this parameter the path-name of a stream file where the heading rows are defined in XLSGEN language. The following example explains how this can be done.

The example

In this example we use database file HSSFCGIDTA/ADHOCCTL: that is a control file available on your system after installing HSSFCGI. We use this file because you can repeat this example on your IBMi.

Step 1
Let us run the following command:
TABLEXLS FROMFILE(HSSFCGI/ADHOCCTL) TOXML('/tmp/adhocctl.txt')
   TOXLS('/tmp/adhocctl.xls')

The resulting worksheet looks like this:

Figure 1


Step 2

Figure 2
Let us have a look at the XLSGEN script generated by that command TABLEXLS (the XLSGEN script is then used by command TABLEXLS to feed command XLSGEN, which creates the XLS). That XLSGEN script is in stream file /tmp/adhocctl.txt (See Figure 2).
The part of the script that generates the column headings is the one inside the red rectangle.

If we want different headings from the default ones generated by TABLEXLS, we must write in a stream file our XLSGEN tags, and mention that stream file in parameter ALTCOLHDG of command TABLEXLS.

Step 3
Figure 3 shows the XLSGEN script that we would like to use for generating the column headers of the worksheet.
Let us assume that we wrote this script in stream file /hssfcgi/altcolhdg/adhocctl.txt.

Step 4
Let us now run the following command:
TABLEXLS FROMFILE(HSSFCGIDTA/ADHOCCTL)
   TOXML('/tmp/adhocctl2.txt')
   TOXLS('/tmp/adhocctl2.xls')
   ALTCOLHDG('/hssfcgi/altcolhdg/adhocctl.txt')

The resulting worksheet id shown in Figure 4.


Restrictions

  • The XLGEN script stream file mentioned in parameter ALTCOLHDG applies only to the members of the first database file in parameter FROMFILE. For the other database file members, column headings are retrieved from the related file-field descriptions.

Figure 3

Figure 4