Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

JRE

843798Aug 1 2001 — edited Aug 1 2001
Hi,

I'm new into java development, and I would like to check the following: Now, if i develop a small application, that makes some simple stuff (it's size is around 100k bytes) and i want to distribute it to some users as a stand alone application, I know that the users machine should be having an installed JRE inorder to run my Java application.

Unfotunately, when i checked the size of the 1.3 JRE it is 5 M Byte in size! so is a must to force teh users to download a 5 MB JRE to run my 100K code ???

Is there a way to reduce teh amount of JRE?!

Please help.

Thanks
tamer

Comments

InoL

Without displaying the HTML content on the report.
If it is a hidden column, the output is not available for your JavaScript function.

Depending on your database version, you can run the same JavaScript in the database:
https://blogs.oracle.com/java/post/multilingual-engine-executing-javascript-in-oracle%C2%A0database
Maybe you can use html2pdf directly in the database to convert the output of your FUNCTION_RETURNING_HTML.

Another option is open source pdf packages, e.g.:
GitHub - lee-lindley/PdfGen: A PL/SQL PDF report generator providing some of the column, column break and header capabilities of sqlplus reports. Built on as_pdf3 from Anton Scheffer (included). (0 Bytes)Instead of FUNCTION_RETURNING_HTML, create a function FUNCTION_RETURNING_PDF.

Adnan3114

@inol Thanks for the suggestions.
Our live software is running on 11g database and APEX 5.1, but we are migrating it to 19.0c database with APEX 22.1. So we can't actually run the Javascript code from database.
We already have set up the reports as function that returns HTML so it would be really time consuming (which we can't afford at this moment) to convert those to be able to use PL/SQL PDF gen feature.
I am trying to download the hidden div but I am unable to make it work. I even tried to push the div out of displayable regions using CSS but that too was no use.

Adnan3114
Answer

I have managed to find a solution.
Turns out changing Region header type to hidden and setting the WHOLE REPORT on the region header seems to work and downloads the report in PDF.
Here are the steps:
In the APEX page I have created a region (name: reg_1) which has these attributes: Header - Hidden, Style - Remove UI Decoration, Remove Body Padding. This region will only serve for us to download the PDF and nothing else.
Now in the reg_1 region's header, I have added this HTML: <div id="content"></div>
Created a page item :PX_PK_ID.
Then, created a Dynamic action change event for :PX_PK_ID that has 2 true actions. This dynamic action's scope should be set to Dynamic.
Action 1- SQL Statement Set Value: select FNC_RETURN_HTML(:PX_PK_ID) from dual; and for jQuery Selector #content (ID of the header HTML in step-2).
Action 2- Execute Javascript Function that is down_pdf() which will download the elements in #content div using html2pdf.js library after Action 1 is complete.
Finally, create the classic report region: SELECT PRIMARY_KEY, col1, col2, "DOWNLOAD" as DOWNLOAD from TABLE and for the DOWNLOAD column, change its type to link and set the link to URL like this: javascript:$s("PX_PK_ID",#PRIMARY_KEY#);
Voila! It works like a charm!

Marked as Answer by Adnan3114 · Aug 3 2022
1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 29 2001
Added on Aug 1 2001
2 comments
62 views