Friday, October 25, 2019

Menu Expand & Collapse in Oracle Apex

---19 or above
(function(ut, $) {

var TREE_NAV_WIDGET_KEY = 'nav';

$(window).on('theme42ready', function() {
    /* Make sure that the navigation menu is collapsed on page load */
    if (ut.toggleWidgets.isExpanded(TREE_NAV_WIDGET_KEY)){
        ut.toggleWidgets.collapseWidget(TREE_NAV_WIDGET_KEY);
    }

    /* Expand on mouse over, collapse on mouse out */
    $('.apex-side-nav.js-navCollapsed .t-Body-nav').hover(
        function(){
            ut.toggleWidgets.expandWidget(TREE_NAV_WIDGET_KEY);
        },
        function() {
            ut.toggleWidgets.collapseWidget(TREE_NAV_WIDGET_KEY);
        }
    );
});

})(apex.theme42, apex.jQuery);


---19 or above

$(window).on("theme42ready", function() {
if ($("body").hasClass("js-navExpanded")) {
$("#t_Button_navControl").click();
}

$(".apex-side-nav.js-navCollapsed .t-Body-nav").hover(
function(){
$("#t_Button_navControl").click();
},
function(){
$("#t_Button_navControl").click();
}
);

});



Sunday, October 20, 2019

select 1st and 15th of every month

select to_char(days, 'fmMon ddth'||' - '||'fmmm/dd/yyyy') days
from
(select sysdate + level as days
from dual
connect by level <= to_date ('09/30/2008', 'mm/dd/yyyy') - sysdate)
where extract(day from days) in (1, 15)
/

DAYS
---------------------
Jun 15th - 06/15/2008
Jul 1st - 07/01/2008
Jul 15th - 07/15/2008
Aug 1st - 08/01/2008
Aug 15th - 08/15/2008
Sep 1st - 09/01/2008
Sep 15th - 09/15/2008



SQL> SELECT TO_CHAR(TO_DATE('1900-01-01', 'YYYY-MM-dd'), 'dth')
  2    FROM DUAL
  3  /

TO_
---
2nd

SQL> select ADD_MONTHS(trunc(sysdate,'YEAR'),12)-1 from dual
  2  /

ADD_MONTH
---------
31-DEC-19

SQL> select trunc(to_date('18-sep-2006','dd-mon-yyyy'),'year') from dual;

TRUNC(TO_
---------
01-JAN-06

SQL> SELECT round(sysdate,'YYYY'),add_months(trunc(sysdate,'YYYY')-1,12) from dual
  2  /

ROUND(SYS ADD_MONTH
--------- ---------
01-JAN-20 31-DEC-19


There's an in-built SQL function to do this.

Function Name: TRUNC

SQL> SELECT TRUNC(TO_DATE('17-DEC-2001'),'YEAR') "First Day" FROM Dual;

First Day
---------
01-JAN-01

SQL> SELECT TRUNC(SysDate,'YEAR') "First Day" FROM Dual;

First Day
---------
01-JAN-02

https://www.viralpatel.net/useful-oracle-queries/

Tuesday, October 15, 2019

Friday, October 11, 2019

cgicmd.bat report run

file location E:\wapp\config\domains\base_domain\config\fmwconfig\servers\WLS_REPORTS\applications\reports_12.2.1\configuration

;pdfenhancements:    userid=oe report=utf8test.rdf destype=cache desformat=pdf

quiumdba: server=rep_wls_reports_ipihr userid=hr/i@orcl destype=cache desformat=pdf paramform=no %*
quiumdbaexl: server=rep_wls_reports_ipihr userid=hr/i@orcl destype=cache desformat=spreadsheet paramform=no %*




///
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;                                                 ;
; OracleAS Reports Services                       ;
; CGICMD.DAT                                      ;
;                                                 ;
; Example CGICMD.DAT Mapping file                 ;
;                                                 ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Syntax: 
;      KEY : VALUE
; Where:
; KEY - the first argument of the rwservlet URL request (case sensitive).
; VALUE - command line parameters and/or special parameters.
;
; Keys can be referenced in the following ways:
;
;    1. Parameter on command line to the reports servlet
;          e.g. http://machine/servlet/rwservlet?KEY
;
;    2. Parameter on command line to a reports jsp
;          e.g. http://machine/mydir/myreport.jsp?KEY
;
;    3. Within a reports jsp - in the rw:report custom tag
;          e.g. <rw:report parameters="KEY">
;
; In addition to the Reports Server command line parameters, VALUE can include special parameters
; represented as "%X", where X identifies the parameter. Currently recognized special
; parameters:
;
;  %0 - %9 - 0..9 arguments from original rwservlet URL request. Note that %0 refers to the key itself.
;  %* - entire contents (all arguments) of original rwservlet URL request.
;  %D - request users to input database userid everytime they run the report.
;  %P - request for report parameter form in HTML format. It generates the PARAMFORM=HTML
;       construction on the first submission of the URL and PARAMFORM=NO upon parameter form submission.
; CGICMD.DAT Usage Notes
;   1. Multiple keys in this file MUST be separated by an EXTRA empty line.
;   2. Extra spaces are ignored. Multi-line entries allowed.
;   3. Lines starting with ";" character are treated as a comments.
;   4. Comments within a key or key value are NOT allowed.
;   5. NLS language support is provided and can be used (encoding should match the one
;      used in HTML request - no language conversion of any kind is attempted.
;   6. For %P special parameter, HTML format is by default mapped to the HTMLTABLE format in this release.
;      The HTML format in the future may be mapped to the HTMLCSS format.
;
;;;;;;;;;;;; Example Key Entries
;  Example 1:  Run a simple breakb report and output to HTML
orqa: report=breakb.rdf destype=cache desformat=html server=repserver

; Example 2: prompt for userid the first time, then use database userid stored in the cookie subsequently.
report_defaultid: report=breakb.rdf destype=cache desformat=html server=repserver

; Example 3: use %D to require user authentication every time
report_secure: report=breakb.rdf destype=cache desformat=html server=repserver %D

; Example 4:  Take all arguments from URL and send it to the reports server
run: %*

; Example 5:  Run breakb report with HTML parameter form.
breakbparam : report=breakb.rdf destype=cache desformat=html server=repserver userid=scott/tiger@mydb %P

; Example 6: take all URL arguments, and also generate a HTML parameter form 
runp: %* %P

; Example 7: Run an Express Report. Replace <MYHOST> with the name of the machine running the Express server. The
; builder on-line help explains the rest of the parameters (the /sl, st etc. etc.)
express: report=my_expr_rep express_server="server=ncacn_ip_tcp:<MYHOST>/sl=1/st=1/ct=0/sv=1/" desformat=htmlcss userid=scott/tiger@mydb destype=cache server=repserver

;;;;;;;;;;;; Keys for Reports Demos
; Using default/in-process server.
; JSPs
;charthyperlink_ias: userid="scott/tiger@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=%DBHOSTNAME%)(PORT=%DBPORT%))(CONNECT_DATA=(SID=%DBSID%)))" %*

;charthyperlink_ids: userid=scott/tiger@ %*

;barcodeweb:         userid=oe

;parmformjsp:        userid=oe

;tutorial:           userid=oe

; Paper Reports
;xmldata:            userid=oe report=inventory_report.rdf destype=cache p_filelocation="http://%HOSTNAME%:%OC4JPORT%/reports/examples/xml_pds/scripts/" desformat=pdf

;barcodepaper:       userid=oe report=shippingmanifest.rdf destype=cache desformat=pdf

;distributionpaper:  userid=oe report=inventory_report_dist.rdf distribute=yes destination=exampledistribution.xml

;pdfenhancements:    userid=oe report=utf8test.rdf destype=cache desformat=pdf

quiumdba: server=rep_wls_reports_ipihr userid=jpldba/j@ipihr destype=cache desformat=pdf paramform=no %*
quiumdbaexl: server=rep_wls_reports_ipihr userid=ipihr/i@ipihr destype=cache desformat=spreadsheet paramform=no %*

;;;;;;;;;;;;


///

asaduzzaman

asaduzzaman

Sunday, October 6, 2019

How to Run oracle report in oracle apex

javascript:var x=window.open('http://172.16.1.93:9002/reports/rwservlet?userid=ipihr/i@ipihr&desformat=PDF&p_unit='+  document.getElementById('P36_UNIT').value +'&p_INTERVIEW_DATE='+  document.getElementById('P36_INTERVIEW_DATE').value +'&p_DEPARTMENT='+  document.getElementById('P36_DEPARTMENT').value +'&p_DESIGNATION='+  document.getElementById('P36_DESIGNATION').value +  '&destype=cache&report=e:/global/Stepshr/hr/report/interview_list','_blank');


javascript:var x=window.open('http://172.16.1.93:9002/reports/rwservlet?userid=ipihr/i@ipihr&desformat=spreadsheet&P_MODULE_ID='+ document.getElementById('P1_MODULE_ID').value 
 +

 '&destype=cache&report=E:/IT_FORMS/IT _Module_wise_feedback_list_1.jsp','_blank');


javascript:var x=window.open('http://172.16.1.93:9002/reports/rwservlet?userid=ipihr/i@ipihr&desformat=PDF&P_SLNO=#SLNO#'  +''+  '&destype=cache&report=e:/jayson/hr/reports/az_old_interview_inv.jsp','_blank');

Thursday, October 3, 2019

How to Configure ORDS in Apache Tomcat with oracle Apex

1. All folder Create in same directory 
2. Version : apache-tomcat-8.5.11.exe 
                    jre-8u221-windows-x64.exe
                    ords-18.3.0.270.1456.zip

or check apache-tomcat what do want it..

3. All Java/ Apache - Tomcat File Clear from your PC Regedit/  C Drive etc and 

4. Restart PC

Start Now 

 Conn Sys as sysdba

alter user apex_public_user acount unlock;

alter user apex_public_user identified by Databsae#1;

alter user ORDS_PUBLIC_USER identified by Databsae#1;



Open CMD  
Microsoft Windows [Version 10.0.17134.1006]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\AbdulQuium>cd..

C:\Users>cd..

C:\>cd C:\Oracle\Apex_listener     ---Ords Location 

C:\Oracle\Apex_listener>java -jar ords.war
This Oracle REST Data Services instance has not yet been configured.
Please complete the following prompts

Enter the location to store configuration data:C:\Oracle\Apex_listener
Enter the name of the database server [localhost]:
Enter the database listen port [1521]:
Enter 1 to specify the database service name, or 2 to specify the database SID [1]:2
Enter the database SID [xe]:orcl
Enter the database password for ORDS_PUBLIC_USER:
Confirm password:

Retrieving information.
Enter 1 if you want to use PL/SQL Gateway or 2 to skip this step.
If using Oracle Application Express or migrating from mod_plsql then you must enter 1 [1]:
Enter the database password for APEX_PUBLIC_USER:
Confirm password:
Enter 1 to specify passwords for Application Express RESTful Services database users (APEX_LISTENER, APEX_REST_PUBLIC_USER) or 2 to skip this step [1]:2
Sep 27, 2019 3:16:10 AM
INFO: reloaded pools: []
Sep 27, 2019 3:16:10 AM oracle.dbtools.rt.config.setup.SchemaSetup install
INFO: Oracle REST Data Services schema version 18.3.0.r2701456 is installed.
Enter 1 if you wish to start in standalone mode or 2 to exit [1]:2

C:\Oracle\Apex_listener>


///
Open CMD 

Microsoft Windows [Version 10.0.17134.1006]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\AbdulQuium>cd..

C:\Users>cd..

C:\>cd C:\Oracle\apex_19.1\apex

C:\Oracle\apex_19.1\apex>sqlplus sys as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Fri Sep 27 04:32:26 2019

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> @apex_rest_config.sql

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

Enter a password for the APEX_LISTENER user              []
Enter a password for the APEX_REST_PUBLIC_USER user              []
...set_appun.sql
...create APEX_LISTENER and APEX_REST_PUBLIC_USER users

PL/SQL procedure successfully completed.
........
............

////

OPEN CMD

C:\Oracle\apex_19.1\apex>sqlplus

SQL*Plus: Release 12.2.0.1.0 Production on Fri Sep 27 02:53:39 2019

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Enter user-name: sys as sysdba
Enter password:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> start apxconf.sql

      PORT
----------
      8383

Enter values below for the XDB HTTP listener port and the password for the Application Express ADMIN user.
Default values are in brackets [ ].
Press Enter to accept the default value.
...set_appun.sql
================================================================================
This script can be used to change the password of an Application Express
instance administrator. If the user does not yet exist, a user record will be
created.
================================================================================
Enter the administrator's username [ADMIN]
User "ADMIN" exists.
Enter ADMIN's email [quium2@gmail.com]
Enter ADMIN's password []
Changed password of instance administrator ADMIN.
Enter a port for the XDB HTTP listener [      8383] 0
...changing HTTP Port




_____________________
star apxconf.sql scripts

enter admin_name email, & password
XDB HTTP listener [8080] :--0

pw : $Abcd_1234
____________________

////


C:\Oracle\Apache_Tomcat_8.5\Tomcat 8.5\webapps\ Paste ORDS.war File
C:\Oracle\apex_19.1\apex\images  all iamges file paste TO
C:\Oracle\Apache_Tomcat_8.5\Tomcat 8.5\webapps\i 

Change 
C:\Program Files\Apache Software Foundation\Tomcat 8.5\conf\server.xml

     <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

   <!----image pathname -->
      < Context docBase="C:\apex\images" path="/i" />
     <!----< Context docBase="C:\Oracle\apex_19.1\apex\images" path="/i" /> -->


Check :
Apache tomcat  : http://localhost:8080/
Apex                 : http://localhost:8080/ords

Thanks 
https://www.youtube.com/watch?v=I814NV_dzNs

To generate a PDF using JavaScript in Oracle APEX from a collection

  To generate a PDF using JavaScript in Oracle APEX from a collection, you can follow these steps: 1. Create a button or link on your APEX p...