Skip to Main Content

APEX

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.

APEX Email Custom PDF Report

BaonergesMar 11 2020 — edited Mar 11 2020

Hi Everyone,

We are working on an invoicing application which can take a reports and email it as a PDF. Currently we run a crystal report which generates the invoice, then we save as a PDF and email it.

I have been trying to figure out how to create a custom report format which matches my invoice format and can be emailed as a PDF from my APEX application. Currently I am playing around with APEX Office Print (AOP) to see if this will do what I need. Its somewhat expensive though with the volume.

The following link discusses how to integrate with Crystal but it needs a Crystal Server. I am willing to redevelop my report in any format as long as I can customize the formatting and location of data on the page. I don't want the APEX downloadable report which spits out a table.

How to generate a PDF report from APEX using Crystal Reports

Is there a simpler way for me to use built in APEX functionality to generate a custom PDF and then send it with an email?

Any guidance would be appreciated.

This post has been answered by Scott Wesley on Mar 11 2020
Jump to Answer

Comments

User_64CKJ
From [Primitive Data Types|http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html]
int: The int data type is a *32-bit* signed two's complement integer.
843807
Thanks, Andrew.

But the maximum value of the int data type is 2,147,483,647. The value that I passed in the int array size is only 90,189,840.

new int[size] -- size is 90,189,840

I assumed that one element in the int array is 1 byte. Thus, it tries to allocate about 90,189,840 bytes or ~86MB.

Thanks.
User_64CKJ
rei_xanther wrote:
..But the maximum value of the int data type is 2,147,483,647.
That is the maximum positive integer value that can be stored in (the 4 bytes of) a signed int, but..
..The value that I passed in the int array size is only 90,189,840.
..its only connection with RAM is that each int requires 4 bytes of memory to hold it.
new int[size] -- size is 90,189,840
Sure. So the number of bytes required to hold those 90,189,840 ints is 360,759,360.
I assumed that one element in the int array is 1 byte. ..
Your assumption is wrong. How could it be possible to store 32 bits (4 bytes) in 8 bits (1 byte)? (a)

a) Short of some clever compression algorithm applied to the data.
843807
Thanks Andrew for the information.

I increased the java heap size (-Xmx) to 512M and javaplugin.maxHeapSize to 512M.

Using the same data, I still encounter OutOfMemory error.

Same logs I provided, the difference is the display of the heap space used:
max heap: 508
javaplugin.maxHeapSize: 512M

Thanks.
843807
We are able to resolve the issue by calling System.gc() manually before processing the Print Preview.

But as far as I know, it is not recommended to call System.gc() in the codes.

Thanks.
843807
It seems that there are times JVM does not perform garbage collection, that's why there are some instances wherein the OutOfMemory error are replicated.

Kindly advise. Thanks.
1 - 6

Post Details

Added on Mar 11 2020
4 comments
930 views