select apex_item.checkbox2(p_idx => 1,
p_value => c_checked_ind,
p_attributes => 'class="myCheck"' || case when c_checked_ind = 1 then ' CHECKED' else null end )
|| apex_item.hidden(p_idx => 2,
p_value => nvl(c_checked_ind, 0),
p_attributes => 'class="myAgg" '
) include_in_report,
--
apex_item.display_and_save(p_idx => 3, p_value => column_name) column_name,
apex_item.display_and_save(p_idx => 9, p_value => data_type) data_type,
apex_item.display_and_save(p_idx => 10, p_value => table_name) table_name,
--
apex_item.checkbox2(p_idx => 4, p_value => c_agg, p_attributes => case
when data_type = 'NUMBER' and column_name not like '%_ID%'
then 'class="myCheck"' || case when c_agg = 1 then ' CHECKED' else null end
else 'class="apex_disabled"'
end
) || apex_item.hidden(p_idx => 5, p_value => nvl(c_agg ,0), p_attributes => 'class="myAgg" ') agg,
--
APEX_ITEM.CHECKBOX2(p_idx => 6, p_value => c_avgg, p_attributes => case
when data_type = 'NUMBER' and column_name not like '%_ID%'
then 'class="myCheck"' || case when c_avgg = 1 then ' CHECKED' else null end
else 'class="apex_disabled"'
end
) || apex_item.hidden(p_idx => 7, p_value => nvl(c_avgg, 0), p_attributes => 'class="myAgg" ') avgg,
--
apex_item.select_list_from_query(p_idx => 8,
p_value => c_order_by,
p_query => q'[SELECT rownum d, rownum r
FROM user_tab_columns
where table_name = :P19_METRICS ]',
p_null_value => null,
p_null_text => '-'
) order_id
--
from user_tab_columns t
left outer join
(select c001 c_checked_ind,
c002 c_column_name,
c003 c_data_type,
c004 c_agg,
c005 c_avgg,
c006 c_order_by,
c007 c_table_name
from APEX_collections
WHERE collection_name = 'REPORTCOLUMNS') c on t.table_name = c.c_table_name and t.column_name = c.c_column_name
where t.table_name = :P19_METRICS
order by column_name;