Re: Passing Parameters to Reports 3 from Forms 5

From: Jerry Alan Braga <jabraga_at_golden.net>
Date: Wed, 21 Apr 1999 08:50:38 -0400
Message-ID: <7fkh6d$lrh$1_at_cougar.golden.net>


This is a code snippet from a form I wrote that called a report. The block :REPORT is used as the source of the user input. You can use any type of input item use wish, just reference the value of the item when passing the data. The :COMPANY_CONTROL block is another block that we use as base for all of our forms due to our database layout (A Company has many Divisions that has many Customer etc)

In the report itself just create USER parameters that have the exact same name as those defined in the add_parameter(...) statement. When creating the parameter try and match the datatype as best you can to that of which is on the form.


PROCEDURE do_report IS

  v_report_name varchar2(80) := 'po_status';

  v_list_name varchar2(80) := 'report_parameters';   v_list_id paramlist := get_parameter_list(v_list_name);

  v_mode number;
  v_execute number;

BEGIN   if not id_null(v_list_id) then
    destroy_parameter_list(v_list_id);
  end if;
  v_list_id := create_parameter_list(v_list_name);

/* User Parameters */

add_parameter(v_list_id,'P_COMPANY_NO',text_parameter,:company_control.compa ny_no);

add_parameter(v_list_id,'P_COMPANY_NAME',text_parameter,:company_control.com pany_name);

add_parameter(v_list_id,'P_DIVISION_NO',text_parameter,:report.division_no);   add_parameter(v_list_id,'P_BUYER_NO',text_parameter,:report.buyer_no);

add_parameter(v_list_id,'P_PO_STATUS_CD',text_parameter,:report.po_status_cd );
/* End User Parameters */

/* Report System Parameters */

  add_parameter(v_list_id,'READONLY',text_parameter,'YES');
  add_parameter(v_list_id,'PARAMFORM',text_parameter,'NO');
  add_parameter(v_list_id,'ORIENTATION',text_parameter,'LANDSCAPE');

  if :report.preview_flg = 'Y' then
    v_mode := RUNTIME;
    v_execute := SYNCHRONOUS;
    add_parameter(v_list_id,'DESTYPE',text_parameter,'PREVIEW');   else
    v_mode := BATCH;
    v_execute := ASYNCHRONOUS;
    add_parameter(v_list_id,'DESTYPE',text_parameter,'PRINTER');   end if;
/* End System Parameters */

  run_product(REPORTS, v_report_name, v_execute, v_mode, FILESYSTEM, v_list_id, NULL);

END;


Ken Halsted wrote in message <924622006.491.11_at_news.remarQ.com>...
>How can I pass the value of a List Box in my Form to my Report as a Lexical
>Reference?
>
>For example: In my form, I have a list box which the user has selected a
>value from. I now want to call a report and pass the value of the list box
>as a lexical reference in the Main query of my report.
>
>How do I use Run_product to pass the list box value?
>
>Ken.
>
>--
>_________________
>Kenneth W. Halsted
>Mountaire Corporation
>ph: (501) 399-8812
>url: http://www.mountaire.com
>email: kenman_at_mail.snider.net
>
>
>
Received on Wed Apr 21 1999 - 14:50:38 CEST

Original text of this message