Quantcast
Viewing all 177 articles
Browse latest View live

Easy table export to XLS (based on HTML)

There is a quite easy way to generate nice looking Excel files based on your APEX reports. It doesn't require any special printing engine and should work even with Excel 2003.

It supports all kind of report views as long as they are build as tables. In my case I created an export based on this pivot table output: http://gumption.org/2004/pivot_table/test_page.html
Of course my pivot table is build up as plug-in and selects data from my project data tables.

All you need to do is to get the table element (including all html code) from your rendered page and write it into a blank XLS-file.
Those are the steps you have to follow:

1. Create a new APEX item: textarea
Textarea - P1_EXPORT_DATA
HTML Form Element Attributes: style="display:none;"

2. Create a button
Button: P1_EXPORT
Action: Defined by Dynamic Action

3. Edit your table region
Static ID: YOUR_APEX_TABLE_ID
Info: Check your report template. Your table element should look similar to this:
<table border="0" cellpadding="0" cellspacing="0" summary="" id="report_#REGION_STATIC_ID#"

3. Create a Dynamic Action
Event: Click
Selection Type: Button
Button: P1_EXPORT
Actions: Execute Javascript Code & Submit Page
 - Execute Javascript Code:
$('#P1_EXPORT_DATA').val($('#YOUR_APEX_TABLE_ID').wrap('<p/>').parent().html());
$('#YOUR_APEX_TABLE_ID').unwrap();
 - Submit Page:
EXPORT

4. Create a new Branch
Branch to Page or URL - OnSubmit
Page: 1
Request: Export
Conditions - PL/SQL
:REQUEST = 'EXPORT'

5. Add a new process
Process: Export
Type: PL/SQL
Process Point: On Load - Before Header
Process:
DECLARE
     l_mime        VARCHAR2 (255);
     l_length      NUMBER;
     l_file_name   VARCHAR2 (2000);
     lob_loc       BLOB;
BEGIN
     dbms_lob.createtemporary(lob_loc, TRUE);
     DBMS_LOB.WRITE(lob_loc, LENGTH(:P1_EXPORT_DATA), 1, UTL_RAW.CAST_TO_RAW(:P1_EXPORT_DATA));
     OWA_UTIL.mime_header ('application/xls', FALSE);
     HTP.p ('Content-Length: ' || DBMS_LOB.GETLENGTH(lob_loc));
     HTP.p ('Content-Disposition: attachement; filename="my_xls_doc.xls"');
     OWA_UTIL.http_header_close;
     WPG_DOCLOAD.download_file(lob_loc);
END;

The output will look like this:


It also supports images but they must include the complete URL.

Btw.: APEX 4.2 EA is out. New Application Builder looks mostly nice but I think the region headers are far to big. Check it out yourself: https://apexea.oracle.com/i/index.html
New feature list: http://www.grassroots-oracle.com/2012/06/oracle-apex-42-early-adopter-announced.html



Tabular Form - Validation issue

I'm currently have some questions about TABULAR FORM validations. I my questions inside the APEX forum: https://forums.oracle.com/forums/thread.jspa?threadID=2407939
Questions:
1. I only want that a select list entry get selected ones not several times. It must be some kind of validation check. Is there any example available?
2. If a select list value is already set within a row then this id should not be displayed in any other row anymore.

For question one I found an answer myself. This is a validation based on the idea from Denes Kubicek.
-- Validation of Type: Function Returning Error Text 

DECLARE
l_facility_ids varchar2(32000);
l_facility_bez varchar2(200);
l_error VARCHAR2 (4000);
BEGIN
FOR i IN 1 .. apex_application.g_f07.COUNT -- select list with facilities
LOOP
IF instr(':'||l_facility_ids||':',':'||apex_application.g_f07(i)||':')>0
THEN
select description into l_facility_bez from facilities where id = apex_application.g_f07(i);

l_error :=
l_error
|| '</br>'
|| 'Row '
|| i
|| ': facility"' || l_facility_bez ||'" is already selected.';
END IF;

l_facility_ids := l_facility_ids ||':'|| apex_application.g_f07(i);
END LOOP;

RETURN LTRIM (l_error, '</br>');
END;
Is there an workaround for question two available?

First release of the PL-jrxml2pdf - Generate iReport PDFs with PL/SQL only

A while ago I wrote about and development idea creating iReport (Jasper Report) PDF-files directly inside APEX (PL/SQL).

Andreas Weiden the brain and developer behind this project finally released the first version: http://andreas.weiden.orcl.over-blog.de/

I helped him as a beta tester and I must say what he did is really amazing. Even in the beta state it worked really good. It supports a lot of functionality from iReport so I could use it even with complex reports. If you want to try it now then here is the download link: http://sourceforge.net/projects/pljrxml2pdf/



