CREATE OR REPLACE PROCEDURE Test_C_1_v2 IS -- Minimal report --------------- CURSOR c_user IS SELECT user_id, username, created FROM all_users; l_blob BLOB; PROCEDURE theader IS BEGIN Plpdf.SetPrintFont('Arial','B',10); -- set header font: Arial 10, bold Plpdf.SetColor4Filling(200,220,255); -- set color for header background Plpdf.PrintCell(25,10,NULL); -- print an empty cell for align table center: ( 210 (A4 width) - 10mm (left margin) - 10 (right margin) - 40 - 60 - 40 (cells) ) / 2 = 25 Plpdf.PrintCell(40,10,'USER ID','1',0,'C',1); -- header print 1. cell of header: width 40mm, height: 10, full border, without line break, center align, fill background Plpdf.PrintCell(60,10,'USER NAME','1',0,'C',1); -- header print 2. cell of header: width 60mm, height: 10, full border, without line break, center align, fill background Plpdf.PrintCell(40,10,'CREATED','1',1,'C',1); -- header print 3. cell of header: width 40mm, height: 10, full border, with line break, center align, fill background END; BEGIN Plpdf.init; -- initialize, without parameters means: page orientation: portrait, unit: mm, default page format: A4 Plpdf.nopAlias; Plpdf.SetFooterProcName('x1footer'); -- set footer creator procedure Plpdf.NewPage; -- begin a new page, without parameters means: page orientation: default (portrait) Plpdf.SetPrintFont('Arial','BU',14); -- set titles font: Arial 14, bold, underline Plpdf.PrintCell(0,20,'List of Users','0',0,'C'); -- print out the title Plpdf.LineBreak(5); -- line break with 5mm Plpdf.SetPrintFont('Arial','I',10); -- set subtitle font: Arial 10, italic Plpdf.PrintCell(0,20,'Created date:' || TO_CHAR(SYSDATE,'DD-MM-YYYY'),'0',0,'C'); -- print out the subtitle: creation date Plpdf.LineBreak(20); -- line break with 20mm theader; Plpdf.SetPrintFont('Arial','',12); -- set print font of table's cell: Arial 12, regular FOR f_user IN c_user LOOP -- rows of table IF Plpdf.CheckPageBreak(10) THEN theader; Plpdf.SetPrintFont('Arial','',12); -- set print font of table's cell: Arial 12, regular END IF; Plpdf.PrintCell(25,10,NULL); -- print an empty cell for align table center Plpdf.PrintCell(40,10,TO_CHAR(f_user.user_id),'1',0,'R'); -- print cell 1 Plpdf.PrintCell(60,10,f_user.username,'1',0,'L',0); -- print cell 2 Plpdf.PrintCell(40,10,TO_CHAR(f_user.created,'YYYY. MM. DD.'),'1',1); -- print cell 3 with line break END LOOP; Plpdf.LineBreak; -- line break with last cells height (10mm) Plpdf.SetPrintFont('Arial','I',10); -- set print font: Arial 10, italic Plpdf.PrintCell(0,20,'----- End of Report -----','0',0,'C');-- print out closer string of table Plpdf.SendDoc(l_blob); -- create content -- store INSERT INTO STORE_BLOB (blob_file, created_date) VALUES (l_blob, SYSDATE); COMMIT; END; /