Passing parameter to report from form using RUN_REPORT_OBJECT method

Will you please let me know how to do this. I tried using run_product but it is giving error as too many declarations. So I decided to use RUN_REPORT_OBJECT, but no help is provided how to pass paramters to this routine from FORMS to REPORTS.

If you just want to change the heading of a column dynamically, you can go with any of the two options. For both the options, you need to remove the static text and replace it with any dummy field (ensure the reference of field w.r. to repeating frame)
1. Use the Format Trigger and change the heading to either "school" or "college" based on your field value.
Ex.
If :<field_name> = 'S'
then :dummy_field := 'School'
Else
:dummy_field := 'College'
End If;
Return (true)
2. Another option is similar to this and uses a CF.
(I would prefer CF).
Warm Regards,
Raja.

Similar Messages

  • Unable to run reports from forms using run_report_object

    Hi All,
    I am unable to run a report(9i) from forms(9i) in client side.
    I used the following code
    Declare
         repid REPORT_OBJECT;
         v_rep varchar2(100);
         rep_status varchar2(20);
    Begin     
         repid := FIND_REPORT_OBJECT('report4');
         v_rep := RUN_REPORT_OBJECT(repid);
    End;
    I get the following error
    FRM-41219 : Cannot find report:invalid ID.
    Any help will be highly appreciated.
    Thanks,
    Sanjay

    Hi All,
    I am unable to run a report(9i) from forms(9i) in client side.
    I used the following code
    Declare
         repid REPORT_OBJECT;
         v_rep varchar2(100);
         rep_status varchar2(20);
    Begin     
         repid := FIND_REPORT_OBJECT('report4');
         v_rep := RUN_REPORT_OBJECT(repid);
    End;
    I get the following error
    FRM-41219 : Cannot find report:invalid ID.
    Any help will be highly appreciated.
    Thanks,
    Sanjay Hi
    You have to create a report object within the form.
    If you look at the Object NAvigator in the Form Builder right below Record Group
    tou would see an option for Report. Create a new report object.
    Set the following properties for that object
    Filename - This should be the name of your RDF file you created from Report Builder along with the full path.
    Set the Execution Mode, Communication Mode and Report Destination Type as per your requirements.
    In the parameter for find_report_object() pass the name of the report object you created.
    eg.
    if the name of the report object you created is Report2 then
    your call should be rep_id := find_report_object('Report2') .
    You are calling the report object which has been created in your form builder and through that call you are running the report file specified in the Filename property of that report object.
    Regards
    Poorvi

  • PASSING PARAMETER TO REPORTS FROM FORMS...

    I have one form called empform, by clicking a button i want to run report.
    I have created a record_group by name emprec,
    i am using same query for my report also with dame parameter.
    My when button pressed trigger has following,
    DECLARE
    pl_id ParamList;
    BEGIN
    pl_id := Get_Parameter_List('tmpdata');
    IF NOT Id_Null(pl_id) THEN
    Destroy_Parameter_List( pl_id );
    END IF;
    pl_id := Create_Parameter_List('tmpdata');
    Add_Parameter(pl_id,'EMPQRY',DATA_PARAMETER,'EMPREC');
    *** empqry=query name on which report and record group is based***
    Run_Product(REPORTS, 'g:\cl2\vatdata\emprep', SYNCHRONOUS, RUNTIME,FILESYSTEM, pl_id, NULL);
    END;
    but when i am clicking button to run report.
    it is asking parameter again before displaying report.
    Please let me know where i am doing mistake...
    Thanks in advance..

    Hi!
    To suppress Oracle Reports native Parameter Form just add:
    add_parameter( pl_id, 'pARAMform', text_parameter, 'NO' );
    Andrew Velichko
    Brainbench MVP for Oracle Developer 2000 http://www.brainbench.com
    null

  • How do I launch report from menu using RUN_REPORT_OBJECT?

    Hi all,
    Re: How do I launch report from menu (and have it print to the screen) using RUN_REPORT_OBJECT?
    I am using Oracle 9iAS on Windows 2000 and I have a similar problem with launching reports from the menu. The application should call the report via the RUN_REPORT_OBJECT builtin feature from Forms. The report is never displayed.
    The report is in the same folder as the menu form calling it. Do the reports have to be in a specific format? How do I get the report_id?
    The name of the report is seconds_calls. No user-specified parameters are passed. Also, the report object in the object navigator in Forms is Report4 (is this relevant?)
    When I try to run report via the form using this code:
    DECLARE
         report_id REPORT_OBJECT;
         rep_status VARCHAR2(200);
         v_rep VARCHAR2(100);          
         report_job_id VARCHAR2(200);
    --     job_number NUMBER;
    --     server_name VARCHAR2(200) := 'repserver';
    BEGIN
         report_id:= FIND_REPORT_OBJECT('seconds_calls');
         rep_status:=REPORT_OBJECT_STATUS(report_job_id);
         v_rep := RUN_REPORT_OBJECT(report_id);
    END;
    I get this error message:
    FRM-41219 Cannot find report:Invalid ID
    And this message
    FRM-40738 Argument 1 to builtin RUN_REPORT_OBJECT cannot be null
    When I tried to use the same code (above), substituting the object name for the form name,
    I got these messages:
    FRM-41219 Cannot find report:Invalid ID
    FRM-40738 Argument 1 to builtin RUN_REPORT_OBJECT cannot be null
    And FRM-10259 Invalid null argument to packaged procedure or function (???)
    Any ideas?
    Cheers,
    Pippa

    Philippy,
    substr(v_rep,instr(v_rep,'_',-1)+1)
    This code extracts the Reports job id from the Reports Server name. The run_report_object() built-in
    retrieves e.g. RepServ_9 as a job id, but in Reports9i you only need the '9' as a value to retrieve the
    output.
    Use the following sample a template. It is a procedure that expects the reports object name, teh reports server name and the
    output format as an argument. The call to Web.show_document expects the ReportsSrevices to be accessible from teh same server
    (relative addressing is used)
    PROCEDURE RUN_REPORT_OBJECT_PROC (vc_reportobj Varchar2, vc_reportserver varchar2, vc_runformat varchar2) IS
    v_report_id           Report_Object;
    vc_ReportServerJob      VARCHAR2(100); /* unique id for each Report request */
    vc_rep_status      VARCHAR2(100); /* status of the Report job */
    vjob_id               VARCHAR2(100); /* job_id as number only string*
    BEGIN
    /* Get a handle to the Report Object itself. */
    v_report_id:= FIND_REPORT_OBJECT(vc_reportobj);
    SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESTYPE,CACHE);
    /* Define the Report output format and the name of the Reports Server as well as a user-defined parameter, passing the department number from Forms to the Report. We don't need a parameter form to be displayed, and therefore paramform is set to "no". */
    SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESFORMAT, vc_runformat);
    SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_SERVER, vc_reportserver);
    SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_OTHER,      'p_deptno='||:dept.deptno||'paramform=no');
    vc_ReportServerJob:=RUN_REPORT_OBJECT(report_id);
    /* remove the Reports Server name from teh job id */
    vjob_id := substr(vc_ReportServerJob,length(reportserver)+2,length(vc_ReportServerJob));
    /* Check the report status if finished. */
    vc_rep_status := REPORT_OBJECT_STATUS(vc_ReportServerJob);
    IF vc_rep_status='FINISHED' THEN
    /* Call the Report output to be displayed in a separate browser window.
    The URL for relative addressing is only valid when the Reports Server
    is on the same host as the Forms Server. For accessing a Remote Reports
    Server on a different machine, you must use the prefix http://hostname:port/ */
    WEB.SHOW_DOCUMENT ('/reports/rwservlet/getjobid '||vjob_id ||'?server='vc_reportserver,'_blank');
    ELSE
    message ('Report failed with error message '||vc_rep_status);
    END IF;
    END;
    Frank

  • Passing parameters to reports from forms.

    Hi
    we are using developer suite 10g and developed some applications.Our reports are working from report buider and also from the forms when we are not passing any parameter.
    But when we add the clause to pass the parameter from forms fields it does not show any values and we get a blank report.
    when we use this code it works with default value set in the report
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no');
    But when we use code to pass the parameter like this it does not work
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'EMPLOYEE_TICKET_NO='||lpad(ltrim(:hris_employee.em_ticket_no),5,' ')||'paramform=no');
    Please suggest how to pass parameter values from forms.
    Thanks in advance

    Hi Ansu
    In your code set paramform ='Yes' .Then run report ,it will show you the values that are passing through parameters.SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=yes');
    If it doesnt work for you.
    Try this code
    declare
         pi_id paramlist;
    begin
         pi_id := get_parameter_list('item_param');
    if not Id_null(pi_id) then
         destroy_parameter_list(pi_id);
         end if;
    pi_id := create_parameter_list('item_param');
    add_parameter(pi_id,'PARAMFORM',TEXT_PARAMETER,'no');
    /**********Add here your parameters***************/
    add_parameter(pi_id,*'report parameter name'*,TEXT_PARAMETER,*value from form*);
    RUN_PRODUCT(REPORTS,'c:\MAKESS\INVENT\REPORTS\add_mat_req.RDF',SYNCHRONOUS,RUNTIME,FILESYSTEM,
    pi_id,NULL);
    --Ajay Sharma                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to run report from form using run_object_report

    I AM USNING FORMS9I/REPORTS 9I , HOW TO RUN REPORT FROM FROM USING RUN_REPORT_OBJECT AND HOW
    TO PASS PARAMETER AS WE DID IN RUN_REPORTS PLEASE HELP ME

    here an example !
    I hope this example you can use it
    PROCEDURE pr_reporte IS
    BEGIN
    DECLARE
         repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status Varchar2(20);
    d1 DATE;
    d2 DATE;
    BEGIN
         d1 := :GLOBAL.DIA_INI;
         d2 := :GLOBAL.DIA_FIN;
         repid := find_report_object('rep_lab02');
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'p_fec_uno='||to_char((add_months(last_day(d1),-1) +1),'DD/MM/YYYY')||' '||
         'p_fec_dos='||to_char(d2,'DD/MM/YYYY'));
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'pdf');
         v_rep := RUN_REPORT_OBJECT(repid);
         rep_status := report_object_status(v_rep);
         WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP
              rep_status := report_object_status(v_rep);
         END LOOP;
         IF rep_status = 'FINISHED' then
              WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver','_blank');
         ELSE
              ventana('E','error reporte no encontrado','S');
         END IF;
    END;
    END;
    The 'rep_lab02' is the name of the report that you give in the node reports
    p_fec_uno and p_fec_dos they are the parameters in the report
    repserver is the name of server created with rwserver
    Greetings

  • Passing Paramaters to Reports from form.

    Hi,
    How do we pass paramaters to a report6i called from the forms6i in non-web and web environment?
    Thanks,
    Neha.

    Hi Neha,
    Read the help for parameter list. Parameters are passed using parameter list.
    Attached is an example: ( Calling Report <REP> passing the value of the form field <Parameter1> for the report parameter <Param1>.
    DECLARE
    pl_id ParamList;
    BEGIN
    pl_id := Get_Parameter_List('tmpdata');
    IF NOT Id_Null(pl_id) THEN
    Destroy_Parameter_List( pl_id );
    END IF;
    pl_id := Create_Parameter_List('tmpdata');
    Add_Parameter(pl_id, 'P_Param1', TEXT_PARAMETER, :Parameter1);
    Run_Product(REPORTS, 'REP1', SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
    END;
    Hope it helps.
    ~Ajay

  • Passing Parameter to Report from a JSP

    <p>I have a report which calls a Oracle stored procedure which requires some  IN parameters. These parameters need to be passed from the JSP. For this scenario if someone has some sample code please post it.</p><p>Thanks.<br /></p><p>&#160;</p>

    <p>In the scenario you described the report that connects to the stored procedure will automatically require parameters so they can be passed to the stored procedure.</p><p>Here is a link to a sample that passes a parameter to a report at runtime using BusinessObjects Enterprise XI R2:</p><p>http://diamond.businessobjects.com/node/1018 </p><p>Rob Horne<br /><a href="/blog/10">Rob&#39;s blog - http://diamond.businessobjects.com/blog/10</a></p>

  • Faxing a Report From Forms using Outlook

    I havea problem in faxing a report from Oracle Developer 2000.
    There is a metalink in OLE for fax ing report using Outlook
    express. But i'm having problem with that.
    Any suggestion is welcome.
    I was able to send the o/p to file PDF format , but wasn't able
    to fax that file.
    null

    Here is my code sorry about posting twice. Please note that the parameter list has been created as described.
    report_id := find_report_object('MENU_REPORT_NODE');
    Tool_Env.Getvar('ReportsServer', reports_server);
    Tool_Env.Getvar('ReportsFolder', reports_folder);
    dest_file := reports_folder || :global.username || '\' || rep_name || '.pdf';
    SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_FILENAME, rep_name);
    SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_SERVER, reports_server);
    SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_COMM_MODE, SYNCHRONOUS); -- wait for the report to finish
    -- SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_DESNAME, dest_file);
    SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_DESTYPE, cache);
    SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_DESFORMAT, 'PDF');
    SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_OTHER, 'paramform=yes' || ' ' || 'mode=bitmap');
    report_job := run_report_object(report_id);

  • Calling a report from form using web.show_document

    Hi,
    Used the method as below, But , error reprot not found,
    Could anybody tell me how to get the server name from ny local machine as in the example servername ' Repsrv '
    /* WHEN-BUTTON-PRESSED */
    DECLARE
    vc_url varchar2(100);
    BEGIN
    vc_url:=‘http://<hostname><port>/reports/rwservlet?server='
    ||
    ‘Repsrv&report=reptest.rdf&desformat=htmlcss&destype=cache ’
    ||
    '&userid=user/pw@database&p_deptno='||:dept.deptno||'&paramform
    =no’;
    WEB.SHOW_DOCUMENT(vc_url,’_blank’);
    END;
    Thanks

    If you are attempting to print a report from a when-button-pressed trigger from within a form, you do not have to explicitly specify the server (hostname) nor the port. You can just use what I've found referred to as a virtual path to the server as I have done here:
    parm_string := '/reports/rwservlet?config=my_config&report=report_name'
         ||'&desformat=pdf&destype=cache'
         ||'&paramform=no&printjob=no'
         ||'&p_my_user_param1='||v_my_param1
         ||'&p_my_user_param2='||v_my_param2;
    web.show_document(parm_string,'_blank');
    You can specify a userid/password@connectstring within a named congifuration section of your formsweb.cfg file if necessary, e.g. my_config.
    Hope this helps.
    James K.

  • Pass parameter to report paramater form from a form

    I defined parameter in a form. I am trying to pass the parameters to a report's parameter form. Is there any way to accomplish this?
    Thank you!

    Maybe this example will help. This can be added in a when button pressed event to run the report.
    DECLARE
    pl_id ParamList;
    subheader varchar2(1000);
    BEGIN
    ** Check to see if the 'tmpdata' parameter list exists.
    pl_id := Get_Parameter_List('tmpdata');
    ** If it does, then delete it before we create it again in
    ** case it contains parameters that are not useful for our
    ** purposes here.
    IF NOT Id_Null(pl_id) THEN
    Destroy_Parameter_List( pl_id );
    END IF;
    ** Create the 'tmpdata' parameter list afresh.
    pl_id := Create_Parameter_List('tmpdata');
    ** Add 1 data parameters to this parameter list
    */ -- subheader is a parameter created in Oracle Reports
    subheader := :variable.txt_message_yes;
    Add_Parameter(pl_id,'SUBTITLE',TEXT_PARAMETER,subheader );
    **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
    */ -- ABC is the report name
    Run_Product(REPORTS, 'ABC', SYNCHRONOUS, RUNTIME, FILESYSTEM, pl_id, NULL);
    END;
    null

  • Pass 2 parameter to report from form-URGENT!!

    I want to sene 2 parameter
    1st parameter will send the p_where_clause
    and
    2nd one will send one text the a certain text item in report.
    My 1st parameter is P_where_clause
    and 2nd Parameter is p_amount.
    Please help me.
    regards,
    shalauddin

    USE THE COMMANDS IN FORMS6I.
         pl_id:= Get_parameter_list('tmpdata');
         if not id_null(pl_id) then
         Destroy_parameter_list('tmpdata');
         end if;
         pl_id:= Create_Parameter_List('tmpdata');
    Add_parameter(pl_id, 'EMP', TEXT_PARAMETER, TO_CHAR(:CODIGOEMPLEADO));
         Run_Product(Reports, 'YOUR_REPORT',ASYNCHRONOUS,runtime,filesystem,pl_id,NULL);

  • Passing parameters to report from form

    hi all
    i have a form which passes a parameter to the reports
    Depending on the parameter the heading is decided ,
    how can i do that??
    eg i have 2 headings school and college
    if i pass school from my forms the heading of the report should be school
    and if it is college the heading should be college
    plzz help me
    thanks
    mandar

    If you just want to change the heading of a column dynamically, you can go with any of the two options. For both the options, you need to remove the static text and replace it with any dummy field (ensure the reference of field w.r. to repeating frame)
    1. Use the Format Trigger and change the heading to either "school" or "college" based on your field value.
    Ex.
    If :<field_name> = 'S'
    then :dummy_field := 'School'
    Else
    :dummy_field := 'College'
    End If;
    Return (true)
    2. Another option is similar to this and uses a CF.
    (I would prefer CF).
    Warm Regards,
    Raja.

  • Passing sql to reports from forms

    Hi can some one tell me how can i pass the sql to reports.
    cmk

    Hi
    You can pass it as a data parameter through the run_report_object builtin and interpret the query using lexical variables in the Report DataModel.
    HTH
    Arvind Balaraman

  • Passing data to reports from Forms

    Another question,
    we have a few Forms which call a report and pass the data directly to the report. The report itself isn't doing another query. At the moment I can't imagine a solution to that, but myabe I'm wrong.
    Changing the report to get some parameters and redoing the Query is not easy to do, Because we would loose the possibility to change the result-set inb Forms (f.e. Clear-Record) and only print out the changed result-set with the report.
    I would be grateful for any suggestion.
    Mark

    OK,
    you've asked ;-)
    here is one easy example.
    We have a form mainly based on one main data-block which corresponds to onw DB-Table which has a PK.
    we have some more blocks which are used for selection-fields, and so on.
    After setting the selection-fields and executing the query there could be f.e. in the Data-Block 10 rows. After that the User could delete f.e. 5 records with Shift-F4. This deletion is only done in the Forms-Block there is no action in the DB as well as no locking.
    After that he starts the reports-Object which is related to that particular Forms-Block. This relation is setup in the Form-Builder as Datasource-Block and Query-Name (both can't be changed at runtime).
    The clou is, that reports receives this Datablock and reads (I'm not sure where) only the 5 rows left in the Forms-Block.
    If I think about a IAS-Implementation whith a client on PC1 the Forms-Service on SRV1 and the Reports-Service on SRV2 that could be tricky to solve.
    regards,
    mark

Maybe you are looking for