Translate

Donnerstag, 9. September 2021

Interactive Report - resize image the smart way...

 I just came across a smart tipp how to resize (not compress) an image of a BLOB in an IR.

In the page properties under CSS- inline 

just put

img {

width: 100px;

height: 100px;

}

and adjust the pixel size and you are done:





thanks to Rex Araya https://apex.rexaraya.com/resize-image-in-apex-interactive-report/

and "Learning a'peks"

Dienstag, 17. August 2021

APEX - Render PDF in Region

 sorry for crossposting - but this one is worth mentioning:

Thanks to Vinish Kapoor and his detailed post on rendering a pdf or image in a static region.

This is a working example for APEX 21.1 (not tested on other versions)

The steps in short:

1. have a table (my_table) with a blob column and mimetype column - and id ofcourse...

2. create an application process (in shared components) of type AJAX callback

DECLARE
  vBlob blob;
  vmimetype varchar2(50);
BEGIN
  SELECT BLOB_column, mimetype_column INTO vBlob, vmimetype
                FROM my_table
                WHERE ID = V('P3_ID');
                 
  owa_util.mime_header(vmimetype,false);
  htp.p('Content-Length: ' || dbms_lob.getlength(vBlob)); 
  owa_util.http_header_close;  
  wpg_docload.download_file(vBlob);
  exception 
  when no_data_found then
   null;
END;

3. create a page with a region type static content and insert this:

<p align="center">
<iframe src="f?p=&APP_ID.:0:&SESSION.:APPLICATION_PROCESS=display_blob:NO:P3_ID,&P3_ID." width="99%" height="1000">
</iframe>
</p>
Note: contrary to Vinishs example 
I had to delete one " : " between NO and :P3_ID... (as shown above)
4. for my purpose I created a 2nd region of type IR or 
classic report and put a link on one of the columns to 
point to the same page 3 ... and defined a hidden item 
named P3_ID.
So as you can see from the above the APEX-URL calls 
the APPLICATION_PROCESS "display_blob" and passes 
the ID from the page to the process... which in turn 
renders the pdf within the iFrame.
I put the report on the left side of the page and 
the 2nd region aside of it.
Have fun and thanks to Vinish again! Great job !

Mittwoch, 31. März 2021

APEX PLUGIN Tutorial von Ronnie Weiss - sehr empfehlenswert !

Danke an Ronnie Weiss für sein akribisch erstelltes APEX Plugin Tutorial

Mit Anleitungs-Video und Beispiel-Code in jedem Tutorial.

Total cool ! Dauert ca. 2 Stunden zum Mitmachen. 

