create or replace package body SDT_MASTERDETAIL is
/* 2016-ÁPR.  -21 16:38 */
/* PL/PDF REPORTER 4.2.0 */
/* THIS IS GENERATED CODE. DO NOT MODIFY DIRECTLY! PLEASE CHANGE THE TEMPLATE. */
v_format1 plpdf_type.t_pageformat;
l_box1 plpdf3.t_box;
v_paragraph1 plpdf3.t_paragraph;
l_font1 plpdf3.t_font;
l_text_idx1 pls_integer;
l_tblGrid1 plpdf3.t_TableGrid := plpdf3.v_TableGrid_empty;
l_table1 plpdf3.t_Table;
l_row1 plpdf3.t_TableRow;
l_color1 plpdf_type.t_color;
l_border_side1 plpdf3.t_border1;
l_border2 plpdf3.t_Border;
l_padding1 plpdf3.t_Padding;
l_color2 plpdf_type.t_color;
l_box2 plpdf3.t_box;
l_cell1 plpdf3.t_TableCell;
l_box3 plpdf3.t_box;
v_paragraph2 plpdf3.t_paragraph;
l_text_idx2 pls_integer;
l_paragraph3 pls_integer;
l_cell2 pls_integer;
l_cell3 plpdf3.t_TableCell;
l_box4 plpdf3.t_box;
v_paragraph4 plpdf3.t_paragraph;
l_text_idx3 pls_integer;
l_paragraph5 pls_integer;
l_cell4 pls_integer;
l_cell5 plpdf3.t_TableCell;
l_box5 plpdf3.t_box;
v_paragraph6 plpdf3.t_paragraph;
l_text_idx4 pls_integer;
l_paragraph7 pls_integer;
l_cell6 pls_integer;
l_row_idx2 pls_integer;
l_row3 plpdf3.t_TableRow;
l_cell7 plpdf3.t_TableCell;
l_box6 plpdf3.t_box;
v_paragraph8 plpdf3.t_paragraph;
l_text_idx5 pls_integer;
l_paragraph9 pls_integer;
l_cell8 pls_integer;
l_cell9 plpdf3.t_TableCell;
l_box7 plpdf3.t_box;
v_paragraph10 plpdf3.t_paragraph;
l_paragraph11 pls_integer;
l_cell10 pls_integer;
l_cell11 plpdf3.t_TableCell;
l_box8 plpdf3.t_box;
v_paragraph12 plpdf3.t_paragraph;
l_paragraph13 pls_integer;
l_cell12 pls_integer;
l_row4 pls_integer;
l_parsedTable2 plpdf3.t_parsed_table;
l_row5 plpdf3.t_TableRow;
l_box9 plpdf3.t_box;
l_cell13 plpdf3.t_TableCell;
l_box10 plpdf3.t_box;
v_paragraph14 plpdf3.t_paragraph;
l_text_idx6 pls_integer;
l_paragraph15 pls_integer;
l_cell14 pls_integer;
l_cell15 plpdf3.t_TableCell;
l_box11 plpdf3.t_box;
v_paragraph16 plpdf3.t_paragraph;
l_text_idx7 pls_integer;
l_paragraph17 pls_integer;
l_cell16 pls_integer;
l_cell17 plpdf3.t_TableCell;
l_box12 plpdf3.t_box;
v_paragraph18 plpdf3.t_paragraph;
l_text_idx8 pls_integer;
l_paragraph19 pls_integer;
l_cell18 pls_integer;
l_tblGrid2 plpdf3.t_TableGrid := plpdf3.v_TableGrid_empty;
l_table3 plpdf3.t_Table;
l_row6 plpdf3.t_TableRow;
l_color3 plpdf_type.t_color;
l_box13 plpdf3.t_box;
l_cell19 plpdf3.t_TableCell;
l_box14 plpdf3.t_box;
v_paragraph20 plpdf3.t_paragraph;
l_text_idx9 pls_integer;
l_paragraph21 pls_integer;
l_cell20 pls_integer;
l_cell21 plpdf3.t_TableCell;
l_box15 plpdf3.t_box;
v_paragraph22 plpdf3.t_paragraph;
l_text_idx10 pls_integer;
l_paragraph23 pls_integer;
l_cell22 pls_integer;
l_cell23 plpdf3.t_TableCell;
l_box16 plpdf3.t_box;
v_paragraph24 plpdf3.t_paragraph;
l_text_idx11 pls_integer;
l_paragraph25 pls_integer;
l_cell24 pls_integer;
l_row_idx7 pls_integer;
l_row8 plpdf3.t_TableRow;
l_cell25 plpdf3.t_TableCell;
l_box17 plpdf3.t_box;
v_paragraph26 plpdf3.t_paragraph;
l_text_idx12 pls_integer;
l_paragraph27 pls_integer;
l_cell26 pls_integer;
l_cell27 plpdf3.t_TableCell;
l_box18 plpdf3.t_box;
v_paragraph28 plpdf3.t_paragraph;
l_paragraph29 pls_integer;
l_cell28 pls_integer;
l_cell29 plpdf3.t_TableCell;
l_box19 plpdf3.t_box;
v_paragraph30 plpdf3.t_paragraph;
l_paragraph31 pls_integer;
l_cell30 pls_integer;
l_row9 pls_integer;
l_parsedTable4 plpdf3.t_parsed_table;
l_row10 plpdf3.t_TableRow;
l_cell31 plpdf3.t_TableCell;
l_box20 plpdf3.t_box;
v_paragraph32 plpdf3.t_paragraph;
l_text_idx13 pls_integer;
l_paragraph33 pls_integer;
l_cell32 pls_integer;
l_cell33 plpdf3.t_TableCell;
l_box21 plpdf3.t_box;
v_paragraph34 plpdf3.t_paragraph;
l_text_idx14 pls_integer;
l_paragraph35 pls_integer;
l_cell34 pls_integer;
l_cell35 plpdf3.t_TableCell;
l_box22 plpdf3.t_box;
v_paragraph36 plpdf3.t_paragraph;
l_text_idx15 pls_integer;
l_paragraph37 pls_integer;
l_cell36 pls_integer;

