Excel Merge and Download using Custom Template in APEX
For Merging cells in Excel and for other CSS in download property, i.e to create down loadable XLS formatted sheets from any version of APEX use the following steps: 1. Create a new blank page in the application using Customized template. In that customized template remove all the contents in the page, like navigation menus, APEX page Toolbar, and others , since by putting this in a Before Header process on a page, the entire page will be downloaded as a native Excel Spreadsheet. 2. Create PLSQL Region with no template. — Should use recursion for a full tree, but we only need executives. DECLARE l_dirtotal NUMBER (12, 2); BEGIN HTP.p (‘<table border=1 white-space=nowrap><tr style=”background-color:silver;”> <th colspan=5>Employee</th><th>Title</th><th>Salary</th> <th>Direct Report Total</th></tr>’ ); FOR c_exec IN (SELECT * FROM employee WHERE direct_report_id IS NULL) LOOP SELECT SUM (salary) INTO l_dirtotal FROM employee WHERE direct_report_id = c_exec.ID; HTP.p ( ‘<tr height=80><th align=right><img src=”‘ || c_exec.image || ‘”></th><th colspan=4 style=”white-space:nowrap;font-size:36px;color:green;background-color:#CCFFCC;”>’ || c_exec.NAME || ‘</th><th>’ || c_exec.title || ‘</th> <th style=”font-size:36px;”>’…
Read More