Creating professional PDF documents from basic Spool Files, utilising report definitions, maps and dynamic use of images. (CVTSPLDBF & CVTSPLPDF)

Slides:



Advertisements
Similar presentations
IEXL -- Green is great but sometimes only color will do … Simplify creation of spreadsheets, directly from the Iseries Keep your cost down Leverage your.
Advertisements

CL programming (with Display Files). Review Display Files Constants Input/Output fields Attributes Activating Function keys.
CL Programming with Database Files Updated Fall 2010.
Creating Custom Forms. 2 Design and create a custom form You can create a custom form by modifying an existing form or creating a new form. Either way,
Developing Effective Reports
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
RIMS II Online Order and Delivery System Tutorial on Downloading and Viewing Multipliers.
Developing Effective Reports
XP Chapter 5 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Developing Effective Reports Chapter 5 “Nothing succeeds.
PMS /134/182 HEX 0886B6 PMS /39/80 HEX 5E2750 PMS /168/180 HEX 00A8B4 PMS /190/40 HEX 66CC33 By Adrian Gardener Date 9 July 2012.
1 Data List Spreadsheets or simple databases - a different use of Spreadsheets Bent Thomsen.
MENU BAR This is the traditional windows style drop-down menu. Clicking on the desired command would tell Word to execute that command. Some commands.
Microsoft Access 2000 Presentation 2 Creating Databases Part I (Creating Tables)
Chapter 3 – Part 1 Word Processing Writer for Linux CMPF 112 : COMPUTING SKILLS.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 7 – Adding and.
CREATING TEMPLATES CREATING CUSTOM CHARACTERS IMPORTING BATCH DATA SAVING DATA & TEMPLATES CREATING SERIES DATA PRINTING THE DATA.
Set path vs current schema. Set Current Schema ‘The CURRENT SCHEMA special register specifies a VARCHAR(128) value that identifies the schema name used.
IReport Demo Spring 2008 OEDSA Conference. Report Properties.
CIS—100 Chapter 7—Headers and Footers 1. Chapter Objectives 2 After successful completion this chapter you should be able to:  Add page numbers.  Add.
Microsoft® Excel Key and format dates and times. 1 Use Date & Time functions. 2 Use date and time arithmetic. 3 Use the IF function. 4 Create.
Week 4 presentation! This week we will cover editing and the use of the on-board tools provided, SEU and PDM.
Registration Solutions for your Event Management.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Working with Data Lists.
Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.
1.  Introduction  The Benefits of the Report Writer Module ◦ For Detail and Summary Printing ◦ For Control Break Processing ◦ For Printing Headings.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Page Layout You can quickly and easily format the entire document to give it a professional and modern look by applying a document theme. A document theme.
Creating and Editing a Web Page
Paper 2 Exam Tips Guidance: 1.Evidence Document 2.Unit 9: – Communication ( ) 3.Unit 10: - Document Production (Word) 4.Unit 16: PowerPoint 5.Unit.
Creating a Google Site For a Digital Portfolio Purpose.
Converting a sample database file to an Excel spreadsheet. (CVTDBFXL)
Academic Computing Services 2007 Microsoft Word 2010 Publishing Long Documents This Guide will teach you how to work with long documents such as dissertations.
Creating professional Excel Spreadsheets from basic data, utilising Database-to-Excel maps. Using the new functionality offered with the two new Version.
Microsoft® Access Generate reports quickly 1 Modify controls in layout view 2 Work with report sections 3 Work with controls in a report 4 Use Format.
Converting a sample spool file to an Excel spreadsheet. (CVTSPLXL/XLS)
© Ms. Masihi.  A Web page contains text and images that convey specific information to viewers.  To create a new web page, open Dreamweaver and select.
Mail Merge Introduction to Word Processing ITSW 1401 Instructor: Glenda H. Easter Introduction to Word Processing ITSW 1401 Instructor: Glenda H. Easter.
June 17, 2009 Office 2007 Tips & Tricks.
Weebly Elements, Continued
Lesson 16 Enhancing Documents
How’s assignment 1 coming? Winter 2007
Microsoft Access 2007 – Level 2
Lesson 3: Customizing Document Elements
LMEvents SharePoint Portal How-to Guide
Managing Worksheets And Workbooks
USING DREAMWEAVER Contents: Assigning a Root Folder
Word Processing.
Tutorial Reading in EBSCOhost support.ebsco.com.
(Global / All Markets View)
Page Layout Header & Footer Font Styles Image wrapping List Styles
Recommended Budget Reductions
Microsoft Office Access 2003
Exploring Microsoft® Access® 2016 Series Editor Mary Anne Poatsy
MODULE 7 Microsoft Access 2010
Microsoft Office Access 2003
Microsoft Word - Formatting Pages
Learning about Taxes with Intuit ProFile
Week 4 Updated Winter 2011.
User Defined Reporting (Beginner Level / Basics)
Benchmark Series Microsoft Word 2016 Level 2
Learning about Taxes with Intuit ProFile
Starting from Scratch: MLA Format
Microsoft PowerPoint 2007 – Unit 2
Accessing Databases with ADO.NET, Handling Exceptions, and Printing
CHAPTER 17 The Report Writer Module
From and Report.
Tutorial 7 – Integrating Access With the Web and With Other Programs
Bent Thomsen Institut for Datalogi Aalborg Universitet
This presentation document has been prepared by Vault Intelligence Limited (“Vault") and is intended for off line demonstration, presentation and educational.
How to manage approvals in Chrome River
Presentation transcript:

Creating professional PDF documents from basic Spool Files, utilising report definitions, maps and dynamic use of images. (CVTSPLDBF & CVTSPLPDF)

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.

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:-

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.

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

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 created, @ABC_RPT. To Create the Report Definition, either WRKRPTDFN is used, then F6, or CRTRPTDFN.

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 definitions @ABC_RPT. 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.

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.

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.

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 (@ABC_RPT), 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.

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.

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 (@ABC_RPT), 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.

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.

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.

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.

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.

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.

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.

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 definition @ABC_RPT 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.

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.

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.

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 created, @ABC_RPT2. To Create the Report Definition, either WRKRPTDFN is used, then F6, or CRTRPTDFN.

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 definitions @ABC_RPT2. 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.

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.

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.

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 (@ABC_RPT2), 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.

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.

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 (@ABC_RPT2), 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.

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.

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 (@ABC_RPT2), 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.

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.

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.

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.

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.

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.

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.

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.

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 MODEL@ is specified along with the line and section. The character position and length is specified to extract the Model.

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. MILEAGE@ 18 7 FUELTYPE@ 33 10 ENGINESZ@ 48 6 COLOUR@ 64 15 REGIST@ 80 10

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 definition @ABC_RPT2 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.

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) MODEL@ (4) @MILEAGE (5) FUELTYPE@ (6) ENGINESZ@ (7) COLOUR@ (8) REGIST@ These fields will be included in the map. The second Spool file  Database map has been created.

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.

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) EMAIL(*YES) EMAILTO((ABC@XYZ.COM)) BOOKMARK(*KEY) BMARKPOS((64 21 9)) 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 170 28 *MM *NONE *NONE 1) ('/HOME/LORDG/ABC_MOTORS2.JPG' *JPG *EMBEDDED *ALL 2 26 *MM *NONE *NONE 1)

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 :

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 MODEL@ 15 8 MILEAGE@ 7 20 FUELTYPE@ 10 33 ENGINESZ@ 6 49 COLOUR@ 15 61 REGIST@ 10 70 SPACEA(2) R PAGN 64 7'Stock List for :' CARMAKE2 20 64 22 64 74'Page :' #PAGE 4 0 64 80 EDTCDE(4)

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 rename(ABC_STK2:@ABCSTCK2) D DS D c movel '9999' PAGE_TEMP 4 c movel '****' MAKE_TEMP 20 c read abc_stk2 88 * * Check for change of page c if page_temp <> PAGENO2 c write hdr c endif c dow *in88 = '0' c write DTLR c movel PAGENO2 page_temp c movel CARMAKE2 make_temp

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_stk2 88 * * 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

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.

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) EMAIL(*YES) EMAILTO((COOL@SPOOLS.COM)) BOOKMARK(*KEY) BMARKPOS((64 21 9)) BMARK KEY(('STOCK LIST FOR :' * FIRSTPAGE 16 9)) CVTFONTID(((*CPI) ('/HOME/LORDG/T ALL_LEAN.TTF' 18))) INCLFILE.......... (INCLFILE contains all the images)

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 170 28 *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')

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 170 3 *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 EMAIL 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) EMAIL(*YES) + EMAILTO((GEOFF543524@HOTMAIL.COM)) + BOOKMARK(*KEY) + BMARKPOS((64 21 9)) BMARKKEY((''STOCK + LIST FOR :'' *FIRSTPAGE 16 9)) + CVTFONTID(((*CPI) + (''/HOME/LORDG/TALL_LEAN.TTF'' 18)))')

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:

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

Creating professional Creating professional .PDF documents from basic Spool Files (CVTSPLDBF & CVTSPLPDF) The completed PDF document is shown below.