Type | Template | Report |
---|---|---|
Excel | Template | Report |
Excel | Template | Report |
Word | Template | Report |
Excel XML | Template | Report |
Word XML | Template | Report |
Adobe PDF | Template | Report |
xtt->MERGE( IV_BLOCK_NAME = ‘R’ IS_BLOCK =
{"TITLE"=>"Title", "T"=>[{"GROUP"=>"GRP A", "CAPTION"=>"<Caption 1 />", "DATE"=>"2020-10-21", "SUM1"=>5971.44, "SUM2"=>5021.46}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 2 />", "DATE"=>"2020-10-19", "SUM1"=>2276.75, "SUM2"=>7717.2}, {"GROUP"=>"GRP B", "CAPTION"=>"<Caption 3 />", "DATE"=>"2020-10-20", "SUM1"=>3031.38, "SUM2"=>445.22}, {"GROUP"=>"GRP A", "CAPTION"=>"<Caption 4 />", "DATE"=>"2020-10-21", "SUM1"=>9476.79, "SUM2"=>3683.27}, {"GROUP"=>"GRP A", "CAPTION"=>"<Caption 5 />", "DATE"=>"2020-10-21", "SUM1"=>4604.0, "SUM2"=>5525.85}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 6 />", "DATE"=>"2020-10-19", "SUM1"=>2159.71, "SUM2"=>2260.94}, {"GROUP"=>"GRP B", "CAPTION"=>"<Caption 7 />", "DATE"=>"2020-10-20", "SUM1"=>2490.3, "SUM2"=>6388.81}, {"GROUP"=>"GRP A", "CAPTION"=>"<Caption 8 />", "DATE"=>"2020-10-21", "SUM1"=>5476.81, "SUM2"=>406.18}, {"GROUP"=>"GRP D", "CAPTION"=>"<Caption 9 />", "DATE"=>"2020-10-18", "SUM1"=>689.66, "SUM2"=>518.6}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 10 />", "DATE"=>"2020-10-19", "SUM1"=>5451.87, "SUM2"=>4061.85}, {"GROUP"=>"GRP D", "CAPTION"=>"<Caption 11 />", "DATE"=>"2020-10-18", "SUM1"=>4573.55, "SUM2"=>5436.0}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 12 />", "DATE"=>"2020-10-19", "SUM1"=>1196.35, "SUM2"=>522.46}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 13 />", "DATE"=>"2020-10-19", "SUM1"=>7686.95, "SUM2"=>2727.98}, {"GROUP"=>"GRP D", "CAPTION"=>"<Caption 14 />", "DATE"=>"2020-10-18", "SUM1"=>978.18, "SUM2"=>295.55}, {"GROUP"=>"GRP D", "CAPTION"=>"<Caption 15 />", "DATE"=>"2020-10-18", "SUM1"=>71.12, "SUM2"=>8878.56}], "DATE"=>"2020-10-21", "TIME"=>"12:12:12", "DATETIME"=>"20201021121212"}
).
To represent table in a template you have to declare it as a internal table
" Document structure
BEGIN OF ts_root,
footer TYPE string,
header TYPE string,
t TYPE tt_rand_data, " internal flat table ( In template {R-T} )
date TYPE d, " 8
time TYPE t, " 6
datetime TYPE char14, " date(8) + time(6)
END OF ts_root.
Where tt_rand_data is a standard table
" Random table data
BEGIN OF ts_rand_data,
group TYPE string,
caption TYPE string,
date TYPE d,
sum1 TYPE p LENGTH 13 DECIMALS 2,
sum2 TYPE p LENGTH 13 DECIMALS 2,
END OF ts_rand_data,
tt_rand_data TYPE STANDARD TABLE OF ts_rand_data WITH DEFAULT KEY,
The template
The pattern for rows can take several rows (From row with first {R-T} to the last one)
Data filling
" {R-T} in a temaplte. @see get_random_table description
ls_root-t = cl_main=>get_random_table( ).
" For printing
ls_root-footer = 'Footer'.
ls_root-header = 'Header'.
The final result for MS Word
All list objects in Excel with corresponding formulas would be properly zoomed.
Ctl + F3
Also data validation are expanding automatically
Formulas with scope are supported (Worksheet or Workbook)
Including “Print titles”