Btw.: The project itself is open source.

Getting APEX views

There is a easy way getting all APEX views just with a simple select:
select apex_view_name, comments
from apex_dictionary
where column_id = 0
order by 1;

select LPAD (' ', (LEVEL - 1) * 2) ||  apex_view_name s, comments
from (
  select 'ROOT' as apex_view_name, null as comments, null as parent_view
  from dual
  UNION
  select apex_view_name, comments, nvl(parent_view,'ROOT') as parent_view
  from apex_dictionary
  where column_id = 0
)
  connect by prior apex_view_name = parent_view
  start with parent_view is null
order SIBLINGS by apex_view_name DESC;
Current APEX views in version 4.2
APEX_VIEWSCOMMENTS
*ROOT 
**APEX_WORKSPACESAvailable Application Express (APEX) workspaces
***APEX_WS_APPLICATIONS 
****APEX_WS_DATA_GRIDWebsheet Data Grid definition
*****APEX_WS_DATA_GRID_COLReport column definitions for Websheet Data Grid columns
****APEX_WS_APP_PAGES 
***APEX_WORKSPACE_UI_TYPESThe UI Types identify the available user interface types of a workspace
***APEX_WORKSPACE_SQL_SCRIPTSIdentifies SQL Scripts used to execute SQL and PL/SQL commands
***APEX_WORKSPACE_SESSIONSApplication Express (APEX) sessions by workspace and APEX user
***APEX_WORKSPACE_SCHEMASDatabase Schemas mapped to APEX workspaces
***APEX_WORKSPACE_GROUP_USERSApplication Express (APEX) users and groups relationship
***APEX_WORKSPACE_GROUPSApplication Express (APEX) users and groups relationship
***APEX_WORKSPACE_FILESIdentifies uploaded files belonging to the workspace in the modplsql or EPG documents table
***APEX_WORKSPACE_DEVELOPERSApplication Express (APEX) developers, APEX users with privilege to develop applications
***APEX_WORKSPACE_CLICKSClicks in Application Express that are tracked by using APEX_UTIL.COUNT_CLICKS
***APEX_WORKSPACE_APEX_USERSApplication Express (APEX) users
***APEX_WORKSPACE_ACTIVITY_LOGPage view activity log detail.  One row is logged for each page view for application with logging enabled.
****APEX_WORKSPACE_LOG_SUMMARY_USRPage view activity log summarized by user for the last two weeks
****APEX_WORKSPACE_LOG_SUMMARYPage view activity log summarized by application for the last 14 days
****APEX_WORKSPACE_LOG_ARCHIVEPage view activity is a daily summary of workspace acitivity that is retained until physically purged
***APEX_WORKSPACE_ACCESS_LOGOne row is logged for each login attempt.
***APEX_TEAM_TODOSItems that need to get done - i.e. to dos.
***APEX_TEAM_MILESTONESIdentifies bugs, also known as software defects.
***APEX_TEAM_FEEDBACKIdentifies user feedback.
****APEX_TEAM_FEEDBACK_FOLLOWUPIdentifies user feedback followup.
***APEX_TEAM_FEATURESItems that need to get done - i.e. to dos.
***APEX_TEAM_BUGSIdentifies bugs, also known as software defects.
***APEX_APPLICATIONSApplications defined in the current workspace or database user.
****APEX_APPL_USER_INTERFACES 
****APEX_APPL_PLUGIN_SETTINGSStores the values of custom attribute of scope &quot;application&quot; of a plug-in.
****APEX_APPL_PLUGINSStores the meta data for the plug-ins of an application.
*****APEX_APPL_PLUGIN_FILESStores the files like CSS, images, javascript files, ... of a plug-in.
*****APEX_APPL_PLUGIN_EVENTSStores which events can be triggered by this plug-in. This events are used for binding dynamic actions.
*****APEX_APPL_PLUGIN_ATTRIBUTESStores the meta data for the dynamic attributes of a plug-in.
******APEX_APPL_PLUGIN_ATTR_VALUESStores the possible values of a plug-in attribute if it's of type selectlist.
****APEX_APPL_LOAD_TABLE_RULESIdentifies a collection of transformation rules that are to be used on the load tables.
****APEX_APPL_LOAD_TABLE_LOOKUPSIdentifies a the collection of key lookups of the data loading tables
****APEX_APPL_LOAD_TABLESIdentifies a named collection of Application Data loding tables which are used to store the metadata information of the data loading tables
****APEX_APPLICATION_WEB_SERVICESWeb Services referenceable from this Application
****APEX_APPLICATION_TREESIdentifies a tree control which can be referenced and displayed by creating a region with a source of this tree
****APEX_APPLICATION_TRANS_REPOSRepository of translation strings.  These are populated from the translation seeding process.
****APEX_APPLICATION_TRANS_MAPApplication Groups defined per workspace.  Applications can be associated with an application group.
****APEX_APPLICATION_TRANS_DYNAMICApplication dynamic translations.  These are created in the Translation section of Shared Components, and referenced at runtime via the function APEX_LANG.LANG.
****APEX_APPLICATION_TRANSLATIONSIdentifies message primary language text and translated text
****APEX_APPLICATION_THEMESIdentifies a named collection of Templates
*****APEX_APPL_THEME_DISPLAY_POINTSThe Theme Display Points identify the available display points in page and region templates
*****APEX_APPLICATION_THEME_STYLESThe Theme Style identifies the CSS file URLs which should be used for a theme
*****APEX_APPLICATION_TEMP_REPORTIdentifies the HTML template markup used to render a Report Headings and Rows
*****APEX_APPLICATION_TEMP_REGIONIdentifies a regions HTML template display attributes
*****APEX_APPLICATION_TEMP_POPUPLOVIdentifies the HTML template markup and some functionality of all Popup List of Values controls for this application
*****APEX_APPLICATION_TEMP_PAGEThe Page Template which identifies the HTML used to organized and render a page content
*****APEX_APPLICATION_TEMP_LISTIdentifies HTML template markup used to render a List with List Elements
*****APEX_APPLICATION_TEMP_LABELIdentifies a Page Item Label HTML template display attributes
*****APEX_APPLICATION_TEMP_CALENDARIdentifies the HTML template markup used to display a Calendar
*****APEX_APPLICATION_TEMP_BUTTONIdentifies the HTML template markup used to display a Button
*****APEX_APPLICATION_TEMP_BCIdentifies the HTML template markup used to render a Breadcrumb
*****APEX_APPLICATION_TEMPLATESIdentifies reference counts for templates of all types
****APEX_APPLICATION_TABSIdentifies a set of tabs collected into tab sets which are associated with a Standard Tab Entry
****APEX_APPLICATION_SUPP_OBJECTSIdentifies the Supporting Object installation messages
*****APEX_APPLICATION_SUPP_OBJ_SCRIdentifies the Supporting Object installation SQL Scripts
*****APEX_APPLICATION_SUPP_OBJ_CHCKIdentifies the Supporting Object pre-installation checks to ensure the database is compatible with the objects to be installed
*****APEX_APPLICATION_SUPP_OBJ_BOPTIdentifies the Application Build Options that will be exposed to the Supporting Object installation
****APEX_APPLICATION_SUBSTITUTIONSApplication level definitions of substitution strings.
****APEX_APPLICATION_SHORTCUTSIdentifies Application Shortcuts which can be referenced &quot;MY_SHORTCUT&quot; syntax
****APEX_APPLICATION_PROCESSESIdentifies Application Processes which can run for every page, on login or upon demand
****APEX_APPLICATION_PARENT_TABSIdentifies a collection of tabs called a Tab Set.  Each tab is part of a tab set and can be current for one or more pages.  Each tab can also have a corresponding Parent Tab if two levels of Tabs are defined.
****APEX_APPLICATION_PAGESA Page definition is the basic building block of page. Page components including regions, items, buttons, computations, branches, validations, and processes further define the definition of a page.
*****APEX_APPLICATION_PAGE_VALIdentifies Validations associated with an Application Page
*****APEX_APPLICATION_PAGE_REGIONSIdentifies a content container associated with a Page and displayed within a position defined by the Page Template
******APEX_APPLICATION_PAGE_TREESIdentifies a tree control which can be referenced and displayed by creating a region with a source of this tree
******APEX_APPLICATION_PAGE_RPTPrinting attributes for regions that are reports
*******APEX_APPLICATION_PAGE_RPT_COLSReport column definitions used for report regions
******APEX_APPLICATION_PAGE_ITEMSIdentifies Page Items which are used to render HTML form content.  Items automatically maintain session state which can be accessed using bind variables or substitution stings.
******APEX_APPLICATION_PAGE_FLASH_CHIdentifies a Flash chart associated with a Page and Region
*******APEX_APPLICATION_PAGE_FLASH_SIdentifies the Flash chart series which comprise a Flash chart
******APEX_APPLICATION_PAGE_FLASH5Identifies a Flash chart 5 chart associated with a Page and Region
*******APEX_APPLICATION_PAGE_FLASH5_SIdentifies the Flash chart series which comprise a Flash chart
******APEX_APPLICATION_PAGE_BUTTONSIdentifies buttons associated with a Page and Region
*****APEX_APPLICATION_PAGE_PROCIdentifies SQL or PL/SQL processing associated with a page
*****APEX_APPLICATION_PAGE_MAPIdentifies the full breadcrumb path for each page with a breadcrumb entry
*****APEX_APPLICATION_PAGE_GROUPSIdentifies page groups
*****APEX_APPLICATION_PAGE_DB_ITEMSIdentifies Page Items which are associated with Database Table Columns.  This view represents a subset of the items in the APEX_APPLICATION_PAGE_ITEMS view.
*****APEX_APPLICATION_PAGE_DAIdentifies Dynamic Actions associated with a Page
******APEX_APPLICATION_PAGE_DA_ACTSIdentifies the Actions of a Dynamic Action associated with a Page
*****APEX_APPLICATION_PAGE_COMPIdentifies the computation of Item Session State
*****APEX_APPLICATION_PAGE_BRANCHESIdentifies branch processing associated with a page.  A branch is a directive to navigate to a page or URL which is run at the conclusion of page accept processing.
****APEX_APPLICATION_NAV_BARIdentifies navigation bar entries displayed on pages that use a Page Template that include a #NAVIGATION_BAR# substitution string
****APEX_APPLICATION_LOVSIdentifies a shared list of values that can be referenced by a Page Item or Report Column
*****APEX_APPLICATION_LOV_ENTRIESIdentifies the List of Values Entries which comprise a shared List of Values
****APEX_APPLICATION_LISTSIdentifies a named collection of Application List Entries which can be included on any page using a region of type List.  Display attributes are controlled using a List Template.
*****APEX_APPLICATION_LIST_ENTRIESIdentifies the List Entries which define a List.  List Entries can be hierarchical or flat.
****APEX_APPLICATION_ITEMSIdentifies Application Items used to maintain session state that are not associated with a page
****APEX_APPLICATION_GROUPSApplication Groups defined per workspace.  Applications can be associated with an application group.
****APEX_APPLICATION_COMPUTATIONSIdentifies Application Computations which can run for every page or on login
****APEX_APPLICATION_CACHINGApplications defined in the current workspace or database user.
****APEX_APPLICATION_BUILD_OPTIONSIdentifies Build Options available to an application
****APEX_APPLICATION_BREADCRUMBSIdentifies the definition of a collection of Breadcrumb Entries which are used to identify a page Hierarchy
****APEX_APPLICATION_BC_ENTRIESIdentifies Breadcrumb Entries which map to a Page and identify a pages parent
****APEX_APPLICATION_AUTHORIZATIONIdentifies Authorization Schemes which can be applied at the application, page or component level
****APEX_APPLICATION_AUTHIdentifies the available Authentication Schemes defined for an Application
****APEX_APPLICATION_ALL_AUTHAll authorization schemes for all components by Application
**APEX_UI_DEFAULTS_TABLESThe User Interface Defaults for the tables within this schema.  Used by the wizards when generating applications.
**APEX_UI_DEFAULTS_LOV_DATAIf you create a form, report, or tabular form that includes this column and if the appropriate Display As Type is set to use a list of values (Radio Group or Select List) then a Named List of Values will be created within the application and will be referenced by the resulting item or report column.
**APEX_UI_DEFAULTS_GROUPSThe User Interface Defaults for the groups within the tables in this schema.  Used by the wizards when generating applications.
**APEX_UI_DEFAULTS_COLUMNSThe User Interface Defaults for the columns within this schema.
**APEX_UI_DEFAULTS_ATTR_DICTThe Attribute Dictionary is specific to a workspace.  It is part of User Interface Defaults and can be used in report and form creation.
**APEX_THEMESList of APEX built-in, public and workspace themes

