How to pass parameters from forms to reports?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: How to pass parameters from forms to reports?

  1. #1
    Join Date
    Jun 2001
    Posts
    109
    Hi all,

    How do you pass parameteres from Forms to report & run the report for the corresponding value entered.
    I have form which has a text box , if the user enters the date in that test box it should bring that data's report.
    How do i do this?

    Please let me know at the earlist.

    THANKS
    Saritha

  2. #2
    Join Date
    Jun 2001
    Location
    India
    Posts
    19

    Hi

    You can pass parameters to your report through run_product statement. Have a parameter variable say pl_id and assign the value u want to pass it to report.

    use statement

    Run_Product(REPORTS,Reportname, SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);


    Originally posted by saritha
    Hi all,

    How do you pass parameteres from Forms to report & run the report for the corresponding value entered.
    I have form which has a text box , if the user enters the date in that test box it should bring that data's report.
    How do i do this?

    Please let me know at the earlist.

    THANKS
    Saritha

  3. #3
    Join Date
    May 2001
    Location
    San Francisco, California
    Posts
    510
    I believe, in run_product, pl_id is the name of the parameter list in varchar2 and not the parameter itself. You can add any number of parameters to the list and here is a example right from the oracle developer:

    There are some restrictions on passing the parameters:

    1.Parameter lists that contain parameters of type DATA_PARAMETER (pointers to record groups) can only be passed to Report Builder SYNCHRONOUS mode.

    2. You cannot pass a DATA_PARAMETER to a child query in Report Builder. Data passing is supported only for master queries.

    /*

    ** Built-in: RUN_PRODUCT
    ** Example: Call a Report Builder report, passing the
    ** data in record group 'EMP_RECS' to substitute
    ** for the report's query named 'EMP_QUERY'.
    ** Presumes the Emp_Recs record group already
    ** exists and has the same column/data type
    ** structure as the report's Emp_Query query.
    */
    PROCEDURE Run_Emp_Report IS
    pl_id ParamList;
    BEGIN
    pl_id := Create_Parameter_List('tmpdata');
    /*
    ** Add a data parameter to this parameter list that will
    ** establish the relationship between the named query
    ** 'EMP_QUERY' in the report, and the record group named
    ** 'EMP_RECS' in the form.
    */
    Add_Parameter(pl_id,'EMP_QUERY',DATA_PARAMETER,'EMP_RECS');
    /*
    **Pass a Parameter into PARAMFORM so that a parameter dialog will not appear
    **for the parameters being passing in.
    */

    Add_Parameter(pl_id, 'PARAMFORM', TEXT_PARAMETER, 'NO');
    /*
    ** Run the report synchronously, passing the parameter list
    */
    Run_Product(REPORTS, 'empreport', SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
    END;

    [Edited by kris109 on 08-15-2001 at 03:50 PM]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width