From report to excel export package brief manual ================================================ Follow next steps to advance your report for MS Excel export: ------------------------------------------------------------- 1. Attach rpt2xls library (or copy rpt2xls package into report program units as in demo) 2. Press "edit margin" button on layout model editor and create text item "Page & of &" in layout margin section 3. Create also in margin section button item "Export to Excel", double click on button to go on property palette and change "Button behavior type" to PL/SQL, and insert into "Button behavior PL/SQL trigger" next code: procedure U_EXCELButtonAction is begin RPT2XLS.Run; end; 4. Unpress "edit margin" button and for all report layout fields you want to transfer into excel sheet from left to right and up to down you should create format triggers (double click on field, go to property palette, go to format trigger property) using RPT2XLS.put_cell procedure. After each last left fields insert RPT2XLS.new_line procedure. Available procedure parameters you may see in package source. To simplify this work you may create only one format trigger on frame level for all fields into each frame (as you see in demo) Note: The repeating frame format trigger fires twice for records started from new pages (reports bug?) So don't place format triggers on repeating frame level. Use any field or frame inside of repeating frame. 5. Finally, create after report trigger: function AfterReport return boolean is begin RPT2XLS.release_memory; return (TRUE); end; Addons for hidding report output and directly send it to MS Excel: ------------------------------------------------------------------ 1. Set report system parameter DESFORMAT initial value to pdf 2. Set report system parameter DESNAME initial value to %TEMP%\xxx.tmp 3. Set report system parameter DESTYPE initial value to file 4. Set report system parameter PRINTJOB initial value to No 5. Create next After Report trigger: function AfterReport return boolean is begin RPT2XLS.Run; RPT2XLS.release_memory; return (TRUE); end; Addons for matrix reports: -------------------------- The main problem in matrix that reports processes horisontal direction after vertical one, therefore then used default created matrix layout the horisontal headers in excel printed below matrix. I solved this task by creating the separate repeating frame for matrix headers (see example layout). 1. Create default matrix report using report wizard 2. In data model insert: - summary column COL (counter of horisontal colunm) into horisontal direction group - summary column COLMAX (maximum of COL) on report level 3. In layout model remove matrix horisontal headers and create new header frame above matrix frame as in example 4. Create above-mentioned procedures, triggers and excel button (use COL and COLMAX variables for positioning of matrix cell fields in excel) Addons for excel data formatting: --------------------------------- Excel uses general cell format by default, so "00123" will be reformatted to "123". Set RPT2XLS.put_cell Format parameter to "@" to ensure text format or use any excel valid format.