Posts by manojsundar

Listagg of IR Column Break Report

This document is to display listagg of IR column break report. Technology and Tool Used : Oracle Apex Javascript Use Case : If a requirement arise from user to list all value in listagg manner for a control break interactive report then we can achieve the same using javascript. Steps to be followed: Step 1 :  Create a interactive report in the page. Sample query —  select ename Ename,sal, (select dname from dept a where a.deptno = e.deptno)dept from emp e Step 2 :  Create control break and aggregation based on your requirement. The result should look like the below screenshot. Step 3 :  Paste the below mentioned javascript code in page (Execute when page loads). //Set to the displayed header name var headerName = ‘Ename’; var headerNum; //ID for TH header object // Find the header to listagg $(‘a.a-IRR-headerLink’).each(function(){ var $this = $(this) if($this.text() == headerName){ headerNum = $this.closest(‘th.a-IRR-header’).attr(‘id’); }…

Read More

Interactive Report Cell Highlight based on condition using Jquery Dynamically

This document is to give background color to cell or change font color of the cell  from query using Jquery. Technology and Tool Used : o SQL o JQuery Use Case : If a requirement arise from user to highlight a cell based on dynamic condition from query or based on a column value or based on any calculation we can achieve it with this codes. In-built apex feature will highlight the entire row and user can also remove the row wise filter. But this can be overcome with the below codes. Steps to be followed: Step 1 : Create a simple report query with employee table or  build a own report query and to that add your condition within case function SELECT ename,sal,CASE WHEN JOB = ‘PRESIDENT’ THEN ‘data-style=”color:green”‘ WHEN  JOB = ‘CLERK’ AND sal <= 3000 THEN ‘data-style=”color:orange”‘ WHEN  JOB = ‘SALESMAN’ THEN ‘data-style=”color:red”‘ ELSE NULL END css_style,job FROM emp Here ‘data-style=”color:green”‘ is the css condition that gives color the the cell. Note: If you want to change the background color of cell simply alter the statement to ‘data-style=”background-color:green”‘ Step 2 Now go to report column and select the column which you want the color to be applied and under html expression paste the following code to call the class name for the column. <span #CSS_STYLE#>#JOB#</span>  Step 3 : Now go to page properties -> Execute when page loads and paste the below code. apex.jQuery(“span[data-style]”).each(…

Read More

Set Scroll to last saved location after page submit

This document is to set the scroll to last saved location. Technology and Tool Used : Oracle Apex Javascripts Use Case : If a requirement arise from user to set scroll to the last saved location i.e before page submit a user might be somewhere in the middle of the page and once the page gets submit the cursor by default will go to the top of the page , to prevent this and to bring the cursor to the last spot where the cursor was before submitting the page, this code can be used. Steps to be followed: Step 1 : Create a page item in apex screen.  Note : The item can be in hidden state also. Step 2 : Create multiple report region or any region. The condition is that the page you have must have at least two region. Note : In my case I have created 4 reports. Step 3 : Now create a javascript code to capture the last scroll location function scroll() { //var a =  $(‘.t-Dialog-bodyWrapperIn’).scrollTop(); //Capture scroll of modal page. var a =  $(window).scrollTop(); //Capture scroll of normal page. $(“#P7_SCROLL”).val(a);  // Here P7_SCROLL is the item used to store the scroll location. } Step 4 : Now create a javascript to call the function scroll() before page submit. To achieve this create a dynamic action before page submit and select execute javascript action.…

Read More

Dynamic Column Label Without Page Submit in Oracle Apex

This document is to set dynamic name to columns without submitting the page. Technology and Tool Used : Oracle Apex Javascripts Use Case : If a requirement arise from user to name columns dynamically based on a select list or a value entered by user then we can achieve with the following code. We can achieve this requirement by simply calling the page item. This only works if we submit the page. The following is to provide without submitting the page. Steps to be followed: Step 1 : Create a page item in apex screen.  Step 2 : Create a interactive report in the page Step 3 : Now create a on change dynamic action for the select list to execute javascript and paste the below mentioned javascript . var val = $v(‘P1_YEAR’);  // P1_YEAR is name of the LOV item $s(‘C387510987662930270_HDR’, ‘Savings Budget For ‘+val); //C387510987662930270_HDR is the  HTML ID of the Column Label this can be obtained by right click of the column lable and clicking inspect Step 4 : Now change the LOV and without submitting the page the column name changes

Read More

Download Jasper Report with Dynamic Names from Oracle Apex

This document is to download jasper report with dynamic names from oracle apex. Technology and Tool Used : Oracle Apex Jasper Reports Javascripts HTML Use Case : If a requirement…

Read More