l_box23 plpdf3.t_box;
v_paragraph38 plpdf3.t_paragraph;
l_link1 pls_integer;
/* BODYSECTION */
procedure genPDF is
 begin 
v_format1 := plpdf_util.crFormat( p_w => 595.300, p_h => 841.900);
plpdf.init1( p_orientation => 'P', p_unit => 'pt', p_format => v_format1);
plpdf.setTopMargin( p_margin => 35.400);
plpdf.setLeftMargin( p_margin => 70.850);
plpdf.setRightMargin( p_margin => 70.850);
plpdf.NewPage( );
/* PARAGRAPH */
l_box1 := plpdf3.crBox( );
v_paragraph1 := plpdf3.crParagraph( p_box => l_box1);
/* ADD TEXT */
l_font1 := plpdf3.crFont( p_fontname => 'Helvetica');
l_text_idx1 := plpdf3.addText( p_paragraph => v_paragraph1, p_text => 'Master-Detail with header and footer example', p_font => l_font1);
plpdf3.printParagraph( p_paragraph => v_paragraph1);
/* TABLE */
l_tblGrid1  := plpdf3.v_TableGrid_empty;
plpdf3.AddGridCol( p_tableGrid => l_tblGrid1, p_width => 150.800);
plpdf3.AddGridCol( p_tableGrid => l_tblGrid1, p_width => 150.900);
plpdf3.AddGridCol( p_tableGrid => l_tblGrid1, p_width => 150.900);
l_table1 := plpdf3.crTable( p_width => 0, p_grid => l_tblGrid1);
/* SDT CONTROL: GHEADER_MASTER -> FIRST */
/* TABLE ROW */
l_row1 := plpdf3.crRow();
/* TABLE CELL */
l_color1 := plpdf_util.crColor( p_r => 0, p_g => 0, p_b => 0);
l_border_side1 := plpdf3.crBorder1( p_color => l_color1, p_width => 1, p_style => 'single');
l_border2 := plpdf3.crBorder( p_top => l_border_side1, p_bottom => l_border_side1, p_left => l_border_side1, p_right => l_border_side1);
l_padding1 := plpdf3.crPadding( p_top => 0, p_bottom => 0, p_left => 0, p_right => 0);
l_color2 := plpdf_util.crColor( p_r => 168, p_g => 208, p_b => 141);
l_box2 := plpdf3.crBox( p_border => l_border2, p_padding => l_padding1, p_background_color => l_color2);
l_cell1 := plpdf3.crCell(p_box => l_box2, p_width => 151);
/* PARAGRAPH */
l_box3 := plpdf3.crBox( );
v_paragraph2 := plpdf3.crParagraph( p_box => l_box3);
/* ADD TEXT */
l_text_idx2 := plpdf3.addText( p_paragraph => v_paragraph2, p_text => 'User ID', p_font => l_font1);
l_paragraph3 := plpdf3.addParagraph(p_TableCell => l_cell1, p_Paragraph => v_paragraph2);
l_cell2 := plpdf3.addCell(p_TableRow => l_row1, p_TableCell => l_cell1);
/* TABLE CELL */
l_cell3 := plpdf3.crCell(p_box => l_box2, p_width => 151.050);
/* PARAGRAPH */
l_box4 := plpdf3.crBox( );
v_paragraph4 := plpdf3.crParagraph( p_box => l_box4);
/* ADD TEXT */
l_text_idx3 := plpdf3.addText( p_paragraph => v_paragraph4, p_text => 'Username', p_font => l_font1);
l_paragraph5 := plpdf3.addParagraph(p_TableCell => l_cell3, p_Paragraph => v_paragraph4);
l_cell4 := plpdf3.addCell(p_TableRow => l_row1, p_TableCell => l_cell3);
/* TABLE CELL */
l_cell5 := plpdf3.crCell(p_box => l_box2, p_width => 151.050);
/* PARAGRAPH */
l_box5 := plpdf3.crBox( );
v_paragraph6 := plpdf3.crParagraph( p_box => l_box5);
/* ADD TEXT */
l_text_idx4 := plpdf3.addText( p_paragraph => v_paragraph6, p_text => 'Created', p_font => l_font1);
l_paragraph7 := plpdf3.addParagraph(p_TableCell => l_cell5, p_Paragraph => v_paragraph6);
l_cell6 := plpdf3.addCell(p_TableRow => l_row1, p_TableCell => l_cell5);
/* TABLE HEADER ROW */
l_row_idx2 := plpdf3.addHeaderRow(p_table => l_table1, p_TableRow => l_row1, p_print => 'first');
/* SDT CONTROL: GFOOTER_MASTER -> ALL */
/* TABLE ROW */
l_row3 := plpdf3.crRow();
/* TABLE CELL */
l_cell7 := plpdf3.crCell(p_box => l_box2, p_width => 151);
/* PARAGRAPH */
l_box6 := plpdf3.crBox( );
v_paragraph8 := plpdf3.crParagraph( p_box => l_box6);
/* ADD TEXT */
l_text_idx5 := plpdf3.addText( p_paragraph => v_paragraph8, p_text => 'Master footer line', p_font => l_font1);
l_paragraph9 := plpdf3.addParagraph(p_TableCell => l_cell7, p_Paragraph => v_paragraph8);
l_cell8 := plpdf3.addCell(p_TableRow => l_row3, p_TableCell => l_cell7);
/* TABLE CELL */
l_cell9 := plpdf3.crCell(p_box => l_box2, p_width => 151.050);
/* PARAGRAPH */
l_box7 := plpdf3.crBox( );
v_paragraph10 := plpdf3.crParagraph( p_box => l_box7);
l_paragraph11 := plpdf3.addParagraph(p_TableCell => l_cell9, p_Paragraph => v_paragraph10);
l_cell10 := plpdf3.addCell(p_TableRow => l_row3, p_TableCell => l_cell9);
/* TABLE CELL */
l_cell11 := plpdf3.crCell(p_box => l_box2, p_width => 151.050);
/* PARAGRAPH */
l_box8 := plpdf3.crBox( );
v_paragraph12 := plpdf3.crParagraph( p_box => l_box8);
l_paragraph13 := plpdf3.addParagraph(p_TableCell => l_cell11, p_Paragraph => v_paragraph12);
l_cell12 := plpdf3.addCell(p_TableRow => l_row3, p_TableCell => l_cell11);
/* TABLE FOOTER ROW */
l_row4 := plpdf3.addFooterRow(p_table => l_table1, p_TableRow => l_row3, p_print => 'all');
l_parsedTable2 := plpdf3.InitParseTable( p_table => l_table1);
plpdf3.startTable( p_parsed_table => l_parsedTable2);
/* SDT CONTROL: GROUP_MASTER -> F_USER IN C_USERS */
for F_USER in C_USERS loop

