The following procedure shows how to print report from oracle form.
Web.Show_Document() Built-in to call Oracle Reports on the Web is an alternative to the Run_Report_Object() Built-in.
Web.Show_Document(URL, Target);
1. url – The URL is passed as a string in a variable, or as a combination of both. If the target Web page is located on the same server that runs Forms Services,relative addressing could be used.
2.target – Definition of the target where the addressed Web page should be displayed. Values must be single-quoted. Possible target values are ‘_blank’ to show the Reports output in an extra browser window, ‘_self’ to replace the Forms
application with the Reports output, ‘<frame name>’ to load the Reports output into a named frame of the multi frame HTML page.
A complete syntax example to run Reports from a browser looks like this:-
http://<server>:<port>/reports/rwservlet? keyname&report=<report>.rdf&desformat=[htmlcss|pdf|xml|delimited|]&destype=cache¶mform=[no|yes]
Report – the name of the Reports module to execute
desformat – the output format of the returned Reports result set. Desformat can be
htmlcss, html, pdf, xml, rtf and delimited. For Reports run from Forms pdf and
htmlcss are the most commonly used options
destype – determines where the Reports output gets written to. “Cache” specifies
that the Reports output gets streamed to the requesting browser. ‘
paramform – determines if Reports should display a HTML parameter form before
executing the request. The parameter form can be used for the user to further filter
the expected Reports result set. Valid values are ‘yes’ and ‘no’.
To reduce the length of the Reports request URL, you can create a key entry in the
Reports cgicmd.dat configuration file to store command line parameters that don’t
change from one Report to the other. In this case the first argument in a Reports
Web request, right after the question mark, must be the key name2.
Keyname refers to a command line listed under a unique header (the key name) in the cgicmd.dat file. Note that this works differently for JSP files, which use the keyword/value pair cmdkey=value to specify key names for command lines that are stored in the cgicmd.dat file.
DECLARE
REP_NAME varchar2 (2000);
rep_url varchar2 (4000);
BEGIN
REP_NAME:='d:\ PROJECTS\ code\'||'MYFIRSTREPORT.rdf';
rep_url:='http://localhost:8890'||'/reports/rwservlet?employee&module='||REP_NAME
||'&p_emp_code='||:BLOCK_NAME.EMP_CODE;
WEB.SHOW_DOCUMENT(rep_url,'_blank');
END;