Posts

Showing posts with the label report

APEX 5 Give me Interactive Reports

Image
One of the statements of direction for APEX 5 is multiple interactive reports on a single page. Multiple Interactive Reports – Allow any number of Interactive Reports to be defined on a single page. So, time to explore that functionality. One pattern I've used in the past is loading particular saved reports (rather than the default primary report). You may have some pre-defined filters, a row highlight, specific columns. So for demonstrations, I've built an IR on the emp table. Then I go and apply some filters, and save an alternate report: Then in the page designer assign an alias to that report. As you can see, that allows me to enter in the request portion of the URL: IR_SAL_TOTAL. However, if we add a second IR to the page and try to access that saved report, we would receive an error "Report does not exist". This is because it tries to find that that report name in both IR's. To get around this, you MUST  set a static ID property fo...

Reset an Interactive Report (IR)

Image
To reset an IR back to the default settings, you may know you can go to the actions menu, and hit reset: If you inspect the apply button you will see it's calling gReport.reset() And there are a bunch of examples using this gReport object both for resetting the report and other IR functions. https://community.oracle.com/thread/2186564 https://community.oracle.com/thread/2595066 http://www.apex-at-work.com/2010/03/building-ir-filters-with-ajax-not.html http://www.apexninjas.com/blog/2012/06/the-greport-search-function-for-apex-interactive-reports/ The problem? This is not documented, and with APEX 5 supporting multiple IRs, this will no longer work. In your console, if you enter gReport, you will see that object no longer exists. The other technique you can use is the clear cache portion of the URL. According to the docs : To reset an interactive report in a link, use the string "RIR" in the Clear-Cache section of a URL. This is equivalent to the ...

Getting around large exports with RTF report templates

Image
If you are on a slow connection like me, you may find how much of a pain it is deploying apps that house some BI publisher report templates. It only takes a few templates before your app export becomes 10MB+ in size. Perhaps in a future release, report templates will be treated in the same way as application images, in that you can add them as a script to supporting objects so that you don't need to export the templates each and every deployment. If you haven't seen, apex_util has a procedure to download report queries, so by using that procedure coupled with storing your files in your own maintained table, you can avoid the issue of massive application exports. First create a table to store the templates: create table rtf_template( code varchar2(25) PRIMARY KEY , layout BLOB); / Then, add your template file to the table. We will need two application items (or 1 will do if you identify the layout with exactly the same name as the query). So I've created: ...

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" ...

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....

Two Apex 4.2 Noteworthy APIs

Well, yesterday oracle released the first early adopter of application express, having had a chance to have a little play around, these are the ones that caught my attention: APEX_IR See:  http://apex.oracle.com/pls/apex/f?p=38997:1:0::NO:RP,1:P1_MARQUEE_FEATURE:Interactive%20Report%20Enhancements There are currently some interactive reports utility functions/procedures as part of the apex_util package. These will now be deprecated, and functionality will be added to a package named APEX_IR. The most exciting addition is the ability to get the derived IR query (from added filters/sorts). Without any published API docs, I can only assume this is through the function get_report. Further, I set up an example on page 2 of the sample database application. Created a new popup page with a dynamic region with the following source: declare l_report apex_ir.t_report; begin l_report := apex_ir.get_report( p_region_id => 6506762112827941367, p_page_id =>...