Member PGM76 in MYCGILIB / QRPGLESRC

1.00 
       *------------------------------------------------------------- *
2.00 
       *  Program: PGM76                                              *
3.00 
       *  Function: Generate Excel SpreadSheet (Financial Statements) *
4.00 
       *            based on XML template in as/400 IFS.              *
5.00 
       *            This program may be called from command line      *
6.00 
       *            or by a CGI program.                              *
7.00 
       *  To Compile: Requires CGIDEV2 service program to compile     *
8.00 
       *------------------------------------------------------------- *
9.00 
       /copy qrpglesrc,hspecs
10.00 
       /copy qrpglesrc,hspecsbnd
11.00 
      H dftactgrp(*NO) actgrp('PGM76') DATEDIT(*YMD)
12.00 
       * Prototype definitions and standard system API error structure
13.00 
       /copy qrpglesrc,prototypeb
14.00 
       /copy qrpglesrc,usec
15.00 
      d* ---------------------------------------------------------------------
16.00 
      d* Prototype/Program Interface
17.00 
      d* ---------------------------------------------------------------------
18.00 
      d   PGM76         PR
19.00 
      d  CmpyName                     30a
20.00 
      d  AnnSales                     12a
21.00 
      d* ---------------------------------------------------------------------
22.00 
      d  PGM76          PI
23.00 
      d  CmpyName                     30a
24.00 
      d  AnnSales                     12a
25.00 
      d* ---------------------------------------------------------------------
26.00 
      d* Constant for updHTMLvar subprocedure
27.00 
      d initHTMLVars    c                   '0'
28.00 
      d* ---------------------------------------------------------------------
29.00 
      d* Return code (used for WrtHtmlToStmf)
30.00 
      d rc              s             10i 0 inz(0)                               return code
31.00 
      d* ---------------------------------------------------------------------
32.00 
      d* Indicators for chknbr subprocedure
33.00 
      d ChkNbrInds      ds
34.00 
      d  Indicators                     n   dim(7)
35.00 
      d* ---------------------------------------------------------------------
36.00 
      d* Indicators for GetHtmlIfsMult subprocedure
37.00 
      d IfsMultIndicators...
38.00 
      d                 ds
39.00 
      d  NoErrors                       n
40.00 
      d  NameTooLong                    n
41.00 
      d  NotAccessible                  n
42.00 
      d  NoFilesUsable                  n
43.00 
      d  DupSections                    n
44.00 
      d  FileIsEmpty                    n
45.00 
      d* ---------------------------------------------------------------------
46.00 
      d* Stream file that will hold output of this program
47.00 
      d Stmf            S             45A   inz('/CgiDevExt/Output/Fin95.xls')
48.00 
      d* ---------------------------------------------------------------------
49.00 
      d* Use Codepage=819 (US-ASCII)
50.00 
      d CodePage        s             10i 0 inz(819)
51.00 
       *----------------------------------------------------------------------------
52.00 
       /free
53.00 
          // Read externally defined template file
54.00 
              eval      IfsMultIndicators = gethtmlifsmult(
55.00 
                        '/CgiDevExt/html/PGM76ifs.html':
56.00 
                       '<as400>')                                           ;
57.00 
 
58.00 
          // Update Variables to template file (initialize on first var)
59.00 
              callp   updHTMLvar('CmpyName' : ' '+ CmpyName: initHTMLVars)  ;
60.00 
              callp   updHTMLvar('AnnSales' : AnnSales )                    ;
61.00 
 
62.00 
          // Clear the HTML buffer
63.00 
              callp     ClrHtmlBuffer()                                     ;
64.00 
 
65.00 
          // Write HTML sectio
66.00 
              callp     wrtsection('TopOfDocument')                         ;
67.00 
 
68.00 
         // Output to Stream file
69.00 
              eval       rc = WrtHtmlToStmf(%trimr(Stmf):CodePage)          ;
70.00 
 
71.00 
              Return                                                        ;
72.00 
       /end-free
0.129 sec.s