This discussion is archived
1 2 Previous Next 26 Replies Latest reply: Jan 22, 2013 12:55 AM by Christian Erlinger Go to original post RSS
  • 15. Re: unable to run report
    HamidHelal Guru
    Currently Being Moderated
    Check my code and Try this code in you button. I write it considering your situation and information you provided. You can directly paste in your button trigger.
    DECLARE
     
         v_repid REPORT_OBJECT;
         v_rep VARCHAR2(100);
         v_rep_status VARCHAR2(100);
         v_param VARCHAR2(200) := NULL;
         v_valor VARCHAR2(200);
         v_url VARCHAR2(2000);
         v_repserver varchar2(20) := 'myserver'; -- YOUR REPORT SERVER NAME
          
         v_report varchar2(100) := 'E:\myrep.jsp'; -- YOUR REPORT PATH AND NAME
         /* IF .JSP IS NOT WORK CONVERT IT TO .REP AND TRY */
         v_PARAMETRO varchar2(100) := '';
     
    BEGIN
     
         v_repid := FIND_REPORT_OBJECT('report5'); -- report is an element from object navigator report
         SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_FILENAME, v_report);
         SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_EXECUTION_MODE, BATCH);
         SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_COMM_MODE, SYNCHRONOUS);
         SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_DESTYPE, cache);
         SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_DESFORMAT, 'pdf' );
         SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_DESNAME, v_report);
         SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_SERVER, v_repserver);
         SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_OTHER, 'paramform=no '||v_PARAMETRO);
         v_rep := RUN_REPORT_OBJECT(v_repid);
         v_rep_status := REPORT_OBJECT_STATUS(v_rep);
         WHILE v_rep_status IN ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP
         v_rep_status := REPORT_OBJECT_STATUS(v_rep);
         END LOOP;
         IF v_rep_status = 'FINISHED' THEN
         message(v_rep);
         message(v_rep);
         WEB.SHOW_DOCUMENT(v_url||'/reports/rwservlet/getjobid'||
         SUBSTR(v_rep, INSTR(v_rep,'_', -1)+1)||'?'||'server='||v_repserver, '_blank');
         END IF;
          
    END;
    then let me know what you get..

    ed: I updated my blog link post. You can check from first again, if needed.

    Edited by: HamidHelal on Jan 21, 2013 12:43 AM
  • 16. Re: unable to run report
    newbi_egy Explorer
    Currently Being Moderated
    andreas
    Did you restart the reports server and OC4J ?
    yes .
    What excactly did you put in the filename-property of the report_object in forms.
    all properties have their default values , i did not missed with any of them ,
    the property's value you're asking for is "myrep" without ( " ) .
    if you could answer me ,please ,
    i am writing rwserver server=my-servername in the "run-command" and the server is working , but when i write rwserver server=any characters , the server is working too .
    like so rwserver server=asdfsadf , how is that can be ?
    hamidhelal .
    Check my code and Try this code in you button.
    a lot of thanks to you , it worked but it messages me "my-server name_23 then 26 then 27 , something like that , and i do not know why can not i use the simple way :
    declare 
         rp report_object ;
         v varchar2(90) ; 
    begin 
         rp := find_report_object('report5') ; 
         v := run_report_object(rp) ; 
    end ;
    should not it work , whyis the need of the long and complex technique ! , why is the need of web.show_document ?!
    why is the simple way not working ?
  • 17. Re: unable to run report
    Christian Erlinger Guru
    Currently Being Moderated
    i am writing rwserver server=my-servername in the "run-command" and the server is working , but when i write rwserver server=any characters , the server is working too .
    like so rwserver server=asdfsadf , how is that can be ?
    because rwserver server=<something> will create a new reports server if it doesn't exist.
    declare 
         rp report_object ;
         v varchar2(90) ; 
    begin 
         rp := find_report_object('report5') ; 
         v := run_report_object(rp) ; 
    end ;
    should not it work , whyis the need of the long and complex technique ! , why is the need of web.show_document ?!
    why is the simple way not working ?
    Why simple when it can be complicated? If it were simple then everybody could do it ;).

    run_report_object just executes the report on the server, and in the case of destype=preview this would mean it generates a PDF on the server (in the cache directory of your reports server). The distribution itself can be different; in the case of destype=preview you want to show it to the client which is done via web.show_document which can also be used to display any website. You can however also send the report directly to the printer or via E-Mail which would require something else. Have a look at rp2rro.pll and you'll see the difference between the different destypes.

    The answer to "why is this so complex" would be the same answer to "why on earth do I have to use +malloc+ and +free+ in C to dynamically allocate memory": It is simply the way it is done ;).

    cheers
  • 18. Re: unable to run report
    newbi_egy Explorer
    Currently Being Moderated
    Why simple when it can be complicated? If it were simple then everybody could do it
    the question is why is it complex if it can be easy , i am saying this because i've looked on the online help for run_report_object and i found the example like i've written , so i thought that this is the way to run the report , and i think it is a way indeed because i am asking about it along time ago in this thread and people answering me on how to modify it , and modify my mistakes . nobody mentioned the web.show_doc except hamidhelal .
    that is why i am asking about the easy way .
    because rwserver server=<something> will create a new reports server if it doesn't exist.
    is that mean that i do not need to search for my report server name , and just type and name ?
    because i had a long time searching for it , i did not know the way to know it .

    where can i find rp2rro.pll ? i've searched for it in devsuitehome_1 . found nothing .

    Edited by: semsem on Jan 21, 2013 1:31 AM
  • 19. Re: unable to run report
    Christian Erlinger Guru
    Currently Being Moderated
    the question is why is it complex if it can be easy ,
    See my above explanation what run_report_object does, and you will see why web.show_document is needed.
    because rwserver server=<something> will create a new reports server if it doesn't exist.
    is that mean that i do not need to search for my report server name , and just type and name ?
    because i had a long time searching for it , i did not know the way to know it .
    If you don't care about your reports server configuration (e.g. the source directory). You create the reports server yourself, and name it. It must not already exist in the network, but besides that you can name it however you like. You could use rwdiag -findall to see which reports server already exist on the network.
    >
    where can i find rp2rro.pll ? i've searched for it in devsuitehome_1 . found nothing .
    it is located in $ORACLE_HOME/forms

    cheers
  • 20. Re: unable to run report
    newbi_egy Explorer
    Currently Being Moderated
    If you don't care about your reports server configuration
    why should i care about it ? what bad things could i face if i do not care ?
  • 21. Re: unable to run report
    Christian Erlinger Guru
    Currently Being Moderated
    The source directory, the cache directory, the job status repository, the mailserver to send mails via reports are configured in the reports server config file to name a few...

    everytime you create a new reports server you will start with a blank configuration.

    see
    http://docs.oracle.com/cd/B14099_19/bi.1012/b14048/pbr_conf.htm#sthref169

    cheers
  • 22. Re: unable to run report
    newbi_egy Explorer
    Currently Being Moderated
    about the code hamidhelal put :
    DECLARE
     
         v_repid REPORT_OBJECT;
         v_rep VARCHAR2(100);
         v_rep_status VARCHAR2(100);
         v_param VARCHAR2(200) := NULL;
         v_valor VARCHAR2(200);
         v_url VARCHAR2(2000);
         v_repserver varchar2(20) := 'myserver'; -- YOUR REPORT SERVER NAME
          
         v_report varchar2(100) := 'E:\myrep.jsp'; -- YOUR REPORT PATH AND NAME
         /* IF .JSP IS NOT WORK CONVERT IT TO .REP AND TRY */
         v_PARAMETRO varchar2(100) := '';
     
    BEGIN
     
         v_repid := FIND_REPORT_OBJECT('report5'); -- report is an element from object navigator report
         SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_FILENAME, v_report);
         SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_EXECUTION_MODE, BATCH);
         SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_COMM_MODE, SYNCHRONOUS);
         SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_DESTYPE, cache);
         SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_DESFORMAT, 'pdf' );
         SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_DESNAME, v_report);
         SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_SERVER, v_repserver);
         SET_REPORT_OBJECT_PROPERTY(v_repid, REPORT_OTHER, 'paramform=no '||v_PARAMETRO);
         v_rep := RUN_REPORT_OBJECT(v_repid);
         v_rep_status := REPORT_OBJECT_STATUS(v_rep);
         WHILE v_rep_status IN ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP
         v_rep_status := REPORT_OBJECT_STATUS(v_rep);
         END LOOP;
         IF v_rep_status = 'FINISHED' THEN
         message(v_rep);
         message(v_rep);
         WEB.SHOW_DOCUMENT(v_url||'/reports/rwservlet/getjobid'||
         SUBSTR(v_rep, INSTR(v_rep,'_', -1)+1)||'?'||'server='||v_repserver, '_blank');
         END IF;
          
    END;
    could anyone please demonstrate the "while loop" , the we.show_doc line and why should i change the properties programatically ?while i can do it from the property palette .
  • 23. Re: unable to run report
    HamidHelal Guru
    Currently Being Moderated
         v_rep_status := REPORT_OBJECT_STATUS(v_rep);
    getting the status of v_rep
         WHILE v_rep_status IN ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP
         v_rep_status := REPORT_OBJECT_STATUS(v_rep);
         END LOOP;
    waiting for status FINISHED. it's ready to show the report.. mean report generation in complete.
         IF v_rep_status = 'FINISHED' THEN
         message(v_rep);
         message(v_rep);
         WEB.SHOW_DOCUMENT(v_url||'/reports/rwservlet/getjobid'||
         SUBSTR(v_rep, INSTR(v_rep,'_', -1)+1)||'?'||'server='||v_repserver, '_blank');
         END IF;
    Shows your report.


    Hope it helps...


    Hamid
  • 24. Re: unable to run report
    newbi_egy Explorer
    Currently Being Moderated
    why should i change the properties programatically ?while i can do it from the property palette ?
    WEB.SHOW_DOCUMENT(v_url||'/reports/rwservlet/getjobid'||
    SUBSTR(v_rep, INSTR(v_rep,'_', -1)+1)||'?'||'server='||v_repserver, '_blank');
    END IF;

    i mean , what is getjobid for example , '_blank' , such these words ?
    WHILE v_rep_status IN ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP
    what are 'running ,opening_report,enqueued ?
    thanks
  • 25. Re: unable to run report
    newbi_egy Explorer
    Currently Being Moderated
    WEB.SHOW_DOCUMENT(v_url||'/reports/rwservlet/getjobid'||
         SUBSTR(v_rep, INSTR(v_rep,'_', -1)+1)||'?'||'server='||v_repserver, '_blank');
         

    from where do you know the url of the report which is not run yet ?
    and what is "getjobid" ?
  • 26. Re: unable to run report
    Christian Erlinger Guru
    Currently Being Moderated
    and what is "getjobid" ?
    it is a parameter for the reports servlet. See
    http://docs.oracle.com/cd/B14099_19/bi.1012/b14048/pbr_cla.htm

    and might I suggest you read the documentation on Oracle® Application Server Reports Services Publishing Reports to the Web as the general hows and whys are in there:

    http://docs.oracle.com/cd/B14099_19/bi.1012/b14048/title.htm#BEGIN

    cheers
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points