Friday, November 11, 2022

Oracle APEX: Use saved report name of Interactive Report in Export

Recently there was a question on Twitter about how to use the saved report name in an export of an Interactive Report in Oracle APEX
 

First, if you never heard of APEX Office Print (AOP), or in short, AOP, it's the leading document generation software for Oracle APEX. AOP allows you to create PDF, Word, Excel, PowerPoint, Text, and HTML documents with data from your database and your Oracle APEX app. AOP is unique as it's tightly integrated with Oracle APEX. You create a template in Word, Excel, PowerPoint, Text, or HTML, and tags that are included in your template will be replaced by data. In the tweet, Matic speaks about the {&interactive} tag. When you add this tag to your Word, Excel, or HTML document, AOP generates the Interactive Report in your document. AOP is even so smart that it will recognize if you have filters, highlights, groupings, etc., defined!

So I thought to create an example and see what it would take to get the Saved Report name in the document.

I went into the AOP Sample Application and clicked on the example where there are Saved Reports for an Interactive Report. The way I understand the question is how to use the name of the saved report, in our case, "3. Highlight", in the export to Excel or PDF.

The result when you export or download to Excel should be like this:

Here are the steps to get it done.

1. Create a hidden item on the page. We will use this item to store the name of the saved report.



2. Create a dynamic action on click of the Excel button and add a Set Value Action with the following JavaScript Expression:

3. Add the APEX Office Print Dynamic Action plug-in as another Action. We tell AOP we stored our template in Static Application Files with the name "aop_IR_template_saved_report.xlsx".  Our data comes from the IR, so we define the static Id of the IR region "ireport1". As output, we took Excel, but you can also take another output like PDF, for example. It's important to add the hidden item in the "Affected Elements" section, as AOP will get the values of those items too.

4. And finally, this is what our template looks like.

The hidden item is in the ireport region. You can reference the item with the following tag:
{ireport_items[0].P5061_SAVED_REPORT_TITLE}. An alternative, in case you have multiple items you want to reference, you can use {#ireport_items} ... define all your items with {tag} ... {/ireport_items}

And to get the Interactive Report, you define in a cell of your choice the tag {&interactive}.
In case you submit multiple IRs, or a combination of Classic Reports, IGs, and IRs, it would be {&interactive_1} {&interactive_2} {&classic1&} {&ig1&} etc. 


And that is it! 

I'm always amazed by how far we have brought AOP in the last 7 years. We have never been more committed to providing solutions to all of the reporting, exporting, and document generation needs you have ... and there is more to come 😁


Thursday, November 10, 2022

World Cup 2022 Challenge online!

For the last 16 years, with every big football tournament (World Cup and Euro Cup), we've launched an Oracle APEX app where you can predict the scores of the games. You can find this year's app at https://wc2022.unitedcodes.com


Features

Many people do a challenge with their friends or company, for fun, for money... Instead of using a custom-made Excel, use of email, or use of paper, you can use the World Cup 2022 Challenge site to track who's in the lead.
  • You can enter the scores of every game and see how well your predictions compare to others (overall).
  • You can create a group e.g. your company, or a team, etc and see how well you play within your group.
  • You can see statistics of predictions
History

16 years ago, I built a site to promote the use of Oracle APEX. People loved it, so I decided to update the site with every new release of APEX. You can find some more history and screenshots of how the app looked here

Oracle APEX features

When upgrading to the new Oracle APEX version, the Advisor and Upgrade assistant were run. This year the site runs on Oracle APEX 22.1, Universal theme got refreshed, the site is more mobile friendly and some components like the calendar where updated. Social authentication was re-enabled, so you can sign-up and log in with Email, Facebook or Google.

Thanks to Kevin and Theo who did most of the work!

Go and play!

Head  to the site/app and start challenging your friends 😀