IR Bug after import of an application with new id

Today I discovered a really cruel bug in APEX.
We migrated an APEX 4.0 application into a new workspace with APEX 4.1.
The application got a new application id. The application used a lot of interactive reports. Some of the report columns where created as "Display as Text (based on LOV, escape special characters)".
After the import all LOV assignments where dropped.

Did anyone else discovered the same issue? Is there any bug fix planned in a newer version of APEX. 
In the new workspace we use version 4.1.0.00.32.

Neue Version des SQL Developers (3.2)

Es gibt eine neue Version des Oracle SQL Developers:
http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html

Neben vielen Bugfixes und Usability Erweiterungen, wurde auch eine Administrationsumgebung für den APEX Listener hinzugefügt. Siehe Release Notes - New Features:
http://www.oracle.com/technetwork/developer-tools/sql-developer/sqldev-newfeatures32-1731840.html

Aktuell gibt es eine Early Adopter (Beta) des APEX Listeners in der Version 2.0:
http://www.oracle.com/technetwork/developer-tools/apex-listener/downloads/listener-beta-1727062.html

Achja wer es bisher verpasst hat, auch APEX gibt es in einer zweiten Version des Early Adopters zum testen:
http://joelkallman.blogspot.de/2012/07/application-express-42-early-adopter-2.html

Noch ne Info:
Am 26.09 findet eine APEX SIG in Karlsruhe statt. Ich selbst halte auch ein Vortrag:
http://www.doag.org/termine/termine.php?tid=440574

APEX Tabular Forms mit Before Insert Trigger

In vielen meiner Projekte nutze ich Tabular Forms. Bei Standardspalten wie "geändert am" oder "geändert von" ist es leider nicht ohne weiteres möglich das SYSDATE und den APP_USER mitzugeben.

Der Grund liegt in den wenigen Einstellmöglichkeiten (bis mindestens APEX 4.1).  Es gibt nur einen Default Wert den ich setzen kann. Dieser wird aber nicht bei einem Update Prozess gezogen und der alte Wert bleibt bestehen.

Eine Lösung stellt hier ein "before insert or update"-Trigger dar:
CREATE OR REPLACE TRIGGER "TRG_NACHRICHTEN" before
  INSERT OR
  UPDATE ON TBL_NACHRICHTEN FOR EACH row BEGIN
  :NEW.geaendert_am := sysdate;
  :NEW.geaendert_von := UPPER(NVL(v('APP_USER'),USER));
END;

Open Source HTML/JS Charting Solutions


Balken Chart (Progress Bar) - Hidden Feature

Viele von euch kennen bestimmt die Balken-Grafik die Ihr innerhalb eines APEX Reports erstellen könnt:
Zu diesem Thema gibt es einige sehr gute Anleitungen:
EN:
http://www.inside-oracle-apex.com/more-undocumented-new-features-in-oracle-apex-31/#high_2
http://www.talkapex.com/2009/06/displaying-percentage-bar-in-apex.html
DE:
http://frankschmidt.blogspot.de/2009/06/prozentbalken-in-apex-reports.html

