Download presentation
Presentation is loading. Please wait.
Published byAntonia Dalton Modified over 8 years ago
1
Converting a sample spool file to an Excel spreadsheet. (CVTSPLXL/XLS)
2
Convert Spool file to Excel (CVTSPLXL/XLS) Creating your Excel Report. Scenario: There is a Vehicle Service Report (SERVICE_RP).
3
Convert Spool file to Excel (CVTSPLXL/XLS) Creating your Excel Report. Scenario: An excel spreadsheet is to be produced, incorporating the following :- Extraction of details from more than one data line off the report. Split the report, so each Make of Car is in a separately named worksheet. Format the worksheet, so that the Make of Car is shown in the header. Create a summary worksheet, showing a breakdown for each Make of Car. Align columns containing character data, to the left and columns containing numeric data to the right and contain thousands separators. Show the report title on the report, utilising Excel placeholders. Display the date, worksheet and page numbers within the page footer, utilising Excel placeholders. Style the column headers to make them distinctive. Use border styling around the report.
4
Convert Spool file to Excel (CVTSPLXL/XLS) Using CoolSpools to produce your report. Before the excel spreadsheet is created using the CVTSPLXL command, various entities need to be set up. Report Definition. Sections Lines Items Report-to-Excel Maps (one for the detail and for the summary). Row Groups Cells Style definitions.
5
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition will be constructed. REPORT DEFINITION (@VSERVICE_RD) SECTION (S_CARMAKE) SECTION (S_CARDETAIL) SECTION (S_TOTLINES) CARMAKE LINES CARDETAIL1 LINES CARDETAIL2 MODEL CAROWNER REGISTR. ENGINE SIZE MILEAGE PURCH. DATE LAST SRV. DATE NEXT SERVICE COLOUR FUEL TYPE TOTAL LINE 1 TOTAL LINE 2 TOTAL LINE 3 TOTAL LINE 4 No. of Cars Total Miles Av. Miles No Serv.
6
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined. Command CRTRPTDFN is used to create the definition, @VSERVICE_RD.
7
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined. Once the Report definition has been created, the spool file has to selected and the definition defined. Option ‘11’ is taken. Option ‘1’ is taken.
8
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined – Lines. When the spool file has been selected, the lines can be created. The cursor is positioned, on the line containing “Model of Car” (line 5) and F10 is pressed to “Define Line”.
9
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Lines. Defining the CARMAKE line. The line is named “CARMAKE” and given a description. Can occur from and to lines are set to 3 and the rule type is *LINNBR. F9 is pressed to save the line.
10
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Lines. Once the line has been saved, the line will change colour. Now Detail Line 1 has to be created. The cursor is positioned, on the first line of the detail within the report (line 8) and F10 is pressed to “Define Line”.
11
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Lines. Defining the CARDETAIL1 line. The line is named “CARDETAIL1” and given a description. Can occur from line is set to 8 and Can occur to line is set to *LAST. The Rule Type is set to *RULE and states a detail line has to contain a ‘/’. F9 is pressed to save the line.
12
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Lines. Once the line has been saved, the line will change colour. Now Detail Line 2 has to be created. The cursor is positioned, on the second line of the detail within the report (line 9) and F10 is pressed to “Define Line”.
13
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Lines. Defining the CARDETAIL2 line. Can occur from line is set to 9 and Can occur to line is set to *LAST. The Rule Type is set to *RULE and states a detail line (starting at position 37) is not empty and must not a ‘:’ at position 73. F9 is pressed to save the line.
14
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Lines. Once the line has been saved, the line will change colour. Now Total Line 1 has to be created. The cursor is positioned, on the first line of the Summary, containing the text “Total Number of Cars” (line 61) and F10 is pressed to “Define Line”.
15
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Lines. Defining the TOTLINE1 line. Can occur from line is set to 7 and Can occur to line is set to *LAST. The Rule Type is set to *RULE and states a summary line (starting at position 52) contains “Total Number of Cars”. F9 is pressed to save the line.
16
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Lines. Defining the TOTLINE2 line. The line is named TOTLINE2. Can occur from line is set to 7 and Can occur to line is set to *LAST. The Rule Type is set to *RULE and states a summary line (starting at position 52) contains “Total Mileage”. F9 is pressed to save the line. Defining the TOTLINE3 line. The line is named TOTLINE3. Can occur from line is set to 7 and Can occur to line is set to *LAST. The Rule Type is set to *RULE and states a summary line (starting at position 52) contains “Average Mileage”. F9 is pressed to save the line. Defining the TOTLINE4 line. The line is named TOTLINE4. Can occur from line is set to 7 and Can occur to line is set to *LAST. The Rule Type is set to *RULE and states a summary line (starting at position 52) contains “No Service Booked”. F9 is pressed to save the line. The Report Definition lines are complete, now the sections have to be defined.
17
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Sections. Now all of the lines have been created, they can be placed in sections. To create the CARMAKE section, the cursor is positioned on line 3, where the text ‘Make of Car’ is shown and F11 is pressed.
18
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Sections. Defining the S_CARMAKE section. The section is named S_CARMAKE. The Start Line and End Lines are set to CARMAKE (defined earlier). CARMAKE is listed in the ‘Included Lines’ section. F9 is pressed to save the section.
19
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Sections. Once the S_CARMAKE section has been saved, the CARDETAIL section has to be defined. F14 can be used on this screen to display the sections. To create the CARDETAIL section, the cursor is positioned on line 8, where the first line of detail is shown and F11 is pressed.
20
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Sections. Defining the S_CARDETAIL section. The Start Line is set to CARDETAIL1 and the End Line set to CARDETAIL2. CARDETAIL1 and CARDETAIL2 are listed in the ‘Included Lines’ section. F9 is pressed to save the section.
21
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Sections. Once the S_CARDETAIL section has been saved, the TOTLINES section has to be defined. To create the TOTLINES section, the cursor is positioned on line 61, where the first total line is shown and F11 is pressed.
22
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Sections. Defining the S_TOTLINES section. The Start Line is set to TOTLINE1 and the End Line set to TOTLINE4. TOTLINE1, 2, 3 and 4 are listed within the ‘Included Lines’. F9 is pressed to save the section. The Sections are complete, now the items have to be defined.
23
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Items. Now the lines and sections have been setup, the ITEMS containing the data need to be defined. F15 is used to ‘Work with lines’. Firstly, the CARMAKE items are defined.
24
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Items. F6 is used to create the item, CARMAKE. The item is named CARMAKE@. The line is set to CARMAKE and the section is set to S_CARMAKE. The CARMAKE is extracted from the line at position 15, for a length of 10.
25
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Items. To extract the data from detail line1, ‘9’ is entered against CARDETAIL1. F6 is used to add the items to this line.
26
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Items. The following items are added to the CARDETAIL1 line. ItemPositionLengthData Type MODEL@115*ALPHA CAROWNER@1620*ALPHA REGIST@3710*ALPHA ENGINESZ@528*ALPHA MILEAGE@738*NUMERIC PURDATE@9010*DATE LST_DATE10310*DATE NSR_DATE@11610*DATE The following items are added to the CARDETAIL2 line. ItemPositionLengthData Type COLOUR@3710*ALPHA FUELTYPE@5212*ALPHA
27
Convert Spool file to Excel (CVTSPLXL/XLS) How the Report Definition is defined - Items. The following items are added to the TOTLINE1 line. Item PositionLengthData Type NO_OF_CARS@75 9*NUMERIC The following items are added to the TOTLINE2 line. Item PositionLengthData Type TOTAL_MILEAGE@75 9*NUMERIC The following items are added to the TOTLINE3 line. Item PositionLengthData Type AVERAGE_MILEAGE@75 9*NUMERIC The following items are added to the TOTLINE4 line. Item PositionLengthData Type NO_SERVICE@75 9*NUMERIC The Report Definition is now complete and the Excel maps need creating.
28
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map (for the detail), will be constructed. EXCEL MAP (@VSERVICE_MAP) ROW GROUP (NEW_SHEET) COLOUR TEXTS CELLS ROW GROUP (DETAIL) “Make of Car” “Model” “Car Owner” “Registr.” “Colour” “Engine Size” “Fuel Type” “Mileage” “Purchase Date” “Last Serv. Date” “Next Serv. Date” FUELTYPEPURDATE MODEL CAROWNER LSRVDATE REGISTRAT. ENGINESZMILEAGESERVDATE
29
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map for the detail is defined. Command CRTRPTXL is used to create the map, @VSERVICE_MAP.
30
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map for the detail is defined. Now the map has been created, row groups need adding, to do this WRKRPTXL is used. To add the row group, ‘8’ is entered against the map.
31
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map for the detail is defined. F6 is used to create the Parent Row Group. The report section is set to S_CARMAKE. The Action before Row Group is set to *NEWSHEET. The sheet name is setup to be named as the CARMAKE.
32
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map for the detail is defined. Cells now have to be added to the row group, for column headers. Adding cells is done by entering ‘9’ against the row group. F6 is used to add cells.
33
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map for the detail is defined. All column headers within this row group are defined as *TEXT. As CARMAKE is also part of the header, this is defined as *ITEM.
34
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map for the detail is defined. The following cells are also added to the Row Group NEW_SHEET. RowColumnContentItem / Text 1B*ITEMCARMAKE@ 2A*TEXTModel 2B*TEXTCar Owner 2C*TEXTRegistration 2D*TEXTColour 2E*TEXTEngine Size 2F*TEXTFuel Type 2G*TEXTMileage 2H*TEXTPurchase Date 2I*TEXTLast Service Date 2J*TEXTNext Service Date A lower level Row Group is now defined, for all the detail.
35
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map for the detail is defined. A lower level Row group is defined by entering ‘8’ against the Parent. F6 is used to add the Row Group.
36
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map for the detail is defined. This Row Group, DETAIL, contains all the data for the Worksheets. The section S_CARDETAIL is assigned.
37
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map for the detail is defined. The cells are setup as follows. RowColumnContentItem / Text 1A*ITEMMODEL@ 1B*ITEMCARWOWNER@ 1C*ITEMREGIST@ 1D*ITEMCOLOUR@ 1E*ITEMENGINESZ@ 1F*ITEMFUELTYPE@ 1G*ITEMMILEAGE@ 1H*ITEMPUR_DATE@ 1I*ITEMLSR_DATE@ 1J*ITEMNSR_DATE@ The Excel map for the summary worksheet now has to be created.
38
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map (for the summary), will be constructed. EXCEL MAP (@VSERVICE_MAP2) ROW GROUP (SUMM_PARENT) TEXTS CELLS ROW GROUP (DETAIL) “Make of Car” “Number of Cars” “Total Mileage” “Average Milage” “No Serv. Booked” NO_OF_CAR TOT_MILEAV_MILENO_SERVCARMAKE
39
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map for the summary is defined. Command CRTRPTXL is used to create the map, @VSERVICE_MAP2.
40
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map for the summary is defined. Now the map has been created, row groups need adding, to do this WRKRPTXL is used. To add the row group, ‘8’ is entered against the map.
41
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map for the summary is defined. F6 is used to create the Parent Row Group. The Action before Row Group is set to *NEVER. Cells are added at this stage for the column headers.
42
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map for the summary is defined. Cells are added as follows. RowColumnContentItem / Text 1A*TEXTMake of Car 1B*TEXTNumber of Cars 1C*TEXTTotal Mileage 1D*TEXTAverage Mileage 1E*TEXTNo Service Booked A lower level Row Group is now defined, for all the data within the summary.
43
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map for the summary is defined. A lower level Row group is defined by entering ‘8’ against the Parent. F6 is used to add the Row Group.
44
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map for the summary is defined. This Row Group, SUMMARY_TAB, contains the summary data. The section S_TOTLINE is assigned.
45
Convert Spool file to Excel (CVTSPLXL/XLS) How the Excel Map for the summary is defined. The cells are setup as follows. RowColumnContentItem / Text 1A*ITEMCARMAKE@ 1B*ITEMNO_OF_CARS@ 1C*ITEMTOTAL_MILEAGE@ 1D*ITEMAVERAGE_MILEAGE@ 1E*ITEMNO_SERVICE@ The Excel maps have now been created.
46
Convert Spool file to Excel (CVTSPLXL/XLS) Style Definitions. The following styles are required to format the spreadsheet. Style Font Size Bold Text Background Horz. Wrap Row Borders Number Format. Colour Align. Text Height REP_TITLE Arial 14 *NO *WHITE *DARKBLUE *LEFT *NO *AUTOFIT *THIN *BLACK 2 *GENERAL MILEAGE_HL Arial 12 *NO *WHITE *LIGHTBLUE *LEFT *NO *AUTOFIT *THIN *BLACK 2 *GENERAL MILEAGE_HR Arial 12 *NO *WHITE *LIGHTBLUE *RIGHT *NO *AUTOFIT *THIN *BLACK 2 *GENERAL DETAIL_L Arial 10 *NO *BLACK *WHITE *LEFT *YES *AUTOFIT *THIN *BLACK 2 *GENERAL DETAIL_R Arial 10 *NO *BLACK *WHITE *RIGHT *YES *AUTOFIT *THIN *BLACK 2 *ACCOUNTING 0 *YES NO_SERV Arial 10 *YES *RED *GRAY25 *GENERAL *NO *AUTOFIT *THIN *BLACK 2 *GENERAL SUMMARY_HL Arial 16 *NO *WHITE *LIGHTBLUE *LEFT *YES *AUTOFIT *THIN *BLACK 2 *GENERAL SUMMARY_HR Arial 16 *NO *WHITE *LIGHTBLUE *RIGHT *YES *AUTOFIT *THIN *BLACK 2 *GENERAL SUMMARY_DL Arial 12 *NO *BLACK *WHITE *LEFT *YES *AUTOFIT *THIN *BLACK 2 *GENERAL SUMMARY_DR Arial 12 *NO *BLACK *WHITE *RIGHT *YES *AUTOFIT *THIN *BLACK 2 *GENERAL
47
Convert Spool file to Excel (CVTSPLXL/XLS) Building the CVTSPLXL/XLS command – Car Make tabs. The Excel Workbook is created, using the report map and no formatting. CVTSPLXL FROMFILE(SERVICE_RP) SPLNBR(*LAST) + MAPNAME(@VSERVICE_MAP) STMFOPT(*REPLACE) At this point, the spreadsheet is split into separate worksheets, one for each Car Make. Without any formatting, the spreadsheet looks fairly basic.
48
Convert Spool file to Excel (CVTSPLXL/XLS) Building the CVTSPLXL/XLS command – Car Make tabs. Styles are added to the spreadsheet. These styles, make the headers distinctive with colour and fonts. All the cells are bordered. The numeric fields are right justified and formatted. CVTSPLXL FROMFILE(SERVICE_RP) SPLNBR(*LAST) MAPNAME(@VSERVICE_MAP) STMFOPT(*REPLACE) + APYSTYLES((NEW_SHEET 1 *ANY REP_TITLE) (NEW_SHEET 2 *ANY MILEAGE_HL) + (NEW_SHEET 2 G MILEAGE_HR) (DETAIL 1 *ANY DETAIL_L) + (DETAIL 1 G DETAIL_R))
49
Convert Spool file to Excel (CVTSPLXL/XLS) Building the CVTSPLXL/XLS command – Car Make tabs. Margins are applied to the spreadsheet. Columns widths are set. CVTSPLXL FROMFILE(SERVICE_RP) SPLNBR(*LAST) MAPNAME(@VSERVICE_MAP) STMFOPT(*REPLACE) + APYSTYLES((NEW_SHEET 1 *ANY REP_TITLE) (NEW_SHEET 2 *ANY MILEAGE_HL) + (NEW_SHEET 2 G MILEAGE_HR) (DETAIL 1 *ANY DETAIL_L) + (DETAIL 1 G DETAIL_R)) + COLWIDTHS((A 16) (B 22) (C 13) (D 12) (E 8) (F 9) (G 9) (H 14) (I 14) (J 14)) + XLSPRINT(*NONE *NO *NONE *YES *CM 1 1 2)
50
Convert Spool file to Excel (CVTSPLXL/XLS) Building the CVTSPLXL/XLS command – Car Make tabs. Excel placeholders are used to format the headers and footers. CVTSPLXL FROMFILE(SERVICE_RP) SPLNBR(*LAST) MAPNAME(@VSERVICE_MAP) STMFOPT(*REPLACE) + APYSTYLES((NEW_SHEET 1 *ANY REP_TITLE) (NEW_SHEET 2 *ANY MILEAGE_HL) + (NEW_SHEET 2 G MILEAGE_HR)(DETAIL 1 *ANY DETAIL_L)(DETAIL 1 G DETAIL_R)) + COLWIDTHS((A 16) (B 22) (C 13) (D 12) (E 8) (F 9) (G 9) (H 14) (I 14) (J 14)) + XLSPRINT(*NONE *NO *NONE *YES *CM 1 1 2 *DFT + '&"Arial,Bold"&14ABC Motors Ltd.' '&"Arial,Bold"&14Vehicle Service Report' + '&"Arial,Bold"&14Page &P of &N' '&"Arial"&12&F' '&"Arial"&12&A‘ + '&"Arial"&12Date : &D')
51
Convert Spool file to Excel (CVTSPLXL/XLS) Building the CVTSPLXL/XLS command – Car Make tabs. Conditional Formatting is used to highlight the name, if Next Service is empty. CVTSPLXL FROMFILE(SERVICE_RP) SPLNBR(*LAST) MAPNAME(@VSERVICE_MAP) STMFOPT(*REPLACE) + APYSTYLES((NEW_SHEET 1 *ANY REP_TITLE) (NEW_SHEET 2 *ANY MILEAGE_HL) + (NEW_SHEET 2 G MILEAGE_HR)(DETAIL 1 *ANY DETAIL_L)(DETAIL 1 G DETAIL_R)) + COLWIDTHS((A 16) (B 22) (C 13) (D 12) (E 8) (F 9) (G 9) (H 14) (I 14) (J 14)) + XLSPRINT(*NONE *NO *NONE *YES *CM 1 1 2 *DFT + '&"Arial,Bold"&14ABC Motors Ltd.' '&"Arial,Bold"&14Vehicle Service Report' + '&"Arial,Bold"&14Page &P of &N' '&"Arial"&12&F' '&"Arial"&12&A‘ + '&"Arial"&12Date : &D') + CNDFMTGRP((1 NO_SERVC ('DETAIL(B)'))) CNDFMTRULE((1 1 J *EQ 0 *NONE NO_SERV))
52
Convert Spool file to Excel (CVTSPLXL/XLS) Building the CVTSPLXL/XLS command – Summary tab. The command is run again, with the STMFOPT(*ADD), to add a summary worksheet to the Excel Workbook. CVTSPLXL FROMFILE(SERVICE_RP) SPLNBR(*LAST) + MAPNAME(@VSERVICE_MAP2) + STMFOPT(*ADD) + APYSTYLES((*ANY) (SUMM_PARENT 1 A SUMMARY_HL) (SUMM_PARENT 1 B SUMMARY_HR) + (SUMM_PARENT 1 C SUMMARY_HR) (SUMM_PARENT 1 D SUMMARY_HR) + (SUMM_PARENT 1 E SUMMARY_HR) (SUMMARY_TAB 1 A SUMMARY_DL) + (SUMMARY_TAB 1 B SUMMARY_DR) (SUMMARY_TAB 1 C SUMMARY_DR) + (SUMMARY_TAB 1 D SUMMARY_DR) (SUMMARY_TAB 1 E SUMMARY_DR))+ COLWIDTHS((A 19) (B 13) (C 17) (D 17) (E 17)) + EXCEL(*XLSX Summary) XLSPRINT(*NONE *NO *NONE *YES *CM 2 2 2 *DFT + '&"Arial,Bold"&14ABC Motors Ltd.' '&"Arial,Bold"&14Vehicle Service Summary' + '&"Arial,Bold"&14Page &P of &N' '&"Arial"&12&F' '&"Arial"&12&A' + '&"Arial"&12Date : &D')
53
Convert Spool file to Excel (CVTSPLXL/XLS) The finished Excel Workbook.
54
Convert Spool file to Excel (CVTSPLXL/XLS) Appendix. Colour Chart for use when styling.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.