Calling report from form with lexical parameter

hi
DECLARE
     repid REPORT_OBJECT;
     v_rep VARCHAR2(1000);
     rep_status VARCHAR2(20);
BEGIN
          repid := FIND_REPORT_OBJECT( 'REPORT34' );
          set_report_object_property(repid,report_other,'p_SEASON_YEAR='||:SALE_ORDER.SEASON_YEAR
          ||' &sort='||:sale_order.sort1);
          --set_report_object_property(repid,report_other,'p_g_id =20');
          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
--Display report in the browser
WEB.SHOW_DOCUMENT('http://127.0.0.1:8889/reports/rwservlet/getjobid'||
substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver90','_blank');
ELSE
message('Error when running report');
END IF;
PAUSE;
END;i had made a lexical parameter in reports the reports code is
SELECT s.season_year,sd.prod_id,P.PROD_NAME,sum(sd.total_qty)
FROM sale_order s,sale_order_detail sd,PRODUCT P,CUSTOMER_MASTER cm,CUSTOMER_DETAIL cd
where s.id=sd.id and P.PROD_ID=SD.PROD_ID AND s.season_year = :p_season_year
AND CD.CUST_ID=CM.CUST_ID AND CD.CUST_ID=S.CUST_ID AND CD.COUNTRY NOT LIKE 'SPA%' AND Sd.PROD_ID LIKE  'CA%'
group by s.season_year,sd.prod_id,P.PROD_NAME
&sortthanks and regards
vikas

Vikas,
So, is your code producing an error when your report is called? Also, it would be helpful to know your Forms and Reports versions. Is ":p_season_year" set up as a USER_PARAMETER (UP) in your report or is it a true lexical parameter (meaning you should reference it with '&' instead of ':')? If it is a UP, the typical way to pass a value to this UP from Forms is to use a ParamList object instead of the REPORT_OTHER parameter of the Set_Report_Object_Property built-in. For example:
DECLARE
   pl_id    ParamList;
   pl_name  VARCHAR2(10) := 'REPORT34';
   v_rep VARCHAR2(1000);
   rep_status VARCHAR2(20);
BEGIN
   pl_id := Get_Parameter_List(pl_name);
   IF id_null(pl_id) THEN
      pl_id := Create_Parameter_List(pl_name);
   END IF;
   Add_Parameter(pl_id, 'P_SEASON_YEAR', TEXT_PARAMETER, :SALE_ORDER.SEASON_YEAR);
   repid := FIND_REPORT_OBJECT( 'REPORT34' );
   v_rep := RUN_REPORT_OBJECT(repid, pl_id);
   ...  rest of your code here  ...
END;Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly.

Similar Messages

  • Calling report from form and after parameter form trigger

    Hi, I've also posted to this to the reports forum but because it works from Reports Builder it may be a forms issue which is why I'm x-posting. Apologies.
    I have a report that creates a file, desname is set in the after parameter form trigger (it uses one of the parameter values).
    The problem is file is not created using the path and filename set in the trigger, the file is created in the bin folder with the name account_by_service_type.txt (account_by_service_type.rdf is the report definition).
    If the desname is set in the before parameter form AND a field with the source=desname is added to the parameter form then the file will be created with the correct path and name however it won't have the relevant parameter incorporated into the file name obviously.
    I've noticed in other reports that where the desname is being set in the after parameter form that I've had to pass the desname from the form but obviously I cannot do that here either.
    Am I missing something obvious?
    Regards
    Sean

    Hi Frank,
    It's WebForms. Below is the code:
    -- call from menu item
    run_report_object_proc(TRUE,'accounts_by_service_type.RDF',null,FILE,'delimited','paramform=yes');
    -- run_report_0bject procedure
    PROCEDURE run_report_object_proc (p_screen IN BOOLEAN,
                        p_report_filename IN VARCHAR2,
                        p_desname IN VARCHAR2,
                        p_destype IN NUMBER,
                        p_desformat IN VARCHAR2,
                        p_paramform IN VARCHAR2)IS
    v_report_id     report_object;
    v_report     varchar2(100);
    v_job_id     varchar2(100);
    v_url          varchar2(1000);
    rep_status     varchar2(20);
    hidden_action     VARCHAR2(2000)     :='';
    BEGIN
    v_report_id := find_report_object( 'report2');
    SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_FILENAME,p_report_filename);
    SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESNAME,p_desname);
    SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESTYPE,p_destype);
    SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESFORMAT,p_desformat);
    hidden_action := hidden_action||'&report='||GET_REPORT_OBJECT_PROPERTY(v_report_id, REPORT_FILENAME);
    hidden_action := hidden_action||'&destype='||GET_REPORT_OBJECT_PROPERTY(v_report_id, REPORT_DESTYPE);
    hidden_action := hidden_action||'&desformat='||GET_REPORT_OBJECT_PROPERTY(v_report_id, REPORT_DESFORMAT);
    hidden_action := hidden_action||'&userid='||GET_APPLICATION_PROPERTY(username)||'/'||GET_APPLICATION_PROPERTY(password)||'@'||GET_APPLICATION_PROPERTY(connect_string);
    if p_desname is not null then
    hidden_action := hidden_action||'&'||p_paramform||'&desname='||p_desname;
    else
    hidden_action := hidden_action||'&'||p_paramform;
    end if;
    hidden_action := '/reports/rwservlet?_hidden_server=rserv1'||hidden_action;
    SET_REPORT_OBJECT_PROPERTY(v_report_id, REPORT_OTHER, 'pfaction='||hidden_action||' '||p_paramform);
    -- SET_REPORT_OBJECT_PROPERTY(v_report_id, REPORT_OTHER, 'paramform=no');
    v_report := run_report_object( v_report_id);
    IF p_screen THEN
         v_job_id := substr(v_report,instr(v_report,'_',-1)+1);
    rep_status:=report_object_status(v_report);
    while rep_status in ('RUNNING', 'OPENING_REPORT', 'ENQUEUED')
    loop
         rep_status:=report_object_status(v_report);
    end loop;
    if rep_status='FINISHED' THEN
         v_url := '/reports/rwservlet/getjobid'||v_job_id||'?server=rserv1';
              web.show_document(v_url,'_blank');
    else
         message(rep_status||' error running report');
    end if;     
    end if;
    END;
    -- report after parameter form trigger
    function AfterPForm return boolean is
    begin
    :desname := 'c:\service_type_'||:p_service_type||'_'||to_char(sysdate,'DDMMYYYY')||'.xls';
    return (TRUE);
    end;

  • Calling report from form by passing parameter

    I have one form in which their is one filed name ID and another field which is nonbase table field. Now i want to run a report by enterint 'Y' in nonbase table field by taking the value of ID from ID field..
    This value of ID is a parameter for report tobe run....
    So how can i do this ?
    How can i create a parameter in form and pass it to report for to run..?
    thanks in advance

    This is one way of doing it :
    Create a parameter in the form and name it say : param_id, set the properties as desired. Create a parameter in the report to be run with the same name and the same properties. The where clause statement of your report query should be like this :
    WHERE ID = :PARAM_ID
    Then in the POST-CHANGE or KEY-NEXT-ITEM trigger at the non-base table item level enter the code like this :
    DECLARE
    pl_id ParamList;
    pl_name VARCHAR2(10) := 'rpt_data';
    BEGIN
    pl_id := Get_Parameter_List(pl_name);
    IF Id_Null(pl_id) THEN
    pl_id := Create_Parameter_List(pl_name);
    ADD_PARAMETER(pl_id,'PARAM_ID',TEXT_PARAMETER,TO_CHAR(:ID)); -- TO_CHAR only if ID is NUMBER
    ADD_PARAMETER(pl_id,'PARAMFORM', TEXT_PARAMETER, 'NO'); -- this is only if you want to hide the parameter form that is displayed when running the report.
    RUN_PRODUCT(REPORTS,'report_name.rdf',SYNCHRONOUS,RUNTIME, FILESYSTEM,pl_name);
    DESTROY_PARAMETER_LIST(pl_name);
    ELSE
    Message('Parameter list '| |pl_name| |' already exists!');
    RAISE Form_Trigger_Failure;
    END IF;
    END;
    Hope this helps ! I don't know the version of forms that you are using, but this is valid in 4.5 and 5.
    Sudha

  • Calling Report from Form Error ORA-06508

    Dear all,
    I want migrate from Fom6i to Oracle Developer Suite 10g (10.1).
    Folder Form = C:\APLIORA\IRS\FORM
    Folder Report = C:\APLIORA\IRS\REPORT
    I have modified file DEFAULT.ENV
    FORMS_PATH=C:\APLIORA\IRS\FORM;C:\APLIORA\IRS\REPORT
    i do not have problem call a form from form.
    but when i call report from form show error ORA-06508 : PL/SQL : could not find program unit being called ; -6508
    my procedure is
    PROCEDURE Call_Report IS
         list_id ParamList;
    BEGIN
    list_id := Get_Parameter_List('input_params');
    IF NOT Id_Null(list_id) THEN
    Destroy_Parameter_List(list_id);
    END IF;
    list_id := Create_Parameter_List('input_params');
    Add_Parameter(list_id,'MAXIMIZE',TEXT_PARAMETER,'YES');
    Add_Parameter(list_id,'ORACLE_SHUTDOWN',TEXT_PARAMETER,'YES');
    RP2RRO.RP2RRO_RUN_PRODUCT(REPORTS,'TESTREPORT.REP',SYNCHRONOUS,RUNTIME,FILESYSTEM,list_id,null);
    END ;
    Do I miss something ?
    Can any one help ?
    Thanks

    Hi,
    Thank you for your replay.
    The problem have solved.
    This my step :
    1. Install Windows XP SP2 and Form 10.1.2.0.2 on new pc.
    2. Install Jinit version 1.3.1.28.
    3. Create report server
    3. Compile form, report and pll
    4. call report from from with this procedure :
    PROCEDURE Call_Report (vFILENAME varchar2) IS
    report_id                Report_Object;
    ReportServerJob VARCHAR2(100);
    vc_rep_status      VARCHAR2(100);
    repsvr                          varchar2(21) := 'myserv';
    userid                         VARCHAR2(100);
    pass                          VARCHAR2(100);
    Host                    VARCHAR2(100);
    BEGIN
    userid          := Get_Application_Property(USERNAME) ;
    pass          := Get_Application_Property(PASSWORD) ;
    Host          := Get_Application_Property(CONNECT_STRING) ;
    report_id:= find_report_object('REPORT');
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_FILENAME,vFILENAME||'.jsp');
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER,repsvr);
    ReportServerJob:=run_report_object(report_id);
    vc_rep_status := REPORT_OBJECT_STATUS(ReportServerJob);
    WHILE vc_rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED', null)
    LOOP
    vc_rep_status:=REPORT_OBJECT_STATUS(ReportServerJob);
    END LOOP;
    IF vc_rep_status='FINISHED' THEN
    WEB.SHOW_DOCUMENT('/reports/rwservlet?report='||vFILENAME||'.jsp'||'&userid='||userid||'/'||pass||'@'||Host||'&destype=CACHE&desformat=PDF&paramform=yes','_blank');
    ELSE
    message ('Report failed with error message '|| vc_rep_status);
    END IF;
    END;
    Ok, but i have another strange error. I will post new thread.
    Thank you and regards
    Teguh S

  • Calling Report From Form To Many Destinations

    Hi
    I am calling reports from forms using SET_REPORT_OBJECT_PROPERTY and then run_report_object.
    I dont know the destination until runtime of the report which is ok as I can pass this in via my procedure, but if that destination is many ie mail and file what is the best way to distribute the report?
    I could call my procedure for each destination but that seems a bit unefficient since the report would be created many times, is there another way?

    what about adding a drop-down-list near your report-button where you can choose the destination?
    when you click the report-button you simply read the value selected in the drop-down-list and send it to your reports-server too.

  • REP 110 & REP 0110 .calling reports from Form 10g(10.1.2.0.2)

    Hi All,
    We are migrating form from Oracle form 6i to Oracle 10g(10.1.2.0.2). I am calling reports from forms
    using Web.Show_Docment(). When we run reports in report builder 10g it works fine.
    But when we try to run reports from Forms 10g it throws error which is given below.
    We want to run reports from UNIX. After using this url to submit report we get error REP 110 and REP 0110
    URL
    http://GEM:7777/reports/rwservlet?server=rep_server&report=/u01/forms/QA_Forms10g/GEMREP.rdf+DESTYPE=CACHE+DESFORMAT=HTML+p_user_id=XYZ+p_client=2
    ERROR
    REP-110: File '/u01/forms/QA_Forms10g/GEMREP.rdf DESTYPE=CACHE DESFORMAT=HTML p_user_id=XYZ p_client=2' not found.
    REP-0110: Unable to open file '/u01/forms/QA_Forms10g/GEMREP.rdf DESTYPE=CACHE DESFORMAT=HTML p_user_id=XYZ p_client=2'.
    I will really appreciate your help.
    Thanks
    Sandy

    Hello,
    You are mixing 2 separators in the URL : & and +
    Use only one separator in the URL :
    Example :
    http://GEM:7777/reports/rwservlet?server=rep_server+report=/u01/forms/QA_Forms10g/GEMREP.rdf+DESTYPE=CACHE+DESFORMAT=HTML+p_user_id=XYZ+p_client=2
    Regards

  • Calling a report from forms with a paramter form

    Hello,
    How do you call a report from forms and get it to display the parameter form. Where you can then call the report using this parameter form. I have been using paramform=yes. but it simply runs the form.
    I saw on a a thread ages ago that this was a sample of this available for download. Is this true?
    thanks

    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);

  • Parameter form display while calling reports from form

    Dear All,
    I am running reports from form using run_report_object. I do not want to see parameter form while running the report. How do I do that.
    Thanks in Advance
    Gaurav Shah

    Hi, try to set paramform=NO in your parameter list
    Daniel

  • Calling report from form in Web environment

    Hi,
    We are in the process of migrating our C/S appication (developed in Developer2k) to intranet using OAS. My question :
    a) Is there any other way to call report from a form other than web.show_document?
    b) When a report is called from the report server(using web.show_document), a log-in screen comes up unless the login and password is passed as parameter. Only problem with this is the password shows in the URL. Is there any other way to make the call so that the login & password does not show and the user won't have to login a second time to run the report?
    Any reply would be appreciated..Thanks

    1. Yes you can use run_product package procedure to call reports on web, Oracle documentation says that run_product command will run in web env.
    2. Yes you can hide username & password from user, it depends on which method you are using to call reports, if you are using web cgi then add username & password in file "cgicmd.dat" and "oascmd.dat" for web catridge or in cartridge parameter setting you will find this files in directory "\orant\report60\server\".
    Darshan Desai
    [email protected]
    null

  • Calling report from form. Need PDF output

    I am calling a report from a form using RUN_PRODUCT. I need to display the form in PDF format. When the user clicks the button in the form to run the report, acrobat reader should open up and the report displayed there. Please help.
    Thanks

    Thanks for the response. The first part worked. I am able to get the output in PDF format. In the 2nd part where I want to open acrobat and display the output, I am having some trouble with the code. When I compile, it says
    win_api_environment.read_registry must be declared. Is there some package I need to attach?
    Also, in the After reports trigger, how do I pass vFile (I am assuming this is the PDF file name)?
    Thanks
    The first thing you'll want to do is pass parameters to the report IE DESTYPE, DESNAME and DESFORMAT where these could be FILE, 'c:\temp\report' and PDF.
    Then, you can try this piece of code I wrote (with some help from other people at Metalink and here) sometime back. Now, I call it from forms, but in your case, you'd have to run it in the after report trigger. Since with RUN_PRODUCT you don't know when the report is finished, if you did it from the form, it wouldn't work correctly.
    PROCEDURE OPEN_PDF(vFile IN VARCHAR2)
    IS
    vcServerApp varchar2(40);
    vcServerTag varchar2(600);
    vcCommand varchar2(2000);
    iArgPos pls_integer;
    dummy NUMBER;
    BEGIN
    -- 1 get the Server App for .PDF files
    vcServerApp := win_api_environment.read_registry('HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\.PDF','',true);
    -- 2 get the executable
    vcServerTag := 'HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\'||
    vcServerApp||'\SHELL\OPEN\COMMAND';
    vcCommand:= win_api_environment.read_registry(vcServerTag,'',true);
    -- 3 Sort out how to specify the Filename
    iArgPos:= instr(vcCommand,'%1');
    if iArgPos = 0 then --no substitution Var on the command line
    vcCommand := vcCommand||' '||vFile;
    else
    vcCommand := substr(vcCommand,1,(iArgPos-1))||
    vFile||substr(vcCommand,(iArgPos+2));
    end if;
    -- 4 Run using Winexec (or Host if preferred).
    win_api_shell.winexec(vcCommand);
    EXCEPTION
    when no_data_found then
    abortt('Acrobat Reader was not found! Please consult with your help desk to install it and try again.','N');
    END;
    Chad
    I am calling a report from a form using RUN_PRODUCT. I need to display the form in PDF format. When the user clicks the button in the form to run the report, acrobat reader should open up and the report displayed there. Please help.
    Thanks

  • FRM-41219 - Cannot able to call reports from form generated in Designer

    Hi
    I'm trying to call a report from form whit a button generated in Designer 10.1.2.0.2
    But I'm getting error : FRM-41219 Invalid report id
    I'm tying with a menu but I'm getting the same error.
    Please help me

    Note 1056653.6
    FRM-41219 Cannot Find Report: Invalid ID
    Problem Description:
    You are getting error: FRM-41219 Cannot Find Report: Invalid ID
    Problem Explanation:
    The code is using find_report_object and passing a report name to the function.
    The statements are as follows:
    DECLARE
    repid REPORT_OBJECT;
    BEGIN
    repid := FIND_REPORT_OBJECT('report1');
    END;
    Solution Explanation:
    The error message frm-41219 is a new error code which corresponds to the
    Oracle Developer forms/report integration.
    This message essentially means that the report cannot be found. Specifying the
    correct name of a report object found in the forms object navigator (not the
    actual name of the rdf file) usually resolves the problem.

  • Getting rep-3002 when calling report from form on web

    i am getting rep-3002 when i call report from a form on web environment. Report is in character mode. It is coming proper if i change it to bitmap. but my requirement is of character mode. pl. give some solution.

    Hello,
    If you are running in WinNT/2000 environment, the NT/2000 user which runs the Report Server service must have a printer defined. In the control panel, look at the properties for the Report Server to see what user it runs as. Log in as that user and make sure a default printer is defined.
    Regards,
    The Oracle Reports Team --skw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Call report from form 10g (10.1.2.0.2)

    hi
    i using win 2003 and db 10g and dev10g ( 10.1.2.0.2)
    and i want to call report from my form as following code :
    DECLARE
    dir varchar2(200);
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    BEGIN
    dir:=co$win.get_current_directory ;
    repid := find_report_object('CGNV$OFG_REPORT');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_FILENAME,dir||'\rep.jsp');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,runtime);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,CACHE);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'HTML');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rws');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=yes');
    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' --or rep_status is null
    THEN
    WEB.SHOW_DOCUMENT('http://hamid:8889/reports/rwservlet/getjobid'||
    substr(v_rep, instr(v_rep,'_',-1)+1)||'?server=rws','_blank');
    ELSE
    message(ER_RP);
    END IF;
    END;
    but i get error :
    frm-41213: unable to connect to the report server rws
    plz help me

    hi
    i using win 2003 and db 10g and dev10g ( 10.1.2.0.2)
    and i want to call report from my form as following code :
    DECLARE
    dir varchar2(200);
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    BEGIN
    dir:=co$win.get_current_directory ;
    repid := find_report_object('CGNV$OFG_REPORT');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_FILENAME,dir||'\rep.jsp');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,runtime);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,CACHE);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'HTML');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rws');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=yes');
    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' --or rep_status is null
    THEN
    WEB.SHOW_DOCUMENT('http://hamid:8889/reports/rwservlet/getjobid'||
    substr(v_rep, instr(v_rep,'_',-1)+1)||'?server=rws','_blank');
    ELSE
    message(ER_RP);
    END IF;
    END;
    but i get error :
    frm-41213: unable to connect to the report server rws
    plz help me

  • FRM-41214 unable to run report from forms with parameters

    Hi all,
    I am unable to run a report from forms if I pass parameters. Report is running fine in reports builder and in url if I access the report straightly.
    I used set_report_object_property to pass the parameters.
    Any clues to solve this problem?
    Priya

    Hi Jeneesh,
    Code is below:
    myreport1 :=find_report_object('MYREP');
    reportdata := Get_Parameter_List('reportsdata');
    IF NOT Id_Null(reportdata) THEN
    Destroy_Parameter_List( reportdata );
    END IF;
    reportdata := Create_Parameter_List('reportsdata');
    Add_Parameter(reportdata, 'account_number', TEXT_PARAMETER, :parameter.account_number);
         /* Setting the properties into Report Object */
         SET_REPORT_OBJECT_PROPERTY(myreport1, REPORT_COMM_MODE, SYNCHRONOUS);
         SET_REPORT_OBJECT_PROPERTY(myreport1, REPORT_DESTYPE, CACHE);
         SET_REPORT_OBJECT_PROPERTY(myreport1, REPORT_DESFORMAT, 'htmlcss');
         SET_REPORT_OBJECT_PROPERTY(myreport1, REPORT_SERVER,vc_reportserver);
                   SET_REPORT_OBJECT_PROPERTY(myreport1, REPORT_FILENAME, 'C:\priya\forms\EmcySummary.jsp');
              SET_REPORT_OBJECT_PROPERTY(myreport1,REPORT_OTHER,'account_number='|| :parameter.account_number);
         /* Value of v_rep identifies the report that is currently running either locally or on a remote report server */
         vrep := RUN_REPORT_OBJECT(myreport1,reportdata);
    /* Checking for Report Server is started or not, if not throw an exception else proceed */
         if vrep = vrep||'_0'then
         raise form_trigger_failure;
    end if;
         vjob_id := substr(vrep,length(vc_reportserver)+2,length(vrep));
         vrep_status := REPORT_OBJECT_STATUS(vrep);
         /* Checking the status of the report */
         WHILE vrep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    vrep_status := report_object_status(vrep);
    END LOOP;
    /* When the report status is successful then report is generated in Web */
         IF vrep_status = 'FINISHED' THEN
         --     COPY_REPORT_OBJECT_OUTPUT(vrep,v_tempstorage);
              WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid'||vjob_id||'?server='||vc_reportserver, '_blank');
         END IF;
    ---Any clues?

  • Call report from java with deployment of java web start

    I need call report from java,the call function is:execURL ( String pURL )
    pURL is a url link to call report from report services .
    such as :http://10.20.1.43:8888/reports/rwservlet?destype=cache&desformat=PDF&report=test.rdf&user=scott/tiger@cims
    public static void execURL ( String pURL )
    String tempstr = new String();
    int posIdx = 0;
    if ( (System.getProperty("os.name").equals("Windows NT"))||
    (System.getProperty("os.name").equals("Windows 2000")) )
    posIdx = pURL.indexOf("&");
    while ( posIdx > 0 )
    tempstr = pURL.substring(0,posIdx)+"^"+pURL.substring(posIdx);
    pURL = tempstr;
    posIdx = pURL.indexOf("&",posIdx+2);
    try
    Runtime.getRuntime().exec("cmd /c start "+pURL);
    catch (Exception e1) {System.out.println(e1.getMessage()); }
    else
    try
    Runtime.getRuntime().exec("start "+pURL);
    catch (Exception e2)
    System.out.println(e2.getMessage());
    It's run with no problem with deployment of simple jar.
    But when i call report with deployment of java web start,it can not.
    I think it's java secuity problem,so i add
    Permission java.io.FilePermission "c://winnt//system32//cmd.exe", "execute";
    in java.policy file in client(windows 20000).However ,it can not too.
    Who can help me,Thanks in Advance!

    David,
    In your code, 'cmd' is invoked as Runtime.getRuntime().exec("cmd /c start "+pURL);
    but in your policy file you specify
    Permission java.io.FilePermission "c://winnt//system32//cmd.exe", "execute";
    Before creating a new process, the security manager checks for FilePermission(cmd,"execute")
    if cmd is an absolute path, otherwise it calls checkPermission with
    FilePermission("<<ALL FILES>>","execute"). Try specifying
    FilePermission("<<ALL FILES>>","execute") in your policy file.
    But, I believe using exec, may not be the right solution as it may not work on
    other platforms. Also you will have to expect the client m/c to relax security
    permission.
    Did you consider using java.net.HttpUrlConnection class instead to access the report
    service URL?
    HTH,
    Sathish.

Maybe you are looking for