Posts

Showing posts from 2013

Customising a charts legend label to reference a page item

Image
I am generating a report (Graph) based on a date field. The requirement is for the legend label to display the data beside the legend label. This leads me on the AnyChart documentation. http://www.anychart.com/products/anychart/docs/xmlReference/index.html http://www.anychart.com/products/anychart/docs/users-guide/legend-text-formatting.html First, you need to specify the legend attribute ignore_auto_item to True. If you don't do this part, whilst the item will be found (below), the format won't be applied, despite matching successfully. Then, you can define custom formats for each series. In my case, I have two series (Current Report and Previous Report). So, inside the legend node, add the following for each series: <items> <item source="Series" series="CURRENT REPORT"> <format><![CDATA[{%Icon} Current Report - &P22_CURRENT_REPORT.]]></format> </item> <item source="Series"

Accessing the last request value from a page submission

Image
When you submit the page, you will typically have page processes that run. For me, I use these request values to determine which processes are run. This is rather straight forward for on submit processes as you can just specify the condition request = Expression 1 Or, if you have multiple requests that link to this process, Request is Contained within Expression 1, and Expression 1 would be a comma delimited set of values. Request simply refers to the bind variable :REQUEST (or apex_application.g_request). If we try and do the same on a page rendering process, we no longer have access to this value - which makes sense. If you update the branch, to set the request portion of the URL, we will then be able to access the bind variable :REQUEST in all page rendering processing points. This has the obvious downside that if the user wants to reload the page,  clicks in the address bar and hits enter (or clicks refresh), the processes on that condition

Performing DML operations on the resulting IR data

Image
Around the time of 4.2 coming out, I blogged about the APEX_IR API, which enables us to get the report query. At the time, I demonstrated nothing more than rendering the resulting query, and listing all the bind variables.  Well, now comes time to put this to use. The scenario. Updating a particular column for all the rows that have been returned from the IR filters and what not. Previously, to do this, I would typically have a hidden item by utilising the APEX_ITEM.HIDDEN API, along with the using the APEX_APPLICATION.G_F0X array in an on submit page process. The downside with this (or upside, depending how you look at it) is it is only good for the displayed results. So firstly, it's important to enforce that some key field is included in the report - so that we can accurately update the data. In an example i've set up, I'm including the ID, then in the column attributes unticking the option that would enable them to hide the column. At the top of a page, I

Global list region conditions

Quite often then not, I'm adding a list region onto the global page (page 0), and specifying the condition: Current Page Is Contained Within Expression 1 (comma delimited list of pages). The trouble with this is that each time you add a new list entry, you then need to go back to page 0, edit the region conditions, and update the list of pages. Then if you delete an entry from the list, you need to remember to go and update it. It's just occured to me there has to be a simpler way where you can just query the data dictionary to get the pages list, and check if it exists in that. When you specify the target type as 'Page in this application', you will notice that the column 'entry_target' returns the URL (or similar): f?p=&APP_ID.:14:&SESSION.::&DEBUG.:::: where 14 is the page you specified. So, we can get a list of pages the list relates to with a query similar to the following: select regexp_substr(apex_application_list_entries.entry_targe

A word of caution when using an SQL report with hidden items on the same page as a tabular form

Image
tl;dr: if you are going to have a tabular form and an sql report on the same page with a hidden item, don't hide it using column attributes. I've set up the following page to document the behaviour:  http://apex.oracle.com/pls/apex/f?p=45448:23:11484095074702::::: Basically, when you have a tabular form, elements are given a name attribute such as f01. Then, any processes can reference these elements.  The trouble is, I have a SQL report, and I want to have the name column a link, which uses the ID column. I also don't want to leave the ID column showing, so I set it to hidden in column attributes. Now if I try to delete a row in the tabular form, I will run into the following issue: Now if I look at the source of the people report, I will see the hidden item has also named that field the same way as the tabular form, which will be causing a conflict for the MRU,MRD processes, and any custom process that uses the apex_application.g_f0x array.