Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Direct printing from JRI and Apex #21

miki720 · · author

Hi,

how to print directly to printer?
I have set p_print_enabled to true in parameters and configuration file, but I suppose that problem is in not knowing default printer name on client.
If that is the reason, how to obtain this information in Apex or JRI?

xlib_jasperreports.show_report (
p_rep_name => apex_util.url_encode('somereport'),
p_data_source => apex_util.url_encode('default'),
p_print_is_enabled => true,
p_print_printer_name => ''
p_print_duplex => true
);

I am using:
APEX 20.1.0.00.13
JRI 2.6.2-6.15.0
Tomcat 9.0

  • replies 4
  • views 633
  • likes 1
Dietmar Aust daust · · moderators
#2

Hi @miki720 ,

direct printing will send the document to a printer that is CONNECTED TO THE APPLICATION SERVER, not the client browser.

In order to see the names that are known to the application server, go to the Tomcat directly: http://vm1:8080/jri/

Then click on "Printer Diagnostics"

Greenshot 2021-02-24 12.07.59.png

This will open the next page: http://vm1:8080/jri/printerDiagnostics.jsp

Here you can see the names of the printers:

Greenshot 2021-02-24 12.09.20.png

Cheers
~Dietmar.

miki720 · · author
#3

Thank you for explanation Dietmar and thank you for your awesome JRI :)

#4

hello @daust
how to print directly to printer?

the printer is already installed on the server ... no error appears but does not print

Can you help me?

This my code to printg :

XLIB_JASPERREPORTS.SHOW_REPORT(P_REP_NAME => I_NOMBRE_REPORTE,
P_REP_FORMAT => NVL(V_TIPO_FORMATO_REP,
'pdf'),
P_DATA_SOURCE => 'default',
P_OUT_FILENAME => NULL,
P_REP_LOCALE => 'es_ES',
P_REP_ENCODING => 'UTF-8',
P_ADDITIONAL_PARAMS => L_ADDITIONAL_PARAMETERS,
P_PRINT_IS_ENABLED => TRUE,
P_PRINT_PRINTER_NAME => 'Samsung',
P_PRINT_MEDIA => 1,
P_PRINT_COPIES => 1,
P_PRINT_DUPLEX => TRUE,
P_PRINT_COLLATE => TRUE,
P_SAVE_IS_ENABLED => FALSE,
P_SAVE_FILENAME => I_NOMBRE_REPORTE,
P_REP_TIME_ZONE => NULL
);

#5

Hello Dietmar

I have the same problem, the report is probably executed, but after that nothing happens. The service seems to hang. Do you have any ideas how to get this to run?

best thanks and greetings
Charly