Download presentation
Presentation is loading. Please wait.
Published byAshlyn Fowler Modified over 6 years ago
1
Creating professional PDF documents from basic Spool Files, utilising report definitions, maps and dynamic use of images. (CVTSPLDBF & CVTSPLPDF)
2
Creating professional
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Scenario: There is a Vehicle Stock Report and a professional document is required.
3
Creating professional
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Scenario: From the Vehicle Stock Report you want to create a .PDF document as below:-
4
Creating professional
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Scenario: The PDF document is to be produced, with the following :- Company logo at the top of each page. Footer showing Car Make and Page Number. Bookmarks for quick access to each Make of Car. Distinctive Column Headings. Each different Make of Car on a separate page with it’s own badge. Spooled Data in a new font. Overall professional PDF document to publish.
5
Create a basic version of the spool file, stripping out the headers.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) The creation of the .PDF document, is carried out in stages. Pages Nos. & Car Makes A CVTSPLPDF is used to create the completed PDF document. It uses a logo with headings, spool file data, pre-defined Car Make images and a .TTF Font for the report data. The command also uses the Car Make to provide Bookmarks. Press any key. CVTSPLDBF is used to extract the Summarised Page Numbers and Car Makes from the iSeries Spool File – Vehicle Stock Report. The extracted data is used to establish what Car Make logos are to be displayed at the top of each page. Press any key. CVTSPLDBF is used to extract Car Makes, Page Numbers and Report Fields. The extracted data is used later to define the bookmarks for each Car Make. Press any key. The file (A), created earlier, is read record by record, dynamically building the INCLFILE parameter. This is used to establish which Car Make logo is to be printed at the top of each page. Press any key. The file (B), created earlier is used to create a new basic spool file, with no header information and a footer containing the Car Make. This spool file is used with the CVTSPLPDF command at the end of the process. Press any key. iSeries Spooled File CVTSPLDBF Report Map A Car Makes Page Nos. Report Fields B CVTSPLDBF Report Map B Pages Nos. & Car Makes A Loop through dB file ‘A’ to create a dynamic INCLFILE parameter for the CVTSPLPDF command. Car Makes Page Nos. Report Fields B iSeries Spooled File Create a basic version of the spool file, stripping out the headers. iSeries Spooled File CVTSPLPDF
6
A report definition will be created, @ABC_RPT.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. A report definition will be To Create the Report Definition, either WRKRPTDFN is used, then F6, or CRTRPTDFN.
7
Extracting summarised Page Numbers and Car Makes.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. WRKRPTDFN is used to define the content of the report The report ABC_STOCK has to have run and the spool file be available. Select the report definition to design by entering ‘11’ next to the report definition. Locate the Spooled file you are defining (ABC_STOCK), and select it.
8
Extracting summarised Page Numbers and Car Makes.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. When the spool file has been located, select it by taking option ‘1’. The report definition can now be created.
9
Extracting summarised Page Numbers and Car Makes.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. Once the Spooled File (ABC_STOCK) has been selected, lines, sections and items can be defined. To extract the Page Number, a line has to be defined.
10
Creating professional
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. To define the first line for the Page Numbers, within this report definition the cursor is positioned on the title line (line 1) and F10 is pressed. The Line name is set to PAGELINE1. F9 is pressed to save the Report Line.
11
Extracting summarised Page Numbers and Car Makes.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. When you have saved PAGELINE1, the report definition will be updated. PAGELINE1 will be highlighted in pink.
12
Creating professional
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. To define the second line for the Car Makes, within this report definition the cursor is positioned on the line 3 and F10 is pressed. The Line name is set to CARMAKE1. F9 is pressed to save the Report Line.
13
Extracting summarised Page Numbers and Car Makes.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. When CARMAKE1 has been saved, the report definition will be updated. CARMAKE1 will be highlighted in pink. Now that the lines have been defined, a section needs to be created for the two lines.
14
Extracting summarised Page Numbers and Car Makes.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. To create the section, the cursor is positioned on Line 1 and F11 is pressed. The section is named S_PAGEMAKE. Start Line is PAGELINE1, End Line is CARMAKE1. Included Lines are PAGELINE1, CARMAKE1. F9 is pressed to save the section.
15
Extracting summarised Page Numbers and Car Makes.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. To get the Page Number from the report line, a report item has to be defined. F15 is used, from the Report Definition screen, to Work with Lines. To add the Page Number item, PAGELINE1 is selected and option 9 is entered.
16
Extracting summarised Page Numbers and Car Makes.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. F6 is used to add the new Report item. An item name is specified along with the line and section. The character position and length is specified to extract the page number.
17
Extracting summarised Page Numbers and Car Makes.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. To get the Car Make from the report line, a report item has to be defined. F15 is used, from the Report Definition screen, to Work with Lines. To add the Car Make item, CARMAKE1 is selected and option 9 is entered.
18
Extracting summarised Page Numbers and Car Makes.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. F6 is used to add a new Report item. An item name is specified along with the line and section. The character position and length is specified to extract the car make.
19
Extracting summarised Page Numbers and Car Makes.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. Now the report has been defined, a map has to defined, for use with the CVTSPLDBF command. To create the map, WRKRPTDBF is used. F6 creates a map. When enter is pressed, Report Items are assigned.
20
Extracting summarised Page Numbers and Car Makes.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. (1) PAGENO1 and (2) CARMAKE1, are selected to be included in the map. The first Spool file Database map has been created.
21
Extracting summarised Page Numbers and Car Makes.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting summarised Page Numbers and Car Makes. CVTSPLDBF is then used to create a summary of Page Numbers and Car Makes. The resulting database file created will look as follows.
22
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. A report definition will be To Create the Report Definition, either WRKRPTDFN is used, then F6, or CRTRPTDFN.
23
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. WRKRPTDFN is used to define the content of the report The report ABC_STOCK has to have run and the spool file be available. Select the report definition to design by entering ‘11’ next to the report definition. Locate the Spooled file you are defining (ABC_STOCK), and select it.
24
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. When the spool file has been located, it is selected by taking option ‘1’. The report definition can now be created.
25
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. Once the Spooled File (ABC_STOCK) has been selected, the lines, sections and items can be defined. To extract the Page Number, a line has to be defined.
26
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. To define the first line for the Page Numbers, within this report definition the cursor is positioned on the title line (line 1) and F10 is pressed. The Line name is set to PAGELINE2. F9 is pressed to save the Report Line.
27
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. When you have saved PAGELINE2, the report definition will be updated. PAGELINE2 will be highlighted in pink.
28
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. To define the second line for the Car Makes, within this report definition position the cursor on the title line (line 1) and press F10. The Line name is set to CARMAKE2. F9 is pressed to save the Report Line.
29
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. When CARMAKE2 has been saved, the report definition will be updated. CARMAKE2 will be highlighted in pink.
30
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. To define the third line for the detail, within this report definition the cursor is positioned on line 7 and F10 is pressed. The Line name is set to DETAIL2. F9 is pressed to save the Report Line.
31
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. When DETAIL2 has been saved, the report definition will be updated. DETAIL2 will be highlighted in pink. Now that the lines have been defined, a section needs to be created for the three lines.
32
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. To create the section, the cursor is positioned on Line 1 and F11 is pressed. The section is named S_PMD. Start Line is PAGELINE2, End Line is DETAIL2. Included Lines are CARMAKE2, DETAIL2 and PAGELINE2. F9 is pressed to save the section.
33
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. To get the Page Number from the report line, a report item has to be defined. F15 is used, from the Report Definition screen, to Work with Lines. To add the Page Number item, PAGELINE2 is selected by entering option 9.
34
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. F6 is used to add a new Report item. An item name is specified along with the line and section. The character position and length is specified to extract the page number.
35
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. To get the Car Make from the report line, a report item is defined. F15 is used, from the Report Definition screen, to Work with Lines. The Car Make item is added, by selecting CARMAKE2 and entering option 9.
36
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. F6 is used to add a new Report item. An item name is specified along with the line and section. The character position and length is specified to extract the car make.
37
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. To get the report fields from the report line, report items have to be defined. F15 is used, from the Report Definition screen, to Work with Lines. To add the Report Fields, DETAIL2 is selected by entering option 9.
38
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. F6 is used to add a new Report item. An item name for the is specified along with the line and section. The character position and length is specified to extract the Model.
39
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. F6 is used to add a new Report items for the following. Report Item Character Pos. Character Len.
40
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. Now the report has been defined, a map has to defined, for use with the CVTSPLDBF command. To create the map, WRKRPTDBF is used. F6 will create the map. When enter is pressed, Report Items are assigned.
41
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. Select (1) PAGENO2 (2) CARMAKE2 (3) (5) (6) (7) (8) These fields will be included in the map. The second Spool file Database map has been created.
42
Extracting Page Numbers, Car Makes and Report Fields.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Extracting Page Numbers, Car Makes and Report Fields. CVTSPLDBF is then used to create a database file of Page Numbers, Car Makes and Report fields. The resulting database file created will look as follows.
43
Dynamically build the INCLFILE parameter.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Dynamically build the INCLFILE parameter. Within the controlling CL program, a variable is used to store the CVTSPLPDF command. At this stage, the contents of the command contains the following. CVTSPLPDF FROMFILE(ABC_STOCK2) SPLNBR(*LAST) STMFOPT(*REPLACE) (*YES) BOOKMARK(*KEY) BMARKPOS(( )) BMARK KEY(('STOCK LIST FOR :' * FIRSTPAGE 16 9)) CVTFONTID(((*CPI) ('/HOME/LORDG/TALL_LEAN.TTF' 18))) INCLFILE(('/HOME/LORDG/ABC_MOTORS.JPG' *JPG *EMBEDDED * ALL *MM *NONE *NONE 1) ('/HOME/LORDG/ABC_MOTORS2.JPG' *JPG *EMBEDDED *ALL *MM *NONE *NONE 1)
44
Dynamically build the INCLFILE parameter.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Dynamically build the INCLFILE parameter. The following piece of code is required to dynamically add to the INCLFILE parameter. Database file ‘A’ that was created earlier, is used to add a jpg to the parameter for each entry within the file. RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END_MAKE)) CHGVAR VAR(&BADGE) VALUE(&MAKEOFCAR *TCAT &JPG) CHGVAR VAR(&PGN) VALUE(&PAGENO) CHGVAR VAR(&THECMD) VALUE(&THECMD *TCAT &SOB *TCAT + &SQ *TCAT &MAKE1 *TCAT &BADGE *TCAT &SQ + *TCAT &MAKE2 *TCAT &PAGENO *TCAT &SCB) GOTO CMDLBL(GET_MAKE) ENDMAKE :
45
Create a basic spool file without the headers.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Create a basic spool file without the headers. To enable the CVTSPLPDF command, to show the detail from the report and not the report headings, a new basic spool file required. A print file is created (ABC_STOCK2). R HDR 13 1 ' ' R DTLR SPACEA(2) R PAGN 64 7'Stock List for :' CARMAKE 64 74'Page :' #PAGE EDTCDE(4)
46
Create a basic spool file without the headers.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Create a basic spool file without the headers. To create the basic spool file a simple RPG program is created. FABC_STOCK2O E PRINTER OFLIND(*IN99) FABC_STK2 IF E DISK D DS D c movel '9999' PAGE_TEMP c movel '****' MAKE_TEMP c read abc_stk * * Check for change of page c if page_temp <> PAGENO2 c write hdr c endif c dow *in88 = '0' c write DTLR c movel PAGENO page_temp c movel CARMAKE make_temp
47
Creating professional
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Create a basic spool file without the headers. RPG program continued. c read abc_stk * * Check for change of page c if page_temp <> PAGENO2 c movel page_temp #page c movel make_temp carmake2 c write pagn c write hdr c endif c enddo * Program End C MOVE '1' *INLR C RETURN
48
Create a basic spool file without the headers.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Create a basic spool file without the headers. The basic spool file is created as follows.
49
Using CVTSPLPDF to create the PDF document.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Using CVTSPLPDF to create the PDF document. Before the PDF document can be produced, the following needs to be placed on the iSeries within the Integrated File System (IFS). Tall and Lean True Type Font (TALL_LEAN.TTF), this can be downloaded from the internet. The header image showing the Company logo and column heading (ABC_MOTORS.JPG), needs copying to the IFS. The footer image showing a separator line and the bottom of the page (ABC_MOTORS2.JPG), needs copying to the IFS. All Car Make Badge logos needs copying to the IFS. The command will then be passed to the program QCMDEXC as follows. CVTSPLPDF FROMFILE(ABC_ST OCK2) SPLNBR(*LAST) STMFOPT(*REPLACE) (*YES) BOOKMARK(*KEY) BMARKPOS(( )) BMARK KEY(('STOCK LIST FOR :' * FIRSTPAGE 16 9)) CVTFONTID(((*CPI) ('/HOME/LORDG/T ALL_LEAN.TTF' 18))) INCLFILE (INCLFILE contains all the images)
50
Using CVTSPLPDF to create the PDF document.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Using CVTSPLPDF to create the PDF document. The complete CL program is as follows. PGM /* DECLARE FILE FOR READING IN PAGE NUMBERS AND MAKE OF CARS */ DCLF FILE(CS_GLLIB/ABC_STK) /* DECLARE &SP - SPACE */ DCL VAR(&SP) TYPE(*CHAR) LEN(1) VALUE(X'40') /* DECLARE &SQ - SINGLE QUOTE ' */ DCL VAR(&SQ) TYPE(*CHAR) LEN(1) VALUE(X'7D') /* DECLARE &DCB - DOUBLE CLOSE BRACKET */ DCL VAR(&DCB) TYPE(*CHAR) LEN(2) VALUE('))') /* DECLARE &SCB - SINGLE CLOSE BRACKET */ DCL VAR(&SCB) TYPE(*CHAR) LEN(1) VALUE(')') /* DECLARE &SOB - SINGLE OPEN BRACKET */ DCL VAR(&SOB) TYPE(*CHAR) LEN(2) VALUE(' (') /* DECLARE &CMDL - PARAMETER NEED FOR THE QCMDEXC CALL */ DCL VAR(&CMDL) TYPE(*DEC) LEN(15 5) VALUE(6000) /* DECLARE &THECMD - PARAMETER USED TO PROCESS THE COMMAND */ DCL VAR(&THECMD) TYPE(*CHAR) LEN(6000) /* DECLARE &TITLE1/2 - LOGO IMAGE AT THE TOP OF EACH PAGE */ DCL VAR(&TITLE1) TYPE(*CHAR) LEN(100) + VALUE('/HOME/LORDG/ABC_MOTORS.JPG') DCL VAR(&TITLE2) TYPE(*CHAR) LEN(100) VALUE(' + *JPG *EMBEDDED *ALL *MM *NONE + *NONE 1') /* DECLARE &FOOTER1/2 - LOGO IMAGE AT THE FOOT OF EACH PAGE */ DCL VAR(&FOOTER1) TYPE(*CHAR) LEN(100) + VALUE('/HOME/LORDG/ABC_MOTORS2.JPG') DCL VAR(&FOOTER2) TYPE(*CHAR) LEN(100) VALUE(' + *JPG *EMBEDDED *ALL 2 26 *MM *NONE *NONE 1')
51
Creating professional
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Using CVTSPLPDF to create the PDF document. The complete CL program continued. /* DECLARE &MAKE1/2 - BASIS OF EACH IMAGE PATH */ DCL VAR(&MAKE1) TYPE(*CHAR) LEN(100) + VALUE('/HOME/LORDG/') DCL VAR(&MAKE2) TYPE(*CHAR) LEN(100) VALUE(' + *JPG *EMBEDDED *PAGNBR *MM *NONE + *NONE .5 *NONE *ABS *FIRST *KEEP ') /* DECLARE &INCLF - BASIS OF EACH INCLFILE PARAMETER, FOR THE IMAGES */ DCL VAR(&INCLF) TYPE(*CHAR) LEN(1024) DCL VAR(&PATH1) TYPE(*CHAR) LEN(5000) VALUE(' + INCLFILE((') /* DECLARE &BADGE - THE NAME OF THE JPG FOR THE CAR MAKE IMAGE */ DCL VAR(&BADGE) TYPE(*CHAR) LEN(30) DCL VAR(&JPG) TYPE(*CHAR) LEN(4) VALUE('.JPG') /* DECLARE &PGN - THE PAGE NUMBER WHERE THE CAR MAKE IMAGES WILL APPEAR */ DCL VAR(&PGN) TYPE(*DEC) LEN(4 0) /* DECLARE &THECMD - QCMDEXC WILL BE USED WITH &THECMD TO PROCESS THE */ /* CVTSPLPDF COMMAND */ DCL VAR(&THECMD) TYPE(*CHAR) LEN(6000) /* SETUP THE CVTSPLPDF COMMAND */ /* 1. SPECIFY THE BASIC SPOOL FILE */ /* 2. SPECIFY THE ADDRESS */ /* 3. USE THE REPORT FOOTER (CAR MAKE) FOR BOOKMARKS */ /* 4. USE THE TALL AND LEAN TRUE TYPE FONT FOR THE REPORT DETAIL */ CHGVAR VAR(&THECMD) VALUE('CVTSPLPDF + FROMFILE(ABC_STOCK2) SPLNBR(*LAST) + STMFOPT(*REPLACE) (*YES) + + BOOKMARK(*KEY) + BMARKPOS(( )) BMARKKEY((''STOCK + LIST FOR :'' *FIRSTPAGE 16 9)) + CVTFONTID(((*CPI) + (''/HOME/LORDG/TALL_LEAN.TTF'' 18)))')
52
Creating professional
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Using CVTSPLPDF to create the PDF document. The complete CL program continued. /* ADD THE HEADER AND FOOTER IMAGES TO PATH1. &PATH1 WILL BE USED IN &THECMD */ CHGVAR VAR(&PATH1) VALUE(&PATH1 *TCAT &SQ *TCAT + &TITLE1 *TCAT &SQ *TCAT &TITLE2 *TCAT &SCB) CHGVAR VAR(&PATH1) VALUE(&PATH1 *BCAT &SOB *TCAT &SQ + *TCAT &FOOTER1 *TCAT &SQ *TCAT &FOOTER2 + *TCAT &SCB) /* ADD THE &PATH1 TO &THECMD */ CHGVAR VAR(&THECMD) VALUE(&THECMD *TCAT &PATH1) /* CREATE SPOOL FILE BEING USED TO CREATE THE PDF DOCUMENT */ CALL PGM(ABC_STKR1) /* PAGES AND MAKES */ CVTSPLDBF FROMFILE(ABC_STOCK) SPLNBR(*LAST) + MAPNAME(ABC_DB_MAP1) + TOFILE(CS_GLLIB/ABC_STK) MBROPT(*REPLACE) /* DETAIL */ MAPNAME(ABC_DB_MAP2) + TOFILE(CS_GLLIB/ABC_STK2) MBROPT(*REPLACE) /* LOOP THROUGH THE SUMMARISED PAGE NUMBER AND CAR MAKE FILE TO DYNAMICALLY */ /* BUILD THE INCLFILE PARAMETER */ GET_MAKE: RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END_MAKE)) CHGVAR VAR(&BADGE) VALUE(&MAKEOFCAR *TCAT &JPG) CHGVAR VAR(&PGN) VALUE(&PAGENO) CHGVAR VAR(&THECMD) VALUE(&THECMD *TCAT &SOB *TCAT + &SQ *TCAT &MAKE1 *TCAT &BADGE *TCAT &SQ + *TCAT &MAKE2 *TCAT &PAGENO *TCAT &SCB) GOTO CMDLBL(GET_MAKE) END_MAKE:
53
Using CVTSPLPDF to create the PDF document.
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) Using CVTSPLPDF to create the PDF document. The complete CL program continued. /*BUILD NEW BASIC REPORT*/ CALL PGM(ABC_STKR2) /* PROCESS THE CVTSPLPDF COMMAND, USING QCMDEXC */ CHGVAR VAR(&THECMD) VALUE(&THECMD *TCAT &SCB) CALL PGM(QCMDEXC) PARM(&THECMD &CMDL) ENDPGM
54
Creating professional
Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) The completed PDF document is shown below.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.