/* TABLE ROW */
l_row5 := plpdf3.crRow();
/* TABLE CELL */
l_box9 := plpdf3.crBox( p_border => l_border2, p_padding => l_padding1);
l_cell13 := plpdf3.crCell(p_box => l_box9, p_width => 151);
/* SDT CONTROL: COLUMN -> F_USER.USER_ID */
/* PARAGRAPH */
l_box10 := plpdf3.crBox( );
v_paragraph14 := plpdf3.crParagraph( p_box => l_box10);
/* ADD TEXT */
l_text_idx6 := plpdf3.addText( p_paragraph => v_paragraph14, p_text => F_USER.USER_ID, p_font => l_font1);
l_paragraph15 := plpdf3.addParagraph(p_TableCell => l_cell13, p_Paragraph => v_paragraph14);
l_cell14 := plpdf3.addCell(p_TableRow => l_row5, p_TableCell => l_cell13);
/* TABLE CELL */
l_cell15 := plpdf3.crCell(p_box => l_box9, p_width => 151.050);
/* SDT CONTROL: COLUMN -> F_USER.USERNAME */
/* PARAGRAPH */
l_box11 := plpdf3.crBox( );
v_paragraph16 := plpdf3.crParagraph( p_box => l_box11);
/* ADD TEXT */
l_text_idx7 := plpdf3.addText( p_paragraph => v_paragraph16, p_text => F_USER.USERNAME, p_font => l_font1);
l_paragraph17 := plpdf3.addParagraph(p_TableCell => l_cell15, p_Paragraph => v_paragraph16);
l_cell16 := plpdf3.addCell(p_TableRow => l_row5, p_TableCell => l_cell15);
/* TABLE CELL */
l_cell17 := plpdf3.crCell(p_box => l_box9, p_width => 151.050);
/* SDT CONTROL: COLUMN -> F_USER.CREATED */
/* PARAGRAPH */
l_box12 := plpdf3.crBox( );
v_paragraph18 := plpdf3.crParagraph( p_box => l_box12);
/* ADD TEXT */
l_text_idx8 := plpdf3.addText( p_paragraph => v_paragraph18, p_text => F_USER.CREATED, p_font => l_font1);
l_paragraph19 := plpdf3.addParagraph(p_TableCell => l_cell17, p_Paragraph => v_paragraph18);
l_cell18 := plpdf3.addCell(p_TableRow => l_row5, p_TableCell => l_cell17);
/* TABLE BODY ROW */
plpdf3.printBodyRow( p_parsed_table => l_parsedTable2, p_TableRow => l_row5);
/* TABLE */
l_tblGrid2  := plpdf3.v_TableGrid_empty;
plpdf3.AddGridCol( p_tableGrid => l_tblGrid2, p_width => 150.800);
plpdf3.AddGridCol( p_tableGrid => l_tblGrid2, p_width => 150.900);
plpdf3.AddGridCol( p_tableGrid => l_tblGrid2, p_width => 150.900);
l_table3 := plpdf3.crTable( p_width => 0, p_grid => l_tblGrid2);
/* SDT CONTROL: GHEADER_DETAIL -> ALL */
/* TABLE ROW */
l_row6 := plpdf3.crRow();
/* TABLE CELL */
l_color3 := plpdf_util.crColor( p_r => 142, p_g => 170, p_b => 219);
l_box13 := plpdf3.crBox( p_border => l_border2, p_padding => l_padding1, p_background_color => l_color3);
l_cell19 := plpdf3.crCell(p_box => l_box13, p_width => 151);
/* PARAGRAPH */
l_box14 := plpdf3.crBox( );
v_paragraph20 := plpdf3.crParagraph( p_box => l_box14);
/* ADD TEXT */
l_text_idx9 := plpdf3.addText( p_paragraph => v_paragraph20, p_text => 'Object ID', p_font => l_font1);
l_paragraph21 := plpdf3.addParagraph(p_TableCell => l_cell19, p_Paragraph => v_paragraph20);
l_cell20 := plpdf3.addCell(p_TableRow => l_row6, p_TableCell => l_cell19);
/* TABLE CELL */
l_cell21 := plpdf3.crCell(p_box => l_box13, p_width => 151.050);
/* PARAGRAPH */
l_box15 := plpdf3.crBox( );
v_paragraph22 := plpdf3.crParagraph( p_box => l_box15);
/* ADD TEXT */
l_text_idx10 := plpdf3.addText( p_paragraph => v_paragraph22, p_text => 'Object name', p_font => l_font1);
l_paragraph23 := plpdf3.addParagraph(p_TableCell => l_cell21, p_Paragraph => v_paragraph22);
l_cell22 := plpdf3.addCell(p_TableRow => l_row6, p_TableCell => l_cell21);
/* TABLE CELL */
l_cell23 := plpdf3.crCell(p_box => l_box13, p_width => 151.050);
/* PARAGRAPH */
l_box16 := plpdf3.crBox( );
v_paragraph24 := plpdf3.crParagraph( p_box => l_box16);
/* ADD TEXT */
l_text_idx11 := plpdf3.addText( p_paragraph => v_paragraph24, p_text => 'Object type', p_font => l_font1);
l_paragraph25 := plpdf3.addParagraph(p_TableCell => l_cell23, p_Paragraph => v_paragraph24);
l_cell24 := plpdf3.addCell(p_TableRow => l_row6, p_TableCell => l_cell23);
/* TABLE HEADER ROW */
l_row_idx7 := plpdf3.addHeaderRow(p_table => l_table3, p_TableRow => l_row6, p_print => 'all');
/* SDT CONTROL: GFOOTER_DETAIL -> ALL */
/* TABLE ROW */
l_row8 := plpdf3.crRow();
/* TABLE CELL */
l_cell25 := plpdf3.crCell(p_box => l_box13, p_width => 151);
/* PARAGRAPH */
l_box17 := plpdf3.crBox( );
v_paragraph26 := plpdf3.crParagraph( p_box => l_box17);
/* ADD TEXT */
l_text_idx12 := plpdf3.addText( p_paragraph => v_paragraph26, p_text => 'Detail footer line', p_font => l_font1);
l_paragraph27 := plpdf3.addParagraph(p_TableCell => l_cell25, p_Paragraph => v_paragraph26);
l_cell26 := plpdf3.addCell(p_TableRow => l_row8, p_TableCell => l_cell25);
/* TABLE CELL */
l_cell27 := plpdf3.crCell(p_box => l_box13, p_width => 151.050);
/* PARAGRAPH */
l_box18 := plpdf3.crBox( );
v_paragraph28 := plpdf3.crParagraph( p_box => l_box18);
l_paragraph29 := plpdf3.addParagraph(p_TableCell => l_cell27, p_Paragraph => v_paragraph28);
l_cell28 := plpdf3.addCell(p_TableRow => l_row8, p_TableCell => l_cell27);
/* TABLE CELL */
l_cell29 := plpdf3.crCell(p_box => l_box13, p_width => 151.050);
/* PARAGRAPH */
l_box19 := plpdf3.crBox( );
v_paragraph30 := plpdf3.crParagraph( p_box => l_box19);
l_paragraph31 := plpdf3.addParagraph(p_TableCell => l_cell29, p_Paragraph => v_paragraph30);
l_cell30 := plpdf3.addCell(p_TableRow => l_row8, p_TableCell => l_cell29);
/* TABLE FOOTER ROW */
l_row9 := plpdf3.addFooterRow(p_table => l_table3, p_TableRow => l_row8, p_print => 'all');
l_parsedTable4 := plpdf3.InitParseTable( p_table => l_table3);
plpdf3.startTable( p_parsed_table => l_parsedTable4);
/* SDT CONTROL: GROUP_DETAIL -> F_OBJECT IN C_OBJECTS(F_USER.USERNAME) */
for F_OBJECT in C_OBJECTS(F_USER.USERNAME) loop