Neben der einfachen Verwendung in den Report Attributes, gibt es auch die Möglichkeit die Charts direkt mit einer APEX_UTIL Funktion zu generieren:
APEX_UTIL Documentation
APEX_UTIL.HTML_PCT_GRAPH_MASK (
p_number IN NUMBER DEFAULT NULL,
p_size IN NUMBER DEFAULT 100,
p_background IN VARCHAR2 DEFAULT NULL,
p_bar_background IN VARCHAR2 DEFAULT NULL,
p_format IN VARCHAR2 DEFAULT NULL)
RETURN VARCHAR2;

In diesem Zusammenhang hat Peter Raganitsch die Generierung einer Balken-Grafik innerhalb eines APEX Items beschrieben:
DOAG Tipps & Tricks: So erstellen Sie mit APEX eine Balkengrafik-Formatmaske in einem Page-Item

Nun hat man oft die Notwendigkeit eine bedingte Anzeige (Beispiel: Ampel) abzubilden. Dies geht auch mit den Balken-Grafiken in APEX. Ich zeige dies mal anhand eines Report Beispiels:
select
case when FINISHED_IN_PERCENT <= 30
then APEX_UTIL.HTML_PCT_GRAPH_MASK (FINISHED_IN_PERCENT,100,'cccccc','BF381A')
when FINISHED_IN_PERCENT >= 31 and
FINISHED_IN_PERCENT <= 70
then APEX_UTIL.HTML_PCT_GRAPH_MASK (FINISHED_IN_PERCENT,100,'cccccc','EFD13B')
when FINISHED_IN_PERCENT >= 71
then APEX_UTIL.HTML_PCT_GRAPH_MASK (FINISHED_IN_PERCENT,100,'cccccc','7DC24B')
end as chart,
ID
from ORDERS

PDF Creation with direct print dialog


This solution is based on the usage of Jasper Reports to create PDF reports inside APEX.

You may had the requirement to create a PDF document with a direct print dialog but there should be no download pop-up dialog or an in-line view appear where the end user explicitly needed to click on the print button. Seems to be a simple problem: Print dialog should immediately appear after PDF creation.

Actualy there is a quite easy workaround available:
Just add this new property under the properties section (for you document) in the iReport builder settings.

/* Property name */
net.sf.jasperreports.export.pdf.javascript
/* Property value */
this.print({bUI: true,bSilent: true,bShrinkToFit: false});
 
Now every time you create the PDF and open it. The print dialog starts automatically (at least with Adobe PDF).

Next step is to configure a way so that you do not need to open or close the PDF manually.
For that add a new HTML area with the following code on your master page (like page 1).

