Sunday, July 27, 2014

APEX - a better way of arranging regions

I've always struggled with getting the regions to look decent, and since all of my Apps have been for my personal use or internal to the company I haven't worried too much about it.

However, I'm now writing one for a client so the look is important.

I have a couple of Gauge charts that I want to put side-by-side, but using the APEX region settings just couldn't get it to work.

Then I discovered the "Region Attributes" field and the "float" attribute.

To get the charts to sit side by side:

Create an html region, in my example I call it "Sessions" and leave it blank.

Edit the region, and in the field near the bottom called "Region Attributes" put this:

style="width:700px"

(or however wide you want it).

Next. create a new chart region, I called it "Total Active Sessions", and make the "Sessions" region the parent.

Make the Template "No Template"

Make the "Start New Row=Yes" in Grid Layout

Scroll down to the "Region Attributes" field and enter

style="float:left; width: 100px"

Create the chart, I used a gauge, this was the SQL:

select count(*) value,150 max_value from v$session where status='ACTIVE' and username is not null

Create the second region, again make the parent "Sessions" and No Template,
Start New Row is "NO", Column Span is Automatic and New Column is Yes.

Scroll down to Region Attributes and enter

style="float:left; width: 100px; clear:none"

The second chart SQL is virtually the same as the first:

select count(*) value,150 max_value from v$session where status='INACTIVE' and username is not null


The charts should now sit next to each other. You can fiddle with the values to shift the charts around.








No comments:

Post a Comment