Thursday 26 May 2022

Windows List View Style Grid Reports Using JavaScript | Oracle APEX

 CSS

--------------

.ig-windows-style .a-GV-table .a-GV-cell,

.ig-windows-style .a-GV-table .a-GV-controlBreakHeader {

    border-color: transparent;

}

.ig-windows-style .a-GV-w-frozen .a-GV-table {

    border-right: none;

}

.ig-windows-style .a-GV-table tr.is-hover .a-GV-cell,

.ig-windows-style .a-GV-table tr.is-hover.is-selected .a-GV-cell {

    background-color: #f2f6ff;

}

.ig-windows-style .a-GV-table tr.is-selected .a-GV-cell,

.ig-windows-style .a-GV-table tr.is-hover.is-selected .a-GV-cell {

    background-color: #dbe8ff;

}

.ig-windows-style .a-GV-hdr {

    background-color: #fcfcfc;

}

.a-IG-contentContainer {

    margin-top: 0;

}


.ig-windows-style .u-selector {

    box-shadow: none;

    border: 1px transparent;

}


.ig-windows-style .a-GV-hdr tr .u-selector,

.ig-windows-style tr.is-selected .u-selector,

.ig-windows-style tr.is-hover .u-selector {

    box-shadow: 0 1px 1px rgba(0,0,0,.05) inset;

    border: 1px solid #404040;

}


JavaScript Initialization Code

--------------

function(config) {

    config.defaultGridViewOptions = {

        // this was mentioned in my blog: http://hardlikesoftware.com/weblog/2017/01/24/how-to-hack-apex-interactive-grid-part-2/#more-537

        // relies on internal detail of menu id generation but no other way to get this

        contextMenuId: "emp_ig_selection_actions_menu",

    };

    // Logically want to do this: config.views.grid.features.stretchColumns = false;

    // But the server may not generate the views, grid, or features objects depending on what declrative options are selected.

    // So must check for and add if needed each one. Seems like there should be an easier way :-(

    var o = config;

    "views.grid.features".split(".").forEach(function(p) { 

        if ( !o[p] ) {

            o[p] = {};

        }

        o = o[p];

    });

    o.stretchColumns = false;

/* or you could do it this way

    if (!config.views) {

        config.views = {};

    }

    if (!config.views.grid) {

        config.views.grid = {};

    }

    if (!config.views.grid.features) {

        config.views.grid.features = {};

    }

    config.views.grid.features.stretchColumns = false;

*/

    return config;

}


Static ID
--------------
emp

Monday 21 February 2022

Make Print Reports | Oracle APEX

--------Table

CREATE TABLE  "EMP" 

   ( "EMPNO" NUMBER(4,0) NOT NULL, 

"ENAME" VARCHAR2(50), 

"JOB" VARCHAR2(50), 

"MGR" NUMBER(4,0), 

"HIREDATE" DATE, 

"SAL" NUMBER(7,2), 

"COMM" NUMBER(7,2), 

"DEPTNO" NUMBER(2,0), 

"DESCRIPTION" VARCHAR2(100), 

CONSTRAINT "EMP_PK" PRIMARY KEY ("EMPNO")

   )

/


--------PL Content