<script>
function refreshPDF(){
var iframe = document.getElementById('region_iframe_pdf');
iframe.src = 'f?p=&APP_ID.:2:&SESSION.:::2::';
};
</script>
<!-- iFrame element which leads to page 2 (including our Jasper Reports Call as BeforeHeader Process) -->
<iframe id="region_iframe_pdf" src="#" style="border:0px #FFFFFF none;" name="iFramePDF" scrolling="no" frameborder="0" marginheight="0px" marginwidth="0px" height="1px" width="1px"></iframe>
Now we only need to call the javascript function to refresh our page 2 (which includes our PDF generation):
javscript:refreshPDF()
This could be added as button href link or as a dynamic action.
The generated PDF on page 2 must be an embedded PDF.
The trick is that the iFrame is more or less not visible to the end user and becomes only refreshed when the end user calls the function: refreshPDF

The idea and most of the code comes from my good fellow Sebastian.

HowTo: Dynamisch berechnete Werte setzen


Wie berechne ich während der Laufzeit neue Werte und aktualisierte anschließend meine APEX Items.
Die Lösung für diese Fragestellung ist recht einfach, man nehme eine Dynamic Action nutzt die "Set Value"-Funktion um mit dieser mehrere APEX Items während der Laufzeit durch berechnete Werte zu setzen.

An Hand des folgenden Beispiels erkennen Sie die Logik:
Die Items haben  folgende Namen:
P3_TEAM
P3_NAME
P3_PUNKTE
P3_ANZ_MEISTERSCHAFTEN

Bei Auswahl eines Teams werden automatisch die Felder Name, Punkte und Anzahl Meisterschaften gesetzt.

Dieses Beispiel besteht aus einer Dynamic Action, die 3 "True"-Aktionen beinhaltet.
Die erste "True"-Aktion reagiert auf das Change Event beim APEX Item P3_TEAM (unsere Select List).
Um die Werte entsprechend zu bestimmen wird eine Set Value Funktion ausgeführt. Diese berechnet die Werte für die Items: P3_PUNKTE & P3_ANZ_MEISTERSCHAFTEN
Außerdem wird dem Item P3_NAME der Rückgabewert unseres Teams zugewiesen.
Dies geschieht auf APEX Session und auf Browser Ebene.

Nun wiederholen wir nur die Übergabe der Parameter für die anderen beiden Items, in dem wir zwei weitere "True"-Aktionen anlegen.
Es mag vielleicht etwas komplex aussehen, ist aber mit etwas Übung recht einfach anzuwenden. Außerdem bleiben Sie die ganze Zeit im APEX Standard und müssen so nicht, eine Sonderlocke aufsetzen um einen individuellen Nutzerwunsch umzusetzen.

Check-box bug in tabular form

I don't know if this is a environment problem or a general one. Anyway it is mad and took me a long while to find out what it is.
Here we go:
 - I have a tabular form with standard APEX processing.
 - The tabular form includes a single check-box column with y,n
 - The check-box column is conditional



As you can see the condition will always execute. And so it does. My column is perfectly displayed on my page.

Problem/Bug:
Now whenever I try to save my changes. Nothing happens. The "Mulit Row Update"-Process does not get executed.
After some analyzing I found out that there were no more hidden elements for the tabular form created. APEX just didn't know what to save.

If I take the conditional display away it works fine.
As you see those marked input elements disappear with the conditional single checkbox.

Current environment:
We use Application Express 4.1.0.00.32

Is this a known bug? Have you ever experienced something like that?

Update
After some more investigation and a good hint from a colleague I found the real reason.
What I didn't mentioned: All columns where conditional and in that case APEX doesn't know where to add the hidden elements. I made another column unconditional and it worked (even with my conditional single check box).
Good to know! :)

APEX SIG Event am 26.09

UILayout and S3Slider Plugin - Usability Update

Hide Interactive Report Column with jQuery


$(".apexir_WORKSHEET_DATA").find("[headers='COLUMN_NAME']").hide();
$('#COLUMN_NAME').hide();
Why would you need this? In case the end user wants to search for a text and doesn't need the corresponding column to be displayed. But you may need it in a other situation?

Pivot Beispielapplikation

Hallo Zusammen,
im Zuge der letzten APEX SIG habe ich meine Pivot Anwendung als Packaged App fertiggestellt. Wer noch Interesse an einer Kopie hat, der kann sich gern bei mir melden.
Email: tobias-arnhold@hotmail.de

Die Live Anwendung werde ich ebenfalls bald auf dem apex.oracle.com online stellen.

Pivot Beispielapplikation ist Online

Ich habe endlich etwas Zeit gefunden die Anwendung online zu bringen. Hier ist der Link:
http://apex.oracle.com/pls/apex/f?p=65580



Aktuell arbeite ich an einer modifizierten Version. Wer Interesse an einer Live-Präsentation hat, sollte die nächsten lokalen DOAG Termine im Auge behalten.

