Search This Blog

Wednesday, June 17, 2020

Create Excel File From Classic Report in Oracle Apex Using Java Script

Create Excel File From Classic Report in Oracle Apex Using Java Script
1. Upload File 

Download File

2. Copy Pest the Code

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SheetJS JS-XLSX In-Browser HTML Table Export Demo</title>

<style>
.xport, .btn {
display: inline;
text-align:center;
}
a { text-decoration: none }
#data-table, #data-table th, #data-table td { border: 1px solid black }
</style>
<style type="text/css"></style></head>
<body>
<!--[if gt IE 9]-->
<script type="text/javascript" src="#APP_IMAGES#download/xlsx.full.min.js.download"></script>
<![endif]-->


<!--[if lte IE 9]>
<script type="text/javascript" src="shim.min.js"></script>
<script type="text/javascript" src="xlsx.full.min.js"></script>
<script type="text/javascript" src="Blob.js"></script>
<script type="text/javascript" src="FileSaver.js"></script>
<![endif]-->



<script>
function doit(type, fn, dl) {
var elt = document.getElementById('testid');
var wb = XLSX.utils.table_to_book(elt, {sheet:"Sheet JS"});
return dl ?
XLSX.write(wb, {bookType:type, bookSST:true, type: 'base64'}) :
XLSX.writeFile(wb, fn || ('Downloaded File.' + (type || 'xlsx')));
}
</script>

<br>
<pre><b>Export it!</b></pre>
<table id="xport">
<tbody><tr><td><pre>XLSX Excel 2007+ XML</pre></td><td>
<p id="xportxlsx" class="xport"><input type="submit" value="Export to XLSX!" onclick="doit(&#39;xlsx&#39;);"></p>
<p id="xlsxbtn" class="btn"></p>
</td></tr>
<tr><td><pre>XLSB Excel 2007+ Binary</pre></td><td>
<p id="xportxlsb" class="xport"><input type="submit" value="Export to XLSB!" onclick="doit(&#39;xlsb&#39;);"></p>
<p id="xlsbbtn" class="btn"></p>
</td></tr>
<tr><td><pre>Comma Separated Values</pre></td><td>
<p id="xportcsv" class="xport"><input type="submit" value="Export to CSV!" onclick="doit(&#39;csv&#39;);"></p>
<p id="csvbtn" class="btn"></p>
    
</td></tr>
</tbody></table>
</body></html>

3. Create Report Region And Set Static ID - testid

Tuesday, June 2, 2020

Oracle Apex Success Message Remove After 5 Second

Oracle Apex Success Message Remove After 5 Second


setTimeout(function() {
  $("#t_Alert_Success").remove();
}, 5000);

Sunday, May 31, 2020

Overlap Region And Chat box Button


Overlap Region

1. Create a region and then region properties>> Appearance>> CSS Class>>  a-DevToolbar a-DevToolbar a-DevToolbar--right

Chat Box Button
1. Create a button and fixed a ID in static ID Then Copy pest the below CSS into Style

<style>
#id{
  z-index:100;
  position:fixed;
  width:60px;
  height:60px;
  bottom:40px;
  right:40px;
  background-color: rgba(55, 76, 139, 0.81);
  color:#FFF;
  border-radius:50px;
  text-align:center;
  box-shadow: 2px 2px 3px #999;
}
.my-id{
  margin-top:22px;
}
</style>

Footer Fixed On Bottom Of The Screen CSS Oracle Apex

1. Create a Region with position footer in 0 (global) page. And static id will  'footer'

2. Copy Pest the CSS in Source

<style>
  .footer {
   position: fixed;
   left: 0;
   bottom: 0;
   width: 100%;
   background-color: red;
   color: white;
   text-align: center;
}

3. Copy Pest the HTML in Footer Text

<div class="footer" style="border-style: outset;background-color:#efefef;color:#f5831e" >
© Developed and Maintained by ...............
<img src="Image Src" alt=".........." width="48" height="15"> </div>

