Wednesday, August 8, 2012

Procedure To Run Report From Oracle 10g Forms:-

The following procedure shows how to print report from oracle form.
Web.Show_Document() Built-in to call Oracle Reports on the Web is an alternative to the Run_Report_Object() Built-in.

Web.Show_Document(URL, Target);

1. url – The URL is passed as a string in a variable, or as a combination of both. If the target Web page is located on the same server that runs Forms Services,relative addressing could be used.

2.target  – Definition of the target where the addressed Web page should be displayed. Values must be single-quoted. Possible target values are ‘_blank’ to show the Reports output in an extra browser window, ‘_self’ to replace the Forms
application with the Reports output, ‘<frame name>’ to load the Reports output into a named frame of the multi frame HTML page.


A complete syntax example to run Reports from a browser looks like this:-

http://<server>:<port>/reports/rwservlet? keyname&report=<report>.rdf&desformat=[htmlcss|pdf|xml|delimited|]&destype=cache&paramform=[no|yes]

Report – the name of the Reports module to execute
desformat – the output format of the returned Reports result set. Desformat can be
htmlcss, html, pdf, xml, rtf and delimited. For Reports run from Forms pdf and
htmlcss are the most commonly used options

destype – determines where the Reports output gets written to. “Cache” specifies
that the Reports output gets streamed to the requesting browser. ‘

paramform – determines if Reports should display a HTML parameter form before
executing the request. The parameter form can be used for the user to further filter
the expected Reports result set. Valid values are ‘yes’ and ‘no’.

To reduce the length of the Reports request URL, you can create a key entry in the
Reports cgicmd.dat configuration file to store command line parameters that don’t
change from one Report to the other. In this case the first argument in a Reports
Web request, right after the question mark, must be the key name2.

Keyname refers to a command line listed under a unique header (the key name) in the cgicmd.dat file. Note that this works differently for JSP files, which use the keyword/value pair cmdkey=value to specify key names for command lines that are stored in the cgicmd.dat file.
DECLARE
REP_NAME varchar2 (2000); 
rep_url varchar2 (4000);
BEGIN
                                                               
                                REP_NAME:='d:\ PROJECTS\ code\'||'MYFIRSTREPORT.rdf';                                       
                                rep_url:='http://localhost:8890'||'/reports/rwservlet?employee&module='||REP_NAME                          
                                ||'&p_emp_code='||:BLOCK_NAME.EMP_CODE;
                                                                                                                                                                                                                               
                                WEB.SHOW_DOCUMENT(rep_url,'_blank');
END;

11 comments:

  1. Hi

    we are trying to get rdf output in html format. Report runs fine. get opened in new window, but unable to scroll neither vertically nor horizontally. Can u plz help....

    below is the code preview :


    function CallReport()
    {
    var path='http://1xx.2xx.3xx.4xx:7778/reports/rwservlet?server=rep_fsc-apptst_10gMiddletier&report=C:\\OraHome_3\\j2ee\\FSCTSM\\applications\\FSCTSM\\FSCTSM\\App_srv\\mm06\\rdf\\';


    if(document.forms[0].reportname.value=='StockSales')
    {
    window.open(path+'stocksales.jsp&userid=prodrep2/prdp@<%=serverName%>&DESFORMAT=html&destype=cache&PARAMFORM=NO&punit=<%=P1%>&from_dt=<%=P2%>&to_dt=<%=P3%>&crop_id=<%=P4%>&variety_id=<%=P5%>&class_code=<%=P6%>','Select','scrollbars=1,height=810,width=1100,top=30,left=60');
    }


    }




    ReplyDelete
  2. Can you try to make destformat=PDF instead of HTML and let me know if it solved .

    ReplyDelete
    Replies
    1. Thanks for responding !
      Yeah i did that when report get generated it by default get opened in Adobe Reader with scrolls, its fine. actually that pdf report is required in Excel format, so that if necessary changes can be done in the report. So I thought to make use of inbuilt functionality. Plz reply.

      Delete
  3. Actually I explained it in one of my post how to display report in excel sheet.But I can again explain it, use desformat=spreadsheet instead of pdf.It will atumatically open the report in excel sheet.

    ReplyDelete
    Replies
    1. Ok I am already done with it....after trying each and every possibility I started searching help.....actully...after report gets opened in excel format....it is unable to keep the original format of pdf....instead formatting gets disturbed....and when reports have 40 columns and 500 pages it will be highly tedious job to re-format it..... Then what i did...get the report output in html....but with html report when opens in new window there are no scrollbars....kindly help..in this matters....

      Delete
    2. OK I checked it .Save the report as .rdf and then run the report with desformat='html' . It works, it shows the scroll bars as well as the formatting is correct.

      Delete
    3. Ok You might have run the report form Developer suite....It works well because it first asks where to save...and when saved .htm file is opened it shows scrolls also. In our case we had an web based application running on Oracle 10AS. we are calling .rdf reports and Oracle Report Server executing the rdf to pdf reports. Parameters from JSP page were sent to a intermediate file where we add path and pass on the report parameters to report server. You can check this in the above code also. A new window gets open with the output in html/pdf/excel format. Browser is Internet explorer. Plz reply.

      Delete
    4. check this:-

      Sending a report output to WebDAV (any WebDAV server or OracleAS Portal WebDAV)

      rwclient server=myrepserv report=test.rdf userid=scott/tiger@mydb
      desformat=htmlcss DESTYPE=webdav
      DESNAME="http://myusername:mypassword@mywebdavserv.com/mydir/test.html"

      here desformat=htmlcss instead of html

      Delete
    5. thanks ! I had already tried all of the tit-bits but problem not solved. I hope u got the problem understood....kindly check if some other option available.....

      Delete
  4. Hi,

    We have an application running on Oracle 10 AS and DB-Oracle 11G, now we want to move to Open source technology for the same new application. if you can suggest the followings:

    1) Which technology/platform/AS/DB can be used.
    2) How can we migrate our rdf reports in OST.
    3) What will be the Hardware to look upon.

    ReplyDelete
  5. I am callin reports through Oracle form version is 11g. i want to save the reports pdf in my D/E/C drive after pressing the button..it happens when i tried in form builder(local server).but pdf is not saving when i run in application sever..

    ReplyDelete