Including an image in a rich text field - image

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.

Related

Oracle Apex Regional Header

Good afternoon,
I am trying to build a page using Oracle APEX 19.2. I have the application built and working fine, but now I am trying to make some changes for ease of navigation and titles.
I am trying to create a region header that would reflect the current data shown on page 4 of my table.
On the page editor, in the Region panes, I go down to the Header and Footer area and am able to create the header text using html and css, but is there a way to create the title based on a column from page 4?
I have a column on page 4 that is titled PN. Is there a way that I can take the text from Page 4_PN and make that the header for the region?
Thank you,
Kevin
is there a way to create the title based on a column from page 4?
Yes. Navigate to "Title" region's property and put (literally) &PN. in there - it'll take value from item named PN and use it as that region's title.

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 19.x external URL based on items value

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.

Oracle APEX display blob images directly in a report

I would like to know how one can display image type BLOBs uploaded as per this stack overflow question Use of BLOB type column in Oracle APEX, as images in a classic or interactive report instead of the normal download links.
I noticed that you can change the blob column attribute's Content Disposition field to inline, which then allows you to click through to another page where the image is displayed; but I want the image to display directly in the report without having to click on it.
The inline image displayed in a new page has the following url
https://apex.oracle.com/pls/apex/apex_util.get_blob?s=34564408462&a=4794&c=16789110088070077&p=2&k1=21&k2=&ck=D4QFl4Z9txsufDbmUOmKeirK4&rt=CR
which suggests that one might be able to use apex_util.get_blob. Does anyone know how this can be accomplished?
I have implemented same in classic report.
I followed this link http://docs.oracle.com/cd/E14373_01/apirefs.32/e13369/apex_util.htm#AEAPI129
This may help you to resolve your doubts

Dynamic Text Control begins on new page when total data for the control exceeds an entire page

BIRT 3.71v20110905
One of my data fields is a CLOB with html tags. I'm using the Dynamic Text Control in my report. This specifically happens when:
The Dynamic Text Control content type is to HTML or Automatic
in my case since I have html tags in the data. (Problem does not occur if I set the content type to Plain, but then the HTML tags show up in the report output as text.)
and
The total amount of data to be displayed by the control is more than one full page on its own
(without taking into account spacing used by other controls). If the
total amount of data to be displayed by the control is less than one
full page but can't all fit on the current page, it works as expected (meaning it displays what it
can on the current page and wraps the rest correctly onto the next
page.)
Is this a bug in the calculation for the DTC pagination?
Additional notes - I encountered this while trying to use a sample report that inserts a page break as needed between groups for duplex printing. It works great under most circumstances, but not when this DTC pagination issue rears up. ( GroupAlwaysStartsOnOddPage.rptdesign )
Sorry to disappoint, but this is a known issue and has not yet been resolved. At least not in the version of BIRT that Maximo is using.
What I tend to do is break the dynamic text where possible, experiment until I get the largest possible part on one page and put the rest into another dynamic text field.
This is obviously only a work around, but as far as I know there is not much else that you can do.
We ran into this problem with a dynamic text field containing HTML content coming from IBM Maximo long description fields. The report was designed in BIRT 3.7.1 Designer.
We were able to work around the duplication bug by changing the layout from Fixed to Auto. With Auto layout, it is also not necessary to change the Display setting of the field to "inline" (which we previously had to do to allow it to flow between pages without creating an initial page break).
In our case, changing the layout to Auto did not have negative effects on the appearance or geometry of our report.

Resources