« December 2005 | Main | October 2006 »

July 13, 2006

Getting and Setting Sort Preferences

Q:For reports that have clickable column headers, HTML DB remembers this sorting choice by establishing a preference named FSP_P_R_SORT with a value of "fsp_sort_(_desc)". I would like to be able to programatically get and set this preference. Essentially, I would like to save (and re-establish) the user's sorting preference, but I can't rely on the built-in mechanism to do this because the region source is generated from a PL/SQL block, and the resulting query can vary significantly. Getting the App and Page ID's are no problem, but I'd rather not hard-code in a Region ID (if that's even what that 3rd number is). Is there some way to access this value from within a PL/SQL process? Thanks. -Rich

A:It is possible to find the region_id using htmldb_application.g_plug_id (plugs are regions) via g_plug_name

This code will show the approach:

begin
  htp.tableOpen;
  htp.tableRowOpen;
  htp.tableHeader('region_id');
  htp.tableHeader('region_name');
  htp.tableRowClose;
  for i in 1.. htmldb_application.g_plug_id.COUNT loop
    htp.tableRowOpen;
      htp.tableData(htmldb_application.g_plug_id(i));
      htp.tableData(htmldb_application.g_plug_name(i));
    htp.tableRowClose;
  end loop;
  htp.tableClose;
end;

Here is the full solution:

Before Header Process: Set region sort preference

declare
  l_region_id varchar2(20);
begin
  -- find the ID of the region
  for i in 1.. htmldb_application.g_plug_id.COUNT loop
 
    if htmldb_application.g_plug_name(i) = :P1_REGION_NAME then
      l_region_id := htmldb_application.g_plug_id(i);
    end if;
 
  end loop;
 
  :P1_REGION_FSP_SORT := 'FSP' || :APP_ID || '_P' || :APP_PAGE_ID || '_R' || l_region_id || '_SORT';
end;


On Submit Process: Reset Sort Change

HTMLDB_UTIL.SET_PREFERENCE(
p_preference => :P1_REGION_FSP_SORT
, p_value => :P1_FSP_DEFAULT_SORT_COLUMN);

Item: P1_FSP_DEFAULT_SORT_COLUMN is set to the column value I want to reset to, ie. fsp_sort_1_desc

Posted by rimblas at 9:57 AM

July 3, 2006

Griot's Spray-On Protective Bra

I tried Griot's Spray-On Protective Bra on the new M Coupe in preparation for a track day event at BIR

The product works great, it does exactly what it says and it doesn't hurt the paint. No scratches, no problems with water. It creates a film similar to static cling decals, which is then easy to just peal off.

Prepping the car for the spray though did take a while. It was a time consuming process with the complicated contours of the front fascia of the M Coupe.

Then to make matters worse, I ran out of the product before finishing up!! Check out the pics of the before and after with 1/3 of the front still not covered. Hard to tell on the picture below, but the left side of the picture (driver side) you can see it's still not completely covered as is the bottom spoiler/air splitter.

Oh well, I guess some protection is better than none.

BeforeAfter

Posted by rimblas at 11:06 AM