Oracle Apex 19.x external URL based on items value - oracle

I'm using Application Express 19.2.0.00.18 with Oracle Database 12c Enterprise Edition Release 12.2.0.1.0.
In our applications (from 4.x) we use Jaspersoft Reports to create PDFs (invoices, labels, shipping documents, etc.) and we use a db function that take in parameters like report name and page items values and returns an html tag for link.
E.G.:
myFunction (myReportName, P01_ITEM_A ,P01_ITEM_B)
return
<img scr="/imagespath/pdf.png">
In this way it is possible to render where needed a clickable image to generate a report based on actual values of items. This solution is heavy adopted in our Apex applications but we are facing some difficulties trying to do the same in 19.x.
We need some help or suggestions in order to reproduce the same feature or to do the same in a different way.
As suggested by Littlefoot I can specify that "difficulties" are :
In Apex 4.x the query : select someFieldList ,myFunction (myReportName, P01_ITEM_A ,P01_ITEM_B) PDF from dual results in a report with the column PDF that is a clickable image (or text, the png is not mandatory). In Apex 19.x the same query results in a report with the column PDF rendered as Plain Text.
In Apex 4.x if I use the same query as Source attribute of a Display Only item it is rendered as a clickable link (text or image). In Apex 19.x the Display Only item is always not clickable.

The solution to both issues is the same. APEX 19.2 is a lot more advanced than APEX 4.x, and by default is more secure. For both Plain Text report columns and Display Only page items the default security setting is "Escape special characters":
This deliberately escapes any HTML tags in the contents to avoid potential XSS (cross-site scripting) security risks.
Simply unselect this setting and your links will appear as links again.

Related

Oracle Apex : Showing SQL Count beside Navigation Menu Icon and Text

I want a dynamic number (an output of SQL query) to be shown besides page link text and icon in the navigation menu of my Oracle Apex application (Just the way it has been done in Oracle Apex Opportunity Tracker sample application).
Editing the static text of link is really simple and can be done by going to *Application123\Shared Components\Lists* and editing Application Menu but what I don't know is that how can I display a count there besides the Text and icon.
This is the desired output
This is where I know, I can edit the text (static) and change/select the icon for the link
but where to write SQL query and get its result instead of [&Leads.] , that's is not in my knowledge. Really appreciate help on this !!!!
select count(mycolumnname)
from mytablename
where anotherdatecolumn = trunc(current_date) and (referid='1' or referid='12' or referidD='18');
DEALS should be an application item (declared in Shared Components)
query should be then used in application computations (also in Shared Components)

Oracle Apex 5.1 Multiple Tabular Forms on a single page

I am currently struggling to show multiple tabular forms on one page. Oracle Apex allows only one Tabular Form on a page. I tried to follow the guide from the "Planet of Apex" blog but unfortunately it didn't work.
I didn't manage to implent the iFrame Regions to set the values of the foreign keys.
<iframe src="f?p=&APP_ID.:23:&SESSION."style="width:600px;height:600px"scrolling="no" marginwidth="0" marginheight="0"frameborder="0" vspace="0" hspace="0" />
And how do I bind the variables in the URL, like this &ITEM/COLUMN.?
The guide I followed:
https://planetoftheapex.wordpress.com/2016/12/10/multiple-tabular-forms-on-a-single-page-workaround/
Have you tried Interactive Grid? You can have several Interactive Grids on a single Apex page. Check out sample packaged application Interactive Grid -- User name DEMO and password demo -- and play around with all the features. Very powerful.
When in Application Express, you can edit an existing page, and add a "Interactive Grid" region, specify the SQL query to populate the grid. Then add another "Interactive Grid" region, etc. Or using the Create Page wizard, choose "Report" as a page type, and on the next page, choose Interactive Grid.
I've tried to use Interactive Grid but unfortunately, it didn't work well. Each instance of an IG on your page will slow your page load in about 2 seconds. In my case, I had to have 5 tabular forms (or IG) on the same page and the result was unacceptable 10 seconds.
I even did a quick demo on apex.oracle.com with 5 IG's based on emp/dept tables and the result was the same: each IG slowed the page in about 2 secs.
My guess is that if I had thousands of rows to load, the IG would still take 2 seconds, so if you have tons of rows it'd be fine. But for few rows, it doesn't work well.
Answering the original question: I've created an application item to store the Foreign Key so I don't need to pass it in my URL. That may help you.

