Type | Template | Report |
---|---|---|
Excel | Template | Report |
Excel | Template | Report |
Excel | Template | Report |
Word | Template | Report |
Adobe PDF | Template | Report |
Excel XML | Template | Report |
xtt->MERGE( IV_BLOCK_NAME = ‘DOC’ IS_BLOCK =
{"F_TITLE"=>"First title", "L_TITLE"=>"Last title"}
).
xtt->MERGE( IV_BLOCK_NAME = ‘R’ IS_BLOCK =
{"TITLE"=>"Title 1", "BOTTOM"=>"Bottom 1", "T"=>[{"GROUP"=>"GRP A", "CAPTION"=>"<Caption 1 />", "DATE"=>"2020-10-21", "SUM1"=>5971.44, "SUM2"=>5021.46}, {"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}, {"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}]}{"TITLE"=>"Title 2", "BOTTOM"=>"Bottom 2", "T"=>[{"GROUP"=>"GRP A", "CAPTION"=>"<Caption 1 />", "DATE"=>"2020-10-21", "SUM1"=>5971.44, "SUM2"=>5021.46}, {"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 A", "CAPTION"=>"<Caption 8 />", "DATE"=>"2020-10-21", "SUM1"=>5476.81, "SUM2"=>406.18}, {"GROUP"=>"GRP B", "CAPTION"=>"<Caption 3 />", "DATE"=>"2020-10-20", "SUM1"=>3031.38, "SUM2"=>445.22}, {"GROUP"=>"GRP B", "CAPTION"=>"<Caption 7 />", "DATE"=>"2020-10-20", "SUM1"=>2490.3, "SUM2"=>6388.81}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 2 />", "DATE"=>"2020-10-19", "SUM1"=>2276.75, "SUM2"=>7717.2}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 6 />", "DATE"=>"2020-10-19", "SUM1"=>2159.71, "SUM2"=>2260.94}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 10 />", "DATE"=>"2020-10-19", "SUM1"=>5451.87, "SUM2"=>4061.85}, {"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 9 />", "DATE"=>"2020-10-18", "SUM1"=>689.66, "SUM2"=>518.6}, {"GROUP"=>"GRP D", "CAPTION"=>"<Caption 11 />", "DATE"=>"2020-10-18", "SUM1"=>4573.55, "SUM2"=>5436.0}, {"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}]}{"TITLE"=>"Title 3", "BOTTOM"=>"Bottom 3", "T"=>[{"GROUP"=>"GRP D", "CAPTION"=>"<Caption 15 />", "DATE"=>"2020-10-18", "SUM1"=>71.12, "SUM2"=>8878.56}, {"GROUP"=>"GRP D", "CAPTION"=>"<Caption 9 />", "DATE"=>"2020-10-18", "SUM1"=>689.66, "SUM2"=>518.6}, {"GROUP"=>"GRP D", "CAPTION"=>"<Caption 14 />", "DATE"=>"2020-10-18", "SUM1"=>978.18, "SUM2"=>295.55}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 12 />", "DATE"=>"2020-10-19", "SUM1"=>1196.35, "SUM2"=>522.46}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 6 />", "DATE"=>"2020-10-19", "SUM1"=>2159.71, "SUM2"=>2260.94}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 2 />", "DATE"=>"2020-10-19", "SUM1"=>2276.75, "SUM2"=>7717.2}, {"GROUP"=>"GRP B", "CAPTION"=>"<Caption 7 />", "DATE"=>"2020-10-20", "SUM1"=>2490.3, "SUM2"=>6388.81}, {"GROUP"=>"GRP B", "CAPTION"=>"<Caption 3 />", "DATE"=>"2020-10-20", "SUM1"=>3031.38, "SUM2"=>445.22}, {"GROUP"=>"GRP D", "CAPTION"=>"<Caption 11 />", "DATE"=>"2020-10-18", "SUM1"=>4573.55, "SUM2"=>5436.0}, {"GROUP"=>"GRP A", "CAPTION"=>"<Caption 5 />", "DATE"=>"2020-10-21", "SUM1"=>4604.0, "SUM2"=>5525.85}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 10 />", "DATE"=>"2020-10-19", "SUM1"=>5451.87, "SUM2"=>4061.85}, {"GROUP"=>"GRP A", "CAPTION"=>"<Caption 8 />", "DATE"=>"2020-10-21", "SUM1"=>5476.81, "SUM2"=>406.18}, {"GROUP"=>"GRP A", "CAPTION"=>"<Caption 1 />", "DATE"=>"2020-10-21", "SUM1"=>5971.44, "SUM2"=>5021.46}, {"GROUP"=>"GRP C", "CAPTION"=>"<Caption 13 />", "DATE"=>"2020-10-19", "SUM1"=>7686.95, "SUM2"=>2727.98}, {"GROUP"=>"GRP A", "CAPTION"=>"<Caption 4 />", "DATE"=>"2020-10-21", "SUM1"=>9476.79, "SUM2"=>3683.27}]}
).
While processing a table it is necessary to determine the bounds of the “output area”. That’s why you have to define nested blocks (table of tables etc) very carefully.
" Structure of document
BEGIN OF ts_root,
title TYPE string,
bottom TYPE string,
t TYPE tt_rand_data, " Table within another table (lt_root)
END OF ts_root.
DATA:
lt_root TYPE STANDARD TABLE OF ts_root.
...
ro_xtt->merge( is_block = lt_root iv_block_name = 'R' ).
If you pass the whole table as a parameter to merge
method the bounds for ZCL_XTT_WORD_DOCX
, ZCL_XTT_EXCEL_XML
and ZCL_XTT_PDF
will be the entire document. For the ZCL_XTT_EXCEL_XML
the bounds will be a spreadsheet.
For MS Word the {R} bounds will be the document itself with trailing ‘Page Break’ And {R-T} bounds will be 1 row without header
As for ‘Xml Spreadsheet 2003’ format {R} bounds will be middle sheet
And after data replication each ts_root row will be a single sheet
I want to emphasize that TITLE is not a key word. This is just a structure field, not more than
For pdf class you have to name replicated page as IV_BLOCK_NAME parameter of MERGE method. And if you want page breaks within the document set the attribute of the first child as here …