/* TABLE ROW */
l_row10 := plpdf3.crRow();
/* TABLE CELL */
l_cell31 := plpdf3.crCell(p_box => l_box9, p_width => 151);
/* SDT CONTROL: COLUMN -> F_OBJECT.OBJECT_ID */
/* PARAGRAPH */
l_box20 := plpdf3.crBox( );
v_paragraph32 := plpdf3.crParagraph( p_box => l_box20);
/* ADD TEXT */
l_text_idx13 := plpdf3.addText( p_paragraph => v_paragraph32, p_text => F_OBJECT.OBJECT_ID, p_font => l_font1);
l_paragraph33 := plpdf3.addParagraph(p_TableCell => l_cell31, p_Paragraph => v_paragraph32);
l_cell32 := plpdf3.addCell(p_TableRow => l_row10, p_TableCell => l_cell31);
/* TABLE CELL */
l_cell33 := plpdf3.crCell(p_box => l_box9, p_width => 151.050);
/* SDT CONTROL: COLUMN -> F_OBJECT.OBJECT_NAME */
/* PARAGRAPH */
l_box21 := plpdf3.crBox( );
v_paragraph34 := plpdf3.crParagraph( p_box => l_box21);
/* ADD TEXT */
l_text_idx14 := plpdf3.addText( p_paragraph => v_paragraph34, p_text => F_OBJECT.OBJECT_NAME, p_font => l_font1);
l_paragraph35 := plpdf3.addParagraph(p_TableCell => l_cell33, p_Paragraph => v_paragraph34);
l_cell34 := plpdf3.addCell(p_TableRow => l_row10, p_TableCell => l_cell33);
/* TABLE CELL */
l_cell35 := plpdf3.crCell(p_box => l_box9, p_width => 151.050);
/* SDT CONTROL: COLUMN -> F_OBJECT.OBJECT_TYPE */
/* PARAGRAPH */
l_box22 := plpdf3.crBox( );
v_paragraph36 := plpdf3.crParagraph( p_box => l_box22);
/* ADD TEXT */
l_text_idx15 := plpdf3.addText( p_paragraph => v_paragraph36, p_text => F_OBJECT.OBJECT_TYPE, p_font => l_font1);
l_paragraph37 := plpdf3.addParagraph(p_TableCell => l_cell35, p_Paragraph => v_paragraph36);
l_cell36 := plpdf3.addCell(p_TableRow => l_row10, p_TableCell => l_cell35);
/* TABLE BODY ROW */
plpdf3.printBodyRow( p_parsed_table => l_parsedTable4, p_TableRow => l_row10);
end loop;
plpdf3.endTable( p_parsed_table => l_parsedTable4);

end loop;
plpdf3.endTable( p_parsed_table => l_parsedTable2);
/* PARAGRAPH */
l_box23 := plpdf3.crBox( );
v_paragraph38 := plpdf3.crParagraph( p_box => l_box23);
l_link1 := plpdf.crInternalLink( );
plpdf.setLinkDest( p_link => l_link1);
plpdf3.printParagraph( p_paragraph => v_paragraph38);
plpdf.SendDoc( p_blob => v_pdf);
end;
end SDT_MASTERDETAIL;