Is it possible to wrap columns (that contain a single word) in the Oracle Apex Interactive Default Report PDF Export Option?

I am working in Oracle Apex 5.0.4. I wanted to know if there is an option or if I can create a work-around to wrap text word (Eg. TwoParagraphsButNoWrap ) to fit in it's cell in the Oracle Apex Interactive Report PDF Export.
Currently with the example above, the text gets cut off at 'graphs'. If there were spaces included like Two Paragraphs But No Wrap, then the text would wrap. I cannot increase the column width since there are other columns included on the report.
Any suggestions or ideas would be helpful. I can provide more information if needed. Thanks!
Try creating custom report layout, you will get more control on styling table cells.
Link to Oracle white paper on how to create custom pdf reports --> http://www.oracle.com/technetwork/developer-tools/apex/learnmore/custom-pdf-reports-1953918.pdf

Including an image in a rich text field

I'm using Apex 4.2 and Oracle 11.g.
I have a rich text field that is used to store the body of an apex-generated eMail using SMTP_MAIl. The eMail generation process works fine. But my users want to include an image (jpg, bmp, etc.) into the body of the email, and don't want to include the image as an attachment.
On the Apex page, the rich-text field is defined as a Rich Text Editor / CDK Editor 3 / Toolbar = Full / Toolbar Expanded = Yes / Skin = Office 2003.
The rich-text field writes to a BLOB column.
If I just paste in the image (Shift / Insert) and then go to save the rich text field, I get a 500 - Internal Server Error.
Can you provide some help so that I can include an image in the rich text field? Ultimately, this will be included in the body of an html_email.
Thanks for your help.
The nature of my problem seems to be related to the 32K limit per Apex page item.
A colleague told me to look for a plugin. I found Enkitec's "CLOB LOAD" plugin. https://www.enkitec.com/products/plugins/clob-load
The plugin works well. It's easy to install, and the directions are pretty clear.
I stumbled on a few things to supplement CLOB_LOAD directions.
1) The table item that the Rich Text will write to has to be defined as a CLOB (and not a BLOB).
2) You have to create a Apex Collection using Apex's SQL Workshop. Be sure to include the Begin and End. The directions reference this.
3) If you already setup the form Apex page using the Apex Wizard and the DML page process is there, The "Return Key Into Item" is empty. At least it was with my Apex Page (4.2). That prevented the "Create" button from working. Once I set the "Return Key Into Item" value to the page item that relates to the primary key column of the table, it helped.
4) I also had to copy the page process for the "Save" button suggested by the plugin directions and assign the copied process to the "Create" button. Once I set those two items up, the plugin worked fine for updating as well as creating. It's a good solution.
Using this plugin, I can place a JPG, PNG, GIF, etc. into the Rich Text field, and it will write it to the CLOB, even when the total page item is greater than 32K.

Hyperlink in Oracle Reports (.RDF) Content using Oracle Report Builder

I am not sure if this is the correct forum to ask this question,
I am currently creating an oracle report (.RDF) using Oracle Report Builder and my client wants me to place hyperlinks in the content instead of putting URL in the content.
This report is going to be generated as PDF.
My current sentence looks like
Click here (http://international.usp.ac.fj/?page_id=114) to see USP
member countries.
The URL automatically converts to hyperlink in the above sentence.
What my client wants:
Click here to see USP member countries.
I tried to look for an option where I can use HTML <a> tag.
I would like to know if there is a way to include hyperlinks in Oracle Reports.
Thanks
What you could in order to achieve this is, select property inspector of item you would like to have hyperlink and choose Hyperlink.
Also choose Yes for Contains HTML Tags.
Format for passing dynamic values in URL is
http://www.google.com?pid=&DEPTNO where DEPTNO is the value in report.
Update
This is what I did to achieve your expected output, you could modify based on your requirements
Created sql query for the source
select 'Click here' txt from dual
Select Property Inspector for the field
Added link in Hyperlink property and selected Yes in Contains
HTML Tags
To see the output, generate report as PDF or run report in web
browser.
Hope this helps.

Resources