Link to home
Start Free TrialLog in
Avatar of anshunay
anshunay

asked on

Printing from 9ias

Hi

We are having 9ias rel2 running on a Sun box. We are trying to enable printing from the client workstations. For this we have installed the ORARRP utility on the client workstations as well. At the same time the mime types have been added in the httpd.conf file as well. While printing from within the application, the print dialog is coming.But when we say print it just doesnt seem to do anything. The printer is connected to the local network and the print dialog is recognising that defalut printer (on the client workstation)

Is there any other thing we need to do on this. As per the Oracle Whitepaper, once the print dialog comes we just have to print.
Avatar of Helena Marková
Helena Marková
Flag of Slovakia image

Maybe this note:277431.1 from MetaLink will help you:

The information in this article applies to:
Oracle Reports Developer - Version: 9.0.2
Oracle Forms - Version: 9.0.2
Information in this document applies to any platform.
RUN_REPORT_OBJECT
ORARRP 1.3.4 (Oracle Reports Remote Printing Utility)

Goal
How to Implement ORARRP with Forms & Reports 9i /10g for Local Printing on Client?

ORARRP (Oracle Reports Remote Printing Utility) can be downloaded from the OTN website

Reference:
http://otn.oracle.com/sample_code/products/reports/index.html

The PDF document contained within the orarrp_1_3_4.zip file has instructions which appear specific to implementation of ORARRP in an Oracle 9iAS Rel 1 environment. This article aims to provide revised instructions for the implementation of ORARRP in a Oracle 9iAS Rel 2 or Oracle Application Server 10g environment

Fix
Follow the advice below in conjunction with the step by step instructions given in the ORARRP pdf document - orarrp1.3.4.pdf entitled 'Oracle Reports Remote Printing Utility - 1.3.4'

1. Add the required ORARRP mimetypes to the Oracle HTTP Server configuration.
(Note: This will be the Oracle HTTP Server belonging to the Oracle 9iAS Rel 2 / Oracle Application Server 10g middle (BI & Forms) tier)

Do this manually by editing the httpd.conf
or
via the Oracle 9iAS Rel 2 EM console / Oracle Application Server 10g AS Console e.g.
Navigate to the Middle Tier Components Page
Click on HTTP_Server -> Administration -> MIME Types

2. Create an aliasmatch in forms90.conf pointing to a physical directory - for this example, directory will be an example test area.
Do this by manually editing the forms90.conf
or
via the Oracle 9iAS Rel 2 EM console / Oracle Application Server 10g AS Console e.g.
Navigate to the Middle Tier Components Page
Click on HTTP_Server -> Administration -> Advanced Server Properties -> forms90.conf

Add a line like :

AliasMatch ^/forms90/test_area/(..*) "D:\test_area/$1"

** IMPORTANT NOTE **

The advantages of making the changes via EM / AS console, rather than editing the files manually, are:

- the EM / AS console will put the mimetype entries in the correct place
- the EM / AS console automatically issues a 'dcmctl updateconfig' which synchronises the file changes with the Infrastructure Metadata Repository
- the EM / AS console will do the required restart of the HTTP Server component

(Only the HTTP Server needs to be stopped and restarted - other 9iAS Rel 2 / OracleAS 10g components can remain up and running)

If the changes are made manually then the following commands must be issued after the changes to httpd.conf and forms90.conf have been made.

$ORACLE_HOME/dcm/bin/dcmctl updateconfig -ct ohs -v -d

(to synchronise the changes with the Metadata Repository)

$ORACLE_HOME/dcm/bin/dcmctl stop -ct ohs -v -d
$ORACLE_HOME/dcm/bin/dcmctl start -ct ohs -v -d

(to stop and restart the HTTP Server)

3. Install ORARRP.exe on the client machine as per instructions in the ORARRP pdf document

4. Check that ORARRP is basically working
- create orarrp_test.html containing the HTML

<html>
<body>
ORARRP Test! Click here to Print:
<a href="orarrp_test.rrpa">Acrobat Doc</a>
</body>
</html>

- Make a copy of the ORARRP pdf document and name it orarrp_test.rrpa

- Call it directly using a URL like:

http://[machinename.domain:portno]/forms90/test_area/orarrp_test.html

Click on the link - the Acrobat Reader should fire up with a print dialogue

5. Next create a test form containing the RUN_REPORT_OBJECT code (based on the advice in the ORARRP documentation

WHEN-BUTTON-PRESSED trigger
~~~~~~~~~~~~~~~~~~~~~
DECLARE
report_id REPORT_OBJECT;
hTimer TIMER;
vcFile VARCHAR2(255);
vcResult VARCHAR2(30);
BEGIN
/* Generate a pseudo unique filename */

vcFile := GET_APPLICATION_PROPERTY(USERNAME)||TO_CHAR(SYSDATE,'YYYYMMDDHHMISS');

/* In this example - output will be PDF so adding .rrpa extension */

vcFile := vcFile||'.rrpa';

report_id := find_report_object('TEST_ORARRP_REP');

SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,FILE);

/* For DESNAME the physical directory on the middle tier has to be specified */

SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESNAME,'d:\test_area\'||vcFile);

/* In this example - PDF format is chosen */

SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,'PDF');

/* Specify the name of the Report Server to be used */

SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER,'rep_servername');

/* Save the report handle and vcFile to Globals as they are to be referenced in the WHEN-TIMER-EXPIRED trigger */

:GLOBAL.ReportHandle := RUN_REPORT_OBJECT(report_id);
:GLOBAL.PrintOutPut := vcFile;

/* A timer will be used to check whether the Report execution is finished. In this example, the timer will fire 4 times every minute */

hTimer := CREATE_TIMER ('PRINTER_QUEUE', '15000', REPEAT);

END;
~~~~~~~~~~~~~~~~~

WHEN_TIMER_EXPIRED trigger contains the code
~~~~~~~~~~~~~~~~~

DECLARE

vcStatus VARCHAR2(50);
vcTimerName VARCHAR2(30);
hTimer TIMER;
BEGIN
vcTimerName := GET_APPLICATION_PROPERTY(timer_name);

/* Check whether the report has executed */

IF vcTimerName = 'PRINTER_QUEUE' THEN
vcStatus := REPORT_OBJECT_STATUS(:Global.ReportHandle);
IF vcStatus in ('RUNNING', 'OPENING_REPORT', 'ENQUEUED')
THEN
null;
ELSIF vcStatus = 'FINISHED'
THEN

/* The report has been executed and output sent to file under the test area directory, now access it using WEB.SHOW_DOCUMENT */

WEB.SHOW_DOCUMENT('/forms90/test_area/'||:GLOBAL.PrintOutPut,'_blank');

/* Clean up the timer */

delete_timer(vcTimerName);
ELSE

/* The Report has failed to run for some reason, throw out a basic failure message */

message('The Report has failed');
delete_timer(vcTimerName);
END IF;
END IF;
END;

6. Run the form to test

NOTE: A print dialogue will always display to the end user when using ORARRP. This is unavoidable. The end user will have to process the print dialogue.
Avatar of tidodo
tidodo

I am currently printing from iAS reports on a unix box to printers attached to my windows clients via the Windows Print Services for unix.

You may enable remote printing on your Sun Box.
If your clients' workstations are Win2000/XP, enable LPR printing port on the workstations by installing Print services for Unix
1. Control Panel -> Add/Remove Programs -> Add/Remove Windows Components
2. Tick on the "Other Network File and Print Services" (
3. Then you create your printer in the printers settings. If you want to do just plain ascii printing, you can choose the generic/text driver.
Otherwise, you would need a printer which can handle postcripts. Most laser printers work fine for me.

On your sun box, you then create remote printers by specifying the host where you have configured the Unix Printer services.



Avatar of anshunay

ASKER

Henka

I had done exactly the same what you had mentioned. Infact had tried that before posting this query here. The problem still is the same. The point is when I change the format to PDF, it is able to print but only when I change to Text it is not able to do so. The corresponding mime types have been added in the httpd.conf file.

I don't know what to do. Maybe the workaround are reports with different outputs (text and PDF).
ASKER CERTIFIED SOLUTION
Avatar of PAQ_Man
PAQ_Man
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial