Friday 1 April 2011

Oracle reports: how to disable print button

In oracle reports runtime previewer we have menu options and buttons for print and also for sending email. Sometimes there are situations when we dont like to give this option of print to the user and want to use some other method of printing as per requirement.

When we call reports runtime software to view any report module by run_product builtin giving report name as input parameter, we also pass parameter list as an input parameter to this builtin. With the help of these parameters we tell the reports runtime software about how the previewer should behave.

From oracle forms we call reports as:

Run_Product(REPORTS, 'repot_name', ASYNCHRONOUS, RUNTIME, FILESYSTEM, PL_ID, NULL);

by default print option is enabled in Previewer and your screen's top-left corner will look like:







If we want to disable print option in runtime previewer of oralce reports runtime software, we will assign the value "YES" to the parameter of 'DISABLEPRINT' and add this to parameter list as PL_ID in above command. we will re-write the above command as:

declare
  pl_id ParameterList;
begin
  pl_id := Get_Parameter_List('tmpdata');
  if not id_null(pl_id) then
    Destroy_Parameter_List(pl_id);
  end if;
  Add_Parameter(pl_id, 'DISABLEPRINT', TEXT_PARAMETER, 'YES');
  Run_Product(REPORTS, 'repot_name', ASYNCHRONOUS, RUNTIME, FILESYSTEM, PL_ID, NULL);
end;

After using the above command top-left corner of you Previwer should look like:

 In this print button is disabled along with page setup button.

5 comments:

  1. Dear Rana Salam

    Interesting piece. I am recruiting someone with the knowledge of Oracle Forms and SQL for financial middleware development. If interested please email at: sohail.farooq@gmail.com

    ReplyDelete
    Replies
    1. Dear Sohail sb.

      Thanks for your comments. Sorry for v.v.late reply, in fact now i got to know about comments on my blog.

      Aslam

      Delete
  2. Dear Rana Aslam sb!
    Salam!

    would you please guide me how to develop reports in oracle.
    Please suggest some software for this purpose.

    Regard

    ReplyDelete
  3. Oracle Developer 6i is product of oracle which enable us to develop Oracle forms and reports on fast track.
    Developer 10g,11g are also available used for web based applications.

    ReplyDelete
  4. Dear Aslam!

    Thanks for sharing knowledge of oracle development. I have a problem in Oracle 10g forms. Detail of problem is mentioned below: -

    "I am facing an issue with Oracle forms 10g. It works fine when I start my application built in Forms 10g. When I open a specific form in my application (by pressing button), it opens up fine. Then I query the form by entering the value in non-database text item in form and pressing the search button. Form query fine and fetch the respective data. After that when I again click my mouse in that non-database text item for query other record, the form is freezing completely. Like no response of mouse click, keyboard clicks anywhere on the form; but navigation is enabled. But when I open Jinitiator (java client console required to run form at client end) trace file, I see error there "java.lang.NullPointerException". Trace shows that error occured while selecting the value in non-database text item with mouse. In order to close the form, i have to close the Internet Explorer.

    Tools I am using are:
    • Oracle Developer suit 10.1.2.0.2
    • Oracle application server 10.1.2.0.2
    • Jinitiator 1.3.1.22
    • Oracle database 10g

    Please help me to overcome this java.lang.NullPointerException error and my form freeze issue.

    "

    Thanks,

    ReplyDelete