related page 1
related page 2
NOTE: Before beginning, the XLSX Workbench functionality must be available in the your system.
Let's use standard demo report BCALV_GRID_DEMO is available in the every system (the report demonstrates how to use ALV-Grid control). We will export an output table to the Excel based form.
1 PREPARE A PRINTING PROGRAM.
1.1 Copy standard demo report BCALV_GRID_DEMO to the customer namespace, for example Z_BCALV_GRID_DEMO :
1.2 In the copied report, add new button to GUI-status 'MAIN100':
1.3 In the report line number 40, insert next code to processing the new OK-code :
1.4 Activate objects:
2 PREPARE A FORM.
2.1 Launch XLSX Workbench, and in the popup window specify a form name TEST_GRID , and then press the button «Process»:
Empty form will be displayed:
2.2 Push buttonto save the form.
2.3 Assign context FLIGHTTAB to the form:
2.4 Add new sheet to a form:
2.5 Assign created Sheet to worksheet in the Excel-template:
2.6 Add a Pattern (HEADER LINE) to the Sheet:
2.7 Add a Loop to the Sheet:
2.8 Set context binding for created Loop:
2.9 Add a Pattern (POSITION) to the Loop:
2.10 Add a Values to the Pattern (POSITION):
2.11 Make markup in the Excel template:
2.12 Set template binding for Pattern (HEADER LINE). To do it, you have to perform next steps successivery:
Select node PATTERN_HEADERLINE in the tree of the form structure;
Select cells range A1:I1 in the Excel template;
Press a button located in the item «Area in the template» of the Properties tab.
2.13 Set template binding for Pattern (POSITION). To do it, you have to perform next steps successivery:
Select node PATTERN_POSITION in the tree of the form structure;
Select cells range A2:I2 in the Excel template;
Press a button located in the item «Area in the template» of the Properties tab.
2.14 Set template binding for Values. To do it, you have to perform steps, described in the previous item. Mapping is figured below:
- CORRID (cell: A2)
- CONNID (cell: B2)
- FLDATE (cell: C2)
- PRICE (cell: D2)
- CURRENCY (cell: E2)
- PLINETYPE (cell: F2)
- SEATSMAX (cell: G2)
- SEATSOCC (cell: H2)
- PAYMENTSUM (cell: I2)
2.15 Finally, you have to set template binding as figured below:
2.16 Activate form by pressing button.
3 EXECUTION.
Run your report Z_BCALV_GRID_DEMO; ALV-grid will be displayed :
Press buttonto export Grid to Excel form :