Htp.p('<input type="button1" class="button button1"  class="t-Icon t-Icon--right fa fa-print" id="print" type="button" onclick="printdiv(''div_print1'');" value="Print"/><br/>

      <div id="div_print1" style="margin-top:5px;"> ');   


htp.p('

<style>

table, th, td{

    border: 1px solid black;

    border-collapse: collapse;

}

</style>

');


htp.p('<center>My Employee Reports</center>');


htp.p('<table style="width:100%"

<tr>

<th align="left">Emp No</th>

<th align="left">Emp Name</th>

<th align="right">MGR</th>

<th align="right">Salary</th>

</tr>

');


for x in (select EMPNO,ENAME,MGR,SAL FROM EMP)

loop

htp.p('

<tr>

<td>'||x.EMPNO||'</td>

<td>'||x.ENAME||'</td>

<td align="right">'||x.MGR||'</td>

<td align="right">'||x.SAL||'</td>

</tr>

');

end loop;


for x in (select sum(sal) sal from emp)

loop

htp.p('

<tr>

<td></td>

<td></td>

<td>Total</td>

<td align="right">'||x.sal||'</td>

</tr>

');

end loop;


htp.p('</table>');


htp.p('</div>');





--------Function and Global Variable Declaration


function printdiv(printpage)

{

var headstr = "<html><head><title></title></head><body>";

var footstr = "</body>";

var newstr = document.all.item(printpage).innerHTML;

var oldstr = document.body.innerHTML;

document.body.innerHTML = headstr+newstr+footstr;

window.print();

document.body.innerHTML = oldstr;

return false;

}




--------Inline


<style>

.button {

  border: none;

  color: white;

  padding: ;

  text-align: center;

  text-decoration: none;

  display: inline-block;

  font-size: ;

  margin: 4px 2px;

  transition-duration: 0.4s;

  cursor: pointer;

}


.button1 {

  background-color: white; 

  color: black; 

  border: 2px solid #4CAF50;

}


.button1:hover {

  background-color: #4CAF50;

  color: white;

}


.button2 {

  background-color: white; 

  color: black; 

  border: 2px solid #008CBA;

}


.button2:hover {

  background-color: #008CBA;

  color: white;

}


</style>

Sunday 23 February 2020

How to run report on PDF


Video Link : https://youtu.be/u9Ovpq2m96U


Table


CREATE TABLE  "BOARD_MEMBER" 
   ( "ID" NUMBER(4,0), 
 "NAME" VARCHAR2(50), 
 "DESIGNATION" VARCHAR2(50), 
 "IMAGE" BLOB, 
 "DESCRIPTION" VARCHAR2(200), 
 "FB_LINK" VARCHAR2(100), 
 "TWITTER_LINK" VARCHAR2(100), 
 "LINKEDIN" VARCHAR2(100), 
 "GMAIL_LINK" VARCHAR2(100)
   ) ;
 


JavaScript

<script type="text/javascript">
        function Export() {
            html2canvas(document.getElementById("PDF"), {
                onrendered: function (canvas) {
                    var data = canvas.toDataURL();
                    var docDefinition = {
                        content: [{
                            image: data,
                            width: 500
                        }]
                    };
                    pdfMake.createPdf(docDefinition).download("Table.pdf");
                }
            });
        }
    </script>



PL Report

--- CSS

htp.p('<style>
#PDF {
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

#PDF td, #PDF th {
  border: 1px solid #ddd;
  padding: 8px;
}

#PDF tr:nth-child(even){background-color: #f2f2f2;}

#PDF tr:hover {background-color: #ddd;}

#PDF th {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  background-color: #4CAF50;
  color: white;
}
</style>');

--- Table Header
htp.p('<table id="PDF">
  <tr>
    <th>SL</th>
    <th>Name</th>
    <th>Designation</th>
      <th>Description</th>
  </tr>');
  --- Query
  FOR X IN (SELECT ROWNUM SL,NAME,DESIGNATION,DESCRIPTION FROM BOARD_MEMBER)

  --- USING LOOP FOR Multiple data
  LOOP
  --- Table Data
  htp.p('<tr>
    <td>'||X.SL||'</td>
    <td>'||X.NAME||'</td>
    <td>'||X.DESIGNATION||'</td>
<td>'||X.DESCRIPTION||'</td>
  </tr>');
    end loop;
  htp.p('</table>');

--- Button
  htp.p('<input type="button" id="btnExport" value="Export" onclick="Export()" />
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.22/pdfmake.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js"></script>');



Classic Report



Static ID=PDF

Header Text

<input type="button" id="btnExport" value="Export" onclick="Export()" />
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.22/pdfmake.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js"></script>




IR Report

Static ID=PDF

Header Text

<input type="button" id="btnExport" value="Export" onclick="Export()" />
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.22/pdfmake.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js"></script>

Sunday 16 February 2020

Profile Card hover over it once

Video Link : https://youtu.be/M_6xK130_A8

Table


CREATE TABLE PROFILE(
ID NUMBER,
NAME VARCHAR2(50),
YOUTUBE_LINK VARCHAR2(100),
FACEBOOK_LINK VARCHAR2(100),
TWITTER_LINK VARCHAR2(100),
IMAGE BLOB);

Query 


select ID,
       NAME NAME,
       YOUTUBE_LINK,
       FACEBOOK_LINK,
       TWITTER_LINK,
        decode(nvl(dbms_lob.getlength(IMAGE),0),0,null,
       '<img class="fancybox" alt="'||apex_escape.html_attribute(ID)||'" title="'||apex_escape.html_attribute(ID)
              ||'" style="border: 4px solid #CCC; -moz-border-radius: 4px; -webkit-border-radius: 4px;" '
              ||'src="'||apex_util.get_blob_file_src('P17_IMAGE',ROWID)||'" height="75" width="75" />
      ') IMAGE
  from PROFILE


HTML

 <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css">
<div class="image-area">
<div class="img-wrapper">
#IMAGE#
<h2>#NAME#</h2>
<ul>
<li><a href=#GIT#><i class="fab fa-github"></i></a></li>
<li><a href=#INS#><i class="fab fa-instagram"></i></a></li>
<li><a href=#TWITTER_LINK#><i class="fab fa-twitter"></i></a></li>
<li><a href=#YOUTUBE_LINK#><i class="fab fa-youtube"></i></a></li>
<li><a href=#FACEBOOK_LINK#><i class="fab fa-facebook"></i></a></li>
</ul>
</div>
</div>




CSS



*

.image-area{ top: 50%; left: 50%; transform: translate(-50%, -50%); position: absolute;}
.img-wrapper{ width: 300px; height: 400px; position: relative; overflow: hidden;}
.img-wrapper:before{ content: ''; position: absolute; top: 0; left: 180%; height: 100%; width: 100%; background: rgba(255,255,255,.3); z-index: 1; transform: skew(45deg); transition: .5s;}
.img-wrapper:hover:before{ left: -180%;}
.img-wrapper img{ height: 400px; width: 300px; filter: grayscale(100%); transition: 2s;}.img-wrapper:hover img{ filter: grayscale(0%); transform: scale(1.1);}
.img-wrapper h2{ background: tomato; font-family: Poppins; color: #fff; text-align: center; text-transform: uppercase; margin: 0; padding: 10px 0; position: absolute; bottom: 0; width: 100%; transform: perspective(400px) rotateY(90deg); transform-origin: right; transition: 1s;}
.img-wrapper:hover h2{ transform: perspective(400px) rotateY(0deg);}
.img-wrapper ul{ position: absolute; top: 0; left: 0; margin: 0; padding: 0; list-style: none; background: rgba(255,255,255,0);}
.img-wrapper ul li{ background: #333; height: 40px; width: 40px; text-align: center; line-height: 40px; transform: perspective(800px) rotateY(90deg); transition: .5s; transform-origin: left;}
.img-wrapper:hover ul li{ transform: perspective(800px) rotateY(0deg);}
.img-wrapper:hover ul li:nth-child(1){ transition-delay: .2s;}
.img-wrapper:hover ul li:nth-child(2){ transition-delay: .6s;}
.img-wrapper:hover ul li:nth-child(3){ transition-delay: .8s;}
.img-wrapper:hover ul li:nth-child(4){ transition-delay: 1s;}
.img-wrapper ul li a{ color: tomato; background: rgba(255,255,255,0);}
.img-wrapper ul li i{ color: tomato; background: rgba(255,255,255,0);}
.img-wrapper ul li i:hover{ color: #fff; background: rgba(255,255,255,0);}

Friday 20 September 2019

APEX Animation Menu

APEX Animation Menu



<style>
/* START OF DEMO CSS - NOT NEEDED */
html, body { height: 100% } /* BODY BACKGROUND IMAGE DOESNT ALWAYS REACH THE BOTTOM OF THE BROWSER*/
body {
background-color: rgb(100, 100, 100);
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
color: rgb(255, 255, 255);
}
.white-background {
background-color: rgb(255, 255, 255);
color: rgb(51, 51, 51);
padding-top: 10px;
border-radius: 4px;
}
.title {
font-size: 3em;
font-weight: 700;
text-shadow: 0px 0px 5px rgb(51, 51, 51);
text-shadow: 0px 0px 5px rgba(51, 51, 51, 0.8);
text-align: center;
}
#fullscreen {
    position: fixed;
    top: 10px;
    right: 10px;
}
/* END OF DEMO CSS */

    .animate {
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}

.navbar-fixed-left {
position: fixed;
top: 0px;
left: 0px;
border-radius: 0px;
}

.navbar-minimal {
width: 60px;
min-height: 60px;
max-height: 100%;
background-color: rgb(51, 51, 51);
background-color: rgba(51, 51, 51, 0.8);
border-width: 0px;
z-index: 1000;
}

.navbar-minimal > .navbar-toggler {
position: relative;
min-height: 60px;
border-bottom: 1px solid rgb(81, 81, 81);
z-index: 100;
cursor: pointer;
}

.navbar-minimal.open > .navbar-toggler,
.navbar-minimal > .navbar-toggler:hover {
background-color: rgb(158, 202, 59);
}

.navbar-minimal > .navbar-toggler > span {
position: absolute;
top: 50%;
right: 50%;
margin: -8px -8px 0 0;
width: 16px;
height: 16px;
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE2LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDY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KCVMwLjQ0OCwyLDEsMnoiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGZpbGw9IiNGRkZGRkYiIGQ9Ik0xLjMzLDI4Ljk3bDExLjY0LTExLjY0YzAuNDU5LTAuNDU5LDEuMjA0LTAuNDU5LDEuNjYzLDAKCWMwLjQ1OSwwLjQ1OSwwLjQ1OSwxLjIwNCwwLDEuNjYzTDIuOTkzLDMwLjYzM2MtMC40NTksMC40NTktMS4yMDQsMC40NTktMS42NjMsMEMwLjg3MSwzMC4xNzQsMC44NzEsMjkuNDMsMS4zMywyOC45N3oiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGZpbGw9IiNGRkZGRkYiIGQ9Ik0yLjk5MywxNy4zM2wxMS42NDEsMTEuNjRjMC40NTksMC40NTksMC40NTksMS4yMDQsMCwxLjY2MwoJcy0xLjIwNCwwLjQ1OS0xLjY2MywwTDEuMzMsMTguOTkzYy0wLjQ1OS0wLjQ1OS0wLjQ1OS0xLjIwNCwwLTEuNjYzQzEuNzg5LDE2Ljg3MSwyLjUzNCwxNi44NzEsMi45OTMsMTcuMzN6Ii8+Cjwvc3ZnPgo=);
background-repeat: no-repeat;
background-position: 0 0;
-webkit-transition: -webkit-transform .3s ease-out 0s;
-moz-transition: -moz-transform .3s ease-out 0s;
-o-transition: -moz-transform .3s ease-out 0s;
-ms-transition: -ms-transform .3s ease-out 0s;
transition: transform .3s ease-out 0s;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}

.navbar-minimal > .navbar-menu {
position: absolute;
top: -1000px;
left: 0px;
margin: 0px;
padding: 0px;
list-style: none;
z-index: 50;
background-color: rgb(51, 51, 51);
background-color: rgba(51, 51, 51, 0.8);
}
.navbar-minimal > .navbar-menu > li {
margin: 0px;
padding: 0px;
border-width: 0px;
height: 54px;
}
.navbar-minimal > .navbar-menu > li > a {
position: relative;
display: inline-block;
color: rgb(255, 255, 255);
padding: 20px 23px;
text-align: left;
cursor: pointer;
border-bottom: 1px solid rgb(81, 81, 81);
width: 100%;
text-decoration: none;
margin: 0px;
}

.navbar-minimal > .navbar-menu > li > a:last-child {
border-bottom-width: 0px;
}
.navbar-minimal > .navbar-menu > li > a:hover {
background-color: rgb(158, 202, 59);
}
.navbar-minimal > .navbar-menu > li > a > .glyphicon {
float: right;
}

.navbar-minimal.open {
width: 320px;
}

.navbar-minimal.open > .navbar-toggler > span {
background-position: 0 -16px;
-webkit-transform: rotate(-180deg);
-moz-transform: rotate(-180deg);
-o-transform: rotate(-180deg);
-ms-transform: rotate(-180deg);
transform: rotate(-180deg);
}

.navbar-minimal.open > .navbar-menu {
top: 60px;
width: 100%;
min-height: 100%;
}

@media (min-width: 768px) {
.navbar-minimal.open {
width: 60px;
}
.navbar-minimal.open > .navbar-menu {
overflow: visible;
}
.navbar-minimal > .navbar-menu > li > a > .desc {
position: absolute;
display: inline-block;
top: 50%;
left: 130px;
margin-top: -20px;
margin-left: 20px;
text-align: left;
white-space: nowrap;
padding: 10px 13px;
border-width: 0px !important;
background-color: rgb(51, 51, 51);
background-color: rgba(51, 51, 51, 0.8);
opacity: 0;
}
.navbar-minimal > .navbar-menu > li > a > .desc:after {
z-index: -1;
position: absolute;
top: 50%;
left: -10px;
margin-top: -10px;
content:'';
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right: 10px solid rgb(51, 51, 51);
border-right-color: rgba(51, 51, 51, 0.8);
}
.navbar-minimal > .navbar-menu > li > a:hover > .desc {
left: 60px;
opacity: 1;
}
}
</style>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->

    <nav class="navbar navbar-fixed-left navbar-minimal animate" role="navigation">
<div class="navbar-toggler animate">
<span class="menu-icon"></span>
</div>
<ul class="navbar-menu animate">
<li>
<a href="#about-us" class="animate">
<span class="desc animate"> Who We Are </span>
<span class="glyphicon glyphicon-user"></span>
</a>
</li>
<li>
<a href="#blog" class="animate">
<span class="desc animate"> What We Say </span>
<span class="glyphicon glyphicon-info-sign"></span>
</a>
</li>
<li>
<a href="#contact-us" class="animate">
<span class="desc animate"> How To Reach Us </span>
<span class="glyphicon glyphicon-comment"></span>
</a>
</li>
</ul>
</nav>

</div>
<a href="http://bootsnipp.com/iframe/PbDb5" class="btn btn-primary" id="fullscreen" data-toggle="tooltip" data-placement="left" title="Full Screen"><span class="glyphicon glyphicon-fullscreen">
</span></a>