Die aktuelle Version schicken ich Interessierten auch gerne zu.

Info zur Installation:
Wer auch die automatische PDF Generierung benutzen möchte, der muss folgende Steps durchführen:
 - Aktuelle jrxml2pdf Version downloaden:  http://sourceforge.net/projects/pljrxml2pdf
 - jrxml2pdf Beispielapplikation installieren + Supporting Objects
 - In Beispielapplikation folgende neue Definition anlegen:
Name: PivotReport
jrxml for
report
(Achtung Feldgröße liegt bei APEX 4.2 nur bei 255 Zeichen, diese auf 32000 Zeichen erhöhen):
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report1" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isFloatColumnFooter="true" uuid="0a6876d5-cc17-47a9-b072-2f4be3000e61">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<queryString>
<![CDATA[select team as "Verein",
nvl(sum("11/12"),0) as "11/12", nvl(sum("10/11"),0) as "10/11",
nvl(sum("09/10"),0) as "09/10", nvl(sum("08/09"),0) as "08/09",
to_char(sysdate,'dd.mm.yyyy') as cur_date,
v('P10_USERNAME') as app_user
from (
SELECT team,
DECODE (jahr, '11/12', punkte, NULL) as "11/12",
DECODE (jahr, '10/11', punkte, NULL) as "10/11",
DECODE (jahr, '09/10', punkte, NULL) as "09/10",
DECODE (jahr, '08/09', punkte, NULL) as "08/09"
FROM (SELECT jahr, team, punkte FROM tbl_bundesliga)
)
group by team
order by team asc]]>
</queryString>
<field name="Verein" class="java.lang.String"/>
<field name="11/12" class="java.math.BigDecimal"/>
<field name="10/11" class="java.math.BigDecimal"/>
<field name="09/10" class="java.math.BigDecimal"/>
<field name="08/09" class="java.math.BigDecimal"/>
<field name="CUR_DATE" class="java.lang.String"/>
<field name="APP_USER" class="java.lang.String"/>
<variable name="PRINT1" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<pageHeader>
<band height="62">
<staticText>
<reportElement uuid="39c15a6e-237e-49f7-bb5b-343a8c60dd98" x="0" y="13" width="555" height="37"/>
<textElement textAlignment="Center">
<font size="22" isBold="true" isUnderline="true"/>
</textElement>
<text><![CDATA[Bundesliga Historie 08/09 - 11/12]]></text>
</staticText>
</band>
</pageHeader>
<columnHeader>
<band height="21" splitType="Stretch">
<line>
<reportElement uuid="08af8ace-e78a-4a9e-afdc-6b74abeef679" x="108" y="0" width="1" height="20"/>
</line>
<line>
<reportElement uuid="5a5b9e4f-672f-4f1c-be01-576545ed5efb" x="1" y="20" width="554" height="1"/>
</line>
<staticText>
<reportElement uuid="215c203d-8de5-42c4-a64f-c5af97e973d4" x="0" y="0" width="111" height="20"/>
<textElement/>
<text><![CDATA[Verein]]></text>
</staticText>
<staticText>
<reportElement uuid="6ee6eec2-5139-44fc-856d-94cbd0be7e9a" x="111" y="0" width="111" height="20"/>
<textElement/>
<text><![CDATA[11/12]]></text>
</staticText>
<staticText>
<reportElement uuid="0b89f4f7-0cd0-4326-9b10-569d3386860b" x="222" y="0" width="111" height="20"/>
<textElement/>
<text><![CDATA[10/11]]></text>
</staticText>
<staticText>
<reportElement uuid="4b5b3f24-ad6c-4e1a-befc-0aa2126e29c5" x="333" y="0" width="111" height="20"/>
<textElement/>
<text><![CDATA[09/10]]></text>
</staticText>
<staticText>
<reportElement uuid="895f102a-e381-4348-899d-3141a0b28123" x="444" y="0" width="111" height="20"/>
<textElement/>
<text><![CDATA[08/09]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="20" splitType="Stretch">
<line>
<reportElement uuid="aa17a7d8-4339-401c-a143-39b6f289299d" x="108" y="0" width="1" height="20"/>
</line>
<textField>
<reportElement uuid="125ed9f3-0ee7-4d7a-895a-4bc917fdfdaf" x="0" y="0" width="111" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{Verein}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="961d5a0f-c46e-4879-abf7-33dcd67d281f" x="111" y="0" width="111" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{11/12}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="4a923094-0df9-482a-94d7-73f0f1638c6c" x="222" y="0" width="111" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{10/11}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="aeec58bc-280a-492a-b6e4-7d42b5d7cd94" x="333" y="0" width="111" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{09/10}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="8b66b028-f274-413f-a1e6-be0900b40a17" x="444" y="0" width="111" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{08/09}]]></textFieldExpression>
</textField>
</band>
</detail>
<pageFooter>
<band height="31">
<staticText>
<reportElement uuid="a8347c0f-3c4d-42f3-99f7-766255410b0b" x="0" y="0" width="40" height="20"/>
<textElement/>
<text><![CDATA[Nutzer:]]></text>
</staticText>
<textField>
<reportElement uuid="9a8b7e7a-7482-48ff-8e70-f142b8291437" x="40" y="0" width="311" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{APP_USER}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="b6a7c7cb-e435-4341-8b6f-976c3bbad57b" x="444" y="0" width="111" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA["Datum: " + $F{CUR_DATE}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
</jasperReport>

APEX 4.1 Tabular Form - ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table

I played a bit with tabular forms on views using an instead of trigger. After following the guide from
Christian Rokitta I came really close to what I needed. After I thought I was ready I got the following error message:
ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table


I didn't understood what was wrong so I searched the APEX forum for help. I found the reason in this post: https://forums.oracle.com/forums/thread.jspa?threadID=1106262
In there Marc Sewtz wrote about the issue I discovered.

My problem was that I tried to change an already existing tabular form which used declarative validations. After I deleted those validations everything worked fine.

My page was now available in 1 second instead of 5-6 seconds. Great solution.

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

One problem solved next problem ahead. When I tried updating my tabular form I got this nice Oracle error message: ORA-01031 insufficient privileges

Why?
I simply tried to add this sub-view to my updateable view which looked like that:
CREATE OR REPLACE FORCE VIEW "LOV_YES_NO" ("D", "R") AS 
select 'Yes' as d, 'y' as r from dual
union
select  'No' as d, 'n' as r from dual;

Because "DUAL" is an Oracle system table or whatever. :) I had no privileges to update on this.
So I simply added a real master data table for this and it worked as expected.

APEX 5.0 - Statement Of Direction

Automatic language detection bug in APEX 4.2.1

I already posted a forum entry to the topic but no one had answered yet. I think the bug is a real problem so people should know about it:
https://forums.oracle.com/forums/message.jspa?messageID=10840734#10840734

Here are the details:
Automatic browser language detection can not be used in APEX applications during their runtime.

In the environment I'm working at the moment we are developing mostly German applications but database standard character set is this:
SELECT * FROM NLS_DATABASE_PARAMETERS

Parameter Value
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET WE8ISO8859P15
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN


All applications are set up with "Globalization Attributes":
 Application Primary Language: German
Application Language Derived From: Browser (use browser language preference)
Application Date Format: DD.MM.YYYY


Default behavior should be:

In all former versions of APEX it changes the default settings from the database to the browser settings.
An now:
In the current version it does NOT change the language.

For example: 
APEX 4.1 displays number values like that
10.000,00

APEX 4.2.1 displays number values like that
10,000.00

If I check the debug log I find this:
0.04096 0.00016 S H O W: application="101" page="16" workspace="" request="" session="16485344217862" 4 
0.04110 0.00044 Reset NLS settings 4
0.04155 0.00020 alter session set NLS_LANGUAGE="AMERICAN" 4
0.04174 0.00016 alter session set NLS_TERRITORY="AMERICA" 4
0.04189 0.00014 alter session set NLS_CALENDAR="GREGORIAN" 4
0.04203 0.00014 alter session set NLS_SORT="BINARY" 4
0.04217 0.00017 alter session set NLS_COMP="BINARY" 4
0.04234 0.00003 ...NLS: Set Decimal separator="." 4
0.04237 0.00014 ...NLS: Set NLS Group separator="," 4
0.04251 0.00013 ...NLS: Set g_nls_date_format="DD-MON-RR" 4
0.04264 0.00013 ...NLS: Set g_nls_timestamp_format="DD-MON-RR HH.MI.SSXFF AM" 4
0.04277 0.00032 ...NLS: Set g_nls_timestamp_tz_format="DD-MON-RR HH.MI.SSXFF AM TZR" 4
0.04309 0.00005 NLS of database and client differs, characterset conversion needed 4
0.04314 0.00257 ...Setting session time_zone to +01:00 4
0.04572 0.00005 NLS: Language=

As you see the default language is set to: NLS_LANGUAGE = "AMERICAN"
But now the second task should be to switch the language to German but this doesn't happen. Log file shows action with an empty value: NLS: Language= #empty#
 
Issue happens in all browsers: FF, Chrome, IE

Somebody else had similar issues as I did:
https://forums.oracle.com/forums/thread.jspa?threadID=2477036&tstart=0

Hope some in the APEX universe can help me here?

Thanks
Viewing all 177 articles
Browse latest View live