Mein Ergebnis seht Ihr hier: (Link zur Seite in der Oracle cloud











Ronnie ist übrigens ein eifriger APEX Plugin Entwickler. Seine sehr hilfreichen mittlerweile 29 Plugins sind auf APEX.WORLD unter Plugins zu finden.

Noch besser: es gibt zu seinen Plugins eine Demo-Anwendung, die man auch runterladen und zum Ausprobieren auf seinem eigenen Workspace installieren kann.

APEX-CHARTS - ein interessantes js-feature

Nach einem Plugin-Tutorial von Ronnie Weiss (2 Stunden beim Mitmachen... sehr empfehlenswert!) kam ich zufällig auf die APEXCHARTS - Javascript library apexcharts.js

Auf dieser Seite findet Ihr die ausführlich APEXCHARTS.com Dokumentation.



Donnerstag, 4. März 2021

Jasper Reports Studio 6.16 - tipps

We are presently extensively using Jasper Reports Studio 6.16 and JR Server installed at Maxapex.

Insert SYSDATE in report:

1. define a variable
2. enter in "expression" : new SimpleDateFormat("dd/MM/yy").format(new Date())
3. put the variable as a field on the report

or try to insert from the "Current Date" from the "Composite Elements" (right hand).

a textfiled will be generated [new java.util.Date()] and the standard format (pattern) is: MMMMM dd, yyyy

if you like adjust the date format, you can use --> Textfield --> pattern --> and an editor can be opened and you may choose from various formats

Generic procedure:

in my previous project I always had defined the pl/sql process on respective pages - now, as we will have more reports to produce I have defined a generic procedure in the database reading as follows:

CREATE OR REPLACE PROCEDURE JASPER_GENERIEREN 
(
  Q_PARAMETER IN VARCHAR2,  -- used for ID of a dataset
  REPORT_NAME in VARCHAR2   -- used for the report name
) AS 
  l_additional_parameters varchar2(100);
begin
-- set the url for the j2ee application
-- better retrieve that from a configuration table
--  xlib_jasperreports.set_report_url(:G_REPORT_URL);
   xlib_jasperreports.set_report_url('jasper.maxapex.net:8090/JasperReportsIntegration/report'); 
-- construct addional parameter list
l_additional_parameters :='PARAMETER01='||PARAMETER01;
-- call the report and pass parameters
xlib_jasperreports.show_report ( 
    p_rep_name     => 'XXXXXX/'||REPORT_NAME, -- Replace your Workspace name
    p_rep_format   => 'pdf', 
    p_data_source  => 'XXX_A123456_1234', -- REPLACE !!
    p_out_filename => 'Dokument_'||REPORT_NAME||'.pdf',
   --    p_rep_locale   => 'de_DE',  -- this is optional
   --    p_rep_encoding => 'UTF-8',  -- this is optional
   p_additional_params => l_additional_parameters);
   -- stop rendering of the current APEX page
  apex_application.g_unrecoverable_error := true;
  end JASPER_GENERIEREN ;

Within the APEX page no. 16 I defined a button, which calls the pl/sql process namely:

JASPER_GENERIEREN(:P16_ID,:P16_AMS_DOK_NR);

on the page it looks like:













Assuming one like to save the report in a table straight away.... - the next tipp will contain that procedure...


Donnerstag, 25. Februar 2021

Oracle Autonomous DB (Oracle cloud) - Sending Email from APEX (not for free)

Viele experimentieren schon mit APEX innerhalb der Oracle Cloud ADB (ALWAYS FREE...) - aber so ganz FREE ist es dann doch nicht.

Chaitanya Koratamaddi, Oracle product Manager, beschreibt in seinem Post vom 2. Februar 2020, wie APEX_MAIL aufgesetzt wird... hier der Link zum Post.

Genutzt wird dazu das neue APEX Feature "Automation" (unter shared compoments).

Aber: zu Anfang heißt es auch in der 

Note:

  • The instructions in this blog post use the free promotion account that is within the trial period. When your trial is over, your account will be limited to Always Free resources. You need to upgrade to a paid account to continue to use the Email Delivery. 
Schade eigentlich....

Ein "Workaround" scheint zu sein - wenn man APEX_MAIL nutzen möchte, sich für wenige Cents einige Cloud Services dazuzukaufen....

Allerdings blicke ich bei der Oracle Preispolitik für die Cloud und ADB nicht durch... welcher Service das sein könnte...

Ich recherchiere mal....wenn ich mehr weiß, werde ich es hier schreiben...

Freitag, 5. Februar 2021

APEX 20.2: DBMS_SCHEDULER becomes "APEX Automation"

sorry for crossposting ! - but I found this extremely interesting and helpful:

Oracle PM Salim Hlayel writes about the new "Automation"-feature  - based on the DBMS_SCHEDULER:

https://blogs.oracle.com/apex/automate-your-business-process-in-oracle-apex-202













check it out !!!

Good luck ! 

Jasper Reports Studio - Print when expression used for subreport

Environment: JR Studio 6.1.1 - APEX 20.2

Challenge:
I have one main report with 3 subreports and I like to print certain subreports depending on certain conditions.

My Main Report looks like:














In the detail bands 1,2,3 you see my SubReports A,B,C

within my sql query for the mainreport I put a case condition like:

case
   when HV_ABRECHNUNG.TAGE_ANTEILIG > 0 then 'Ja' else 'Nein'
end PRINT_Anteilig,  .....

For development and control purposes I put the result into a field marked (1). Later I delete this.

Then I used the "PRINT WHEN EXPRESSION in Jasper Reports Studio for the detail bands B and C (not to the subreport !!!).

You'll find these under Properties --> Appearance ... (click on the edit pencil):


































Expression:

new Boolean($F{PRINT_ANTEILIG}.equals("Ja"))

So this I applied to detail band 3 or C

and for detail band 2 or B I put in the expression editor:

new Boolean($F{PRINT_ANTEILIG}.equals("Nein"))


Good luck !!