Saturday, May 30, 2020

Dynamic Text Logo In Oracle Apex

Dynamic Text Logo In Oracle Apex

1. Create a Application Item. Like  AI_HEADER

2. Create a Application Process Like Below

begin
if to_number(:app_page_id)=1 then
:AI_HEADER:='Home Page';
else
:AI_HEADER:='Other Page';
end if;
end ;

3. Set  AI_HEADER into Shared Component >> User Interface >> Logo >> Custom
&AI_HEADER.

Done

Wednesday, May 27, 2020

Screenshot From Oracle Apex By JavaScript

Step 1 . Download the file from Here

Step 2. Upload the file into Static Application Files

Step 3. Copy-Pest the source into Page>> JavaScript>>File UTLs

Step 4. Copy-Pest the JavaScript Into Page>> Function and Global Variable Declaration

function screenshot(){
html2canvas(document.body).then(function(canvas) {
var a = document.createElement('a');
a.href = canvas.toDataURL("image/jpeg").replace("image/jpeg", "image/octet-stream");
a.download = 'image.jpg';
a.click();
}); }  

Step 5. Create a button and call dynamic action with click event and JavaScript Action and

call the function :   screenshot();

Tuesday, April 14, 2020

Redirect One Server App To Another Server App Without Second Time Login In Oracle Apex


1. Create Report With URL Generation                Source Server 

 SELECT   'http://URL/f?p=' 

          || '101'
          || ':'
          || 2
          || ':'
          || :APP_SESSION
          || '::::P2_USER,P2_SESSION_ID,P2_LOG_ID,P2_BRANCH_CODE:'
          || 'admin' -- :app_user (this user must be common between server)
          || ','
          || :APP_SESSION
          || ','
          || :AI_LOG_ID  -- This one is just for passing value
          || ','
          || :AI_BRANCH_CODE CARD_LINK,  --This one is just for passing value
          '48' CARD_TITLE,
          'Go Another Server App' CARD_TEXT
     FROM DUAL
 
2. Create A Public page with like below items               Destination Server           
     
P2_USER,P2_SESSION_ID,P2_LOG_ID,P2_BRANCH_CODE:'

3. Create a Process on load before header for authentication


begin
apex_authentication.login (p_username   =>:P2_USER,
                           p_password   => '123');
                                    
Exception
    when others then raise_application_error(-20001, sqlerrm);
End;

4. Create a Dynamic Action On Load with Submit event


5. Create a branch and select the page where you want to redirect.


6. Create Custom Authentication with boolean return function like below


function my_authentication (

    p_username in varchar2,
    p_password in varchar2 )
    return boolean
is
    
begin
    Return true;
exception
    when NO_DATA_FOUND then return false;
end;

Don't Forget to Copy past the function to Authentication Function Name

Monday, April 13, 2020

Universal Unique Identifier (UUID)


Using SYS_GUID()

UUID is the SYS_GUID() function provided by Oracle to produce a Globally Unique Identifier, their equivalent of a UUID.

SELECT SYS_GUID() FROM dual;

SYS_GUID()
--------------------------------
E7FBCFDD32B4B95BE0301A0A010AF268

Only Number In Oracle Apex Test Field



$(".allow-decimal").keypress(function (e) {
    if(e.which == 46){
        if($(this).val().indexOf('.') != -1) {
            return false;
        }
    }
    if (e.which != 8 && e.which != 0 && e.which != 46 && (e.which < 48 || e.which > 57)) {
        return false;
    }
});


allow-decimal

onfocusout="this.value=Number(this.value).toFixed(4)"

Sunday, April 12, 2020

Remove Spinners From Oracle Apex

 To Remove Spinner From Oracle Apex Just Use This CSS.
Page Properties  ->  CSS  -> Inline

.u-Processing {
   display:none !important;
}

Create a Form Using Python for Save Data into Excel like a Database

#Download Pyhton from here https://www.python.org/downloads/  #Download Python: #Click the “Download Python 3.x.x” button (the latest versio...