Browsing "Older Posts"

APEX-AT-WORK no image

Several Interactive Reports in one ExtJS page

Von Tobias Arnhold → 6.11.2009
I created an example page for the ExtJS layout http://apex.oracle.com/pls/otn/f?p=65555 based on the solution of Roel Hartman "Using two Interactive Reports on one page"
Just follow the tree link: "Integrate IRs into one ExtJS page"

I encountered a problem when I accessed the example page with IE8. After the first page load the following error could occur:
ORA-00001: unique constraint
(APEX_030200.WWW_FLOW_COLLECTION_MEMBERS_PK) violated
After another reload the error disappears and the application works fine.

It's time for a new revolution - Update of my example app

Von Tobias Arnhold → 6.09.2009
For those who are interested in APEX, ExtJS and AJAX take a look on my new/updated example application:
http://apex.oracle.com/pls/otn/f?p=65555

Feel welcome to post some feedback!



I don't know if you have noticed it yet? ;D I updated my blog layout as well.

Building your own button in an APEX region

Von Tobias Arnhold → 5.29.2009
Have you ever experienced some issues when you wanted to create a button inside an APEX region behind an item and that button should call a javascript function.
With normal APEX features "Create a button displayed among this region's items" it's not possible as I know because APEX creates automatically a doSubmit button.

Anyway one way to fix that is to create an own button:

First create your own button, for example on:
http://www.buttongenerator.com/
or on:
http://www.buttonboost.com

Next upload the new button image into the application workspace.
Home>Application Builder>Application 100>Shared Components>Images>Create>
Application: #Your application name#
Upload New Image: #Image path#
Notes: #Additional information to the picture#

Last step is to create an "Display as Text" page item with the following settings:
Label: empty
Template: No Label
Width: 0
Post Element Text:

 
<img
id="P1_btnID1"
src="#APP_IMAGES#start.png"
// if image was set to
// "No Application Associated"
// then use #WORKSPACE_IMAGES#
alt="Set user settings"
onclick="fnc_setUser('P1_USER')"
style="cursor: pointer"
title="Set user settings"
>

Info: If the button should be right behind an item then edit the option "Begin On
New Line" to "No".
And of course you can put the img-tag also into the "Post Element Text" of an already used APEX item.

At the end it should look similar to that:

ORA-07445 _npierr+487 error in APEX runinng under a XE database

Von Tobias Arnhold → 5.15.2009
I created a dynamic pl/sql report where the select was based on an external table (transcribed through a database link).

DECLARE
v_query varchar2(1000);
BEGIN
IF :P1_INSTANCE_NAME is not null THEN
v_query := 'SELECT NAME,
VALUE,
isdefault,
isses_modifiable,
issys_modifiable,
ismodified,
isadjusted,
description
FROM v$parameter@'||:P1_INSTANCE_NAME;
ELSE
v_query := 'SELECT 1 FROM dual WHERE 1=0';
END IF;
return(v_query);
END;

Tip: If you are more interested into dynamic reports! Then here comes a really handy explanation:
http://www.apex-blog.com/oracle-apex/dynamic-report-regions-tutorial-32.html

After the login into the APEX application builder a strange download error occurred. When I clicked on a APEX link a download window opened and showed the following arguments:


At the same time when the error occurred the following entries in the alertlog file got created:

Fri May 15 13:14:43 2009
Errors in file c:\oracle\admin\xe\bdump\xe_s000_1436.trc:
ORA-07445: exception encountered: core dump [ACCESS_VIOLATION] [_npierr+487] [PC:0x5F22C3] [ADDR:0x4] [UNABLE_TO_READ] []

Fri May 15 13:15:27 2009
found dead shared server 'S000', pid = (14, 2)
Fri May 15 13:17:07 2009
Errors in file c:\oracle\admin\xe\bdump\xe_s002_2492.trc:
ORA-07445: exception encountered: core dump [ACCESS_VIOLATION] [_npierr+487] [PC:0x5F22C3] [ADDR:0x4] [UNABLE_TO_READ] []

Fri May 15 13:17:24 2009
found dead shared server 'S002', pid = (16, 1)

I looked in Metalink, the Oracle forum and the web itself and came to the following conclusion:
That error occurs when you call a database link in a web application. There is no official workaround at least no one for the XE database. It should be patched in the following Oracle database versions: 11.2, 11.1.0.6.P11

Another hint came from the Oracle forum. They meant you should set up your browser to "en-us" language. I tried it but it didn't help either.
Anyway I created a application with German language so it wouldn't be such a good hotfix. ;D

My workaround:
Creating a new table where I import the information before via a pl/sql package and the dbms scheduler. It's not really what I wanted but the only way for now.

Here are the web links I rallied to it:
Metalink note: 6798427.8
Metalink note: 809366.1
Metalink bug no.: 6798427
XE forum: Beta 3 Bug: using database link freezes apex and xdb
XE forum: Universal edition choke on en-GB browser, core dumped, ORA-07445, _npierr+4
APEX forum: page not found, ORA-07445: exception encountered: core dump

Update 22.06.2009
I had the idea to use a function selecting the external data (with execute immediate) and save this data into a temporary table.
Then I created a new APEX "Before Header Process" and called this database function and made a select into my page variables.
But I still get this error... I give up!
APEX-AT-WORK no image

Outlook calendar in APEX

Von Tobias Arnhold → 4.17.2009
Hi,
if you want to integrate your outlook calendar or some other oultook features into an APEX site use the following code in a HTML region.

<DIV STYLE="width:800px;height:400px">
<OBJECT classid=CLSID:0006F063-0000-0000-C000-000000000046
id=ViewCtlFolder
width="100%"
height="100%"
Codebase="http://activex.microsoft.com/activex/controls/office/outlctlx.CAB#ver=9,0,0,3203">
<param name="Namespace" value="MAPI">
<param name="Folder" value="Calendar">
<param name="Restriction" value="">
<param name="DeferUpdate" value="0">
</OBJECT>
</DIV>

Example page: http://apex.oracle.com/pls/otn/f?p=28737:8
More information to that topic:
http://blogs.tech-recipes.com/shamanstears/2008/04/15/outlook-creating-your-own-outlook-today-page/
http://www.outlookcode.com

That feature is just appropriable with the Internet Explorer.

Spacing APEX items

Von Tobias Arnhold → 3.13.2009
Did you ever experienced the problem when you have a couple of items in the same line/row in a HTML region and you have a select list (in the next row) which becomes so Hugh that the upper items places more and more to the right. It just looks ugly and the select list value
normally changes dynamically.
What to do?
First we need to bring a logical barrier in between the line breaks.
Using a "Stop and Start HTML Table" object in between text items and select list.
It will look like that:
Result: Just the text label is incorrect anymore.Now we have two choices:1. Using &nbsp object until it fits.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Text1:&nbsp;
Problem: The more text different there are, the more &nbsp you will need.

2. Creating a SPACER item
Create a new display only item called :P1_SPACER in front of the first text item.Now add the following text under "Element Table Cell Attributes" > style="width:200px"Edit the pixel value so that it fits into your page.

The region items will be listed like that:
In case you still have some problem with different browser presentations look at my last post.

Update 17.03.2009:
Just tested a really good hint from Patrick.
Using the ColSpan option in the select list item saves all other steps above. Set the value for ColSpan (in my case) to 3 and the same result appears. Good that I never stop learning...

Own browser check condition in APEX

Von Tobias Arnhold → 3.12.2009
The easiest way to check the browser type for conditional displaying
is to use one of the following conditions:
  • Client Browser: Mozilla, Netscape 6.x/7x or higher
  • Client Browser: Microsoft Internet Explorer 5.5,6.0 or higher
  • Client Browser: Other browsers (or older version)
That way is definitely the easiest one. But in case you have several display conditions you need to check or you want to use that check at another point (for example inside an pl/sql script) then you get some trouble.
I asked in the APEX forum for help and thanks to Andy he gave me a really good hint how to find a solution for that issue.
Forum link: http://forums.oracle.com/forums/message.jspa?messageID=3322457

In my case I wanted to use a condition inside the SQL statement of an updateable report. Because FF and IE displayed the report columns differently.

First I followed the hint from Andy and analyzed the OWA_UTIL output with the function PRINT_CGI_ENV().

BEGIN
OWA_UTIL.PRINT_CGI_ENV();
END;

The result for parameter HTTP_USER_AGENT (with FF) looks like that:

HTTP_USER_AGENT = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7 (.NET CLR 3.5.30729)

Next step was to get that output text into a variable. Function OWA_UTIL.GET_CGI_ENV('HTTP_USER_AGENT') provides the information.
I created a variable called :P1_BROWSER_TYPE and an initialization process to save the information in my variable.

IF :P1_BROWSER_TYPE NULL THEN
IF OWA_UTIL.GET_CGI_ENV('HTTP_USER_AGENT') LIKE '%MSIE 7.0%' THEN
:P1_BROWSER_TYPE := 'IE7';
ELSIF OWA_UTIL.GET_CGI_ENV('HTTP_USER_AGENT') LIKE '%MSIE 6.0%' THEN
:P1_BROWSER_TYPE := 'IE6';
ELSIF OWA_UTIL.GET_CGI_ENV('HTTP_USER_AGENT') LIKE '%Firefox/3%' THEN
:P1_BROWSER_TYPE := 'FF3';
ELSIF OWA_UTIL.GET_CGI_ENV('HTTP_USER_AGENT') LIKE '%Firefox/2%' THEN
:P1_BROWSER_TYPE := 'FF2';
ELSIF OWA_UTIL.GET_CGI_ENV('HTTP_USER_AGENT') LIKE '%Firefox/1%' THEN
:P1_BROWSER_TYPE := 'FF1';
ELSE
:P1_BROWSER_TYPE := 'UNKNOWN';
END IF;
END IF;

Now I created my updateable report with a CASE WHEN CHECK inside the SQL statement:

SELECT CASE :P1_BROWSER_TYPE WHEN 'FF3' THEN '<b><div style="width: 289px">Sum:</div></b>'
WHEN 'FF2' THEN '<b><div style="width: 289px">Sum:</div></b>'
WHEN 'FF1' THEN '<b><div style="width: 289px">Sum:</div></b>'
WHEN 'IE7' THEN '<b><div style="width: 247px">Sum:</div></b>'
WHEN 'IE6' THEN '<b><div style="width: 247px">Sum:</div></b>'
ELSE '<b><div style="width: 247px">Sum:</div></b>' END as "Sum",
...
Example app: http://apex.oracle.com/pls/otn/f?p=28737:7
Documentation link for the OWA_UTIL package: http://download-west.oracle.com/docs/cd/B12037_01/appdev.101/b10802/w_util.htm#997271