Example is given below to sort detail data block data (toggle ASC or DESC) with push buttons used as header of the grid, by SE Tting Order_by property of data block using Set_block_property command. The following is the screens shot of this example and this form can be downloaded from the below link:download in this E Xample the data block is being used, one was to contain push buttons to sort data and one was to hold the data in detail BL Ock. On every push button of the header the following code are written on when-button-pressed trigger:
begin if NVL (Get_block_property ( " Scott_emp ' , order_by), ' ename ASC ' ) = ' ename ASC ' then set_block_property ( ' scott_emp ' , order_by, ' ename desc ' "); Else set_block_property (' scott_emp ', order_by, ' ename ASC '); End if;Go_block (' scott_emp '); Execute_query; End;
Above example when I am getting the current setting of the block, I am reading it in Upper Case because it returns in upper case even if I am setting the property in lower case.
Sort Detail Data Block example-oracle Forms