Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Links Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS SQL
Oracle
DB2
MS Access
MySQL
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» Sitemap
Free Newsletters:
DatabaseDaily  
News Via RSS Feed


follow us on Twitter
Database Journal |DBA Support |SQLCourse |SQLCourse2
 

Featured Database Articles

Oracle

Posted Sep 23, 2004

Installation Cookbooks: Deploying Reports on the Web - Page 2

By Steve Callan

Naming the report server and passing it to a form

This part of the setup is very simple, but I have seen it stump a lot of people. One way to pass the name of the report server is to hard code it in the parent menu-type form I discussed in the previous article. Hard coding is generally bad, but at least it's contained in one place (the calling form). Another way is to pass in the report server name via the URL you use to call your menu form in the first place. You can use the "otherparams" line in the formsweb.cfg file. Yes, you are hard coding the name of the report server, but at least now you're using a configuration file - but that's what they're for, so go ahead and use it.

Tip: I have seen Forms fail to pass global variables. If you are using a global to pass the report server name into the report-calling form, and the global fails to pass in, you'll see errors that don't look anything at all related to not having a report server name.

Which report server to use?

Let's assume you just installed Application Server, and your server's host name is prod. If you navigate to the ORACLE_HOME/reports/conf directory, you will see a file named rep_prod.conf. Copy that file and name it prod.conf. Technically, there is no need to copy the file, as Application Server will create it for you the first time you use the in-process report server, but you are going to do it ahead of time so it can be configured prior to first use.

Open the prod.conf file and what do you see? Eeewww! It's an XML file. It's like Indiana Jones in "Raiders of the Lost Ark," when Indiana opens the cover of the tomb and sees all the snakes ("Why snakes? Why did it have to be snakes?"). If that's how you feel about XML, the good news is you only have to edit one line (around line 15, use sourceDir to tell Application Server where your reports are located). The features and options you can configure via this file are too numerous to be discussed here, but the sourceDir property is required.

Edit the reports.sh (UNIX) file in the ORACLE_HOME/bin directory. Around line 62, add your reports location to the REPORTS_PATH variable.

To start the in-process report server on UNIX, for example, issue the following command at the command prompt (as the owner of the 10g installation):

ias@prod: rwserver.sh server=prod batch=yes &

This starts another process that should be persistent. The report server itself, however, will idle out after 15 minutes of non-use (see idleTimeOut at line 48 if you want to change the default value to something else). If the report server has idled out (gone to sleep, so to speak), the report "waking up" the report server will take a bit longer than normal to appear.

If you use the Enterprise Manager console, you will see references to the rep_prod (rep_name-of-your-server) report server, which is the stand-alone report server. You can ignore it because you're using the in-process report server.

At this point, you should be able to call reports. You can test this via the Application Server "home" page at http://server_name:port_number. Click on Demonstrations and follow the links to reports.







Closing your Forms main menu page

Oracle left out a feature for Web forms, one that will close the browser window for you. Currently, if you just exit the main form, you're left with a dull-colored applet window. Thanks, what do we do with that? Add an "Exit" button to the main form, and add this to a post-form trigger:

web.show_document('close.html','_self');

In the ORACLE_HOME/Apache/Apache/htdocs directory on the Application Server machine, create a file called close.html and add this to the file:


<html> 
   <body onload="closeit()"> 
      <script> 
         function closeit() { 
         win = top; 
         win.opener = top; 
         win.close (); } 
      </script> 
   </body> 
</html>

Clicking on "Exit" will send the browser to the close.html file and the JavaScript "closeit" function will close the browser window.

In closing

That was a lot of material to cover, but it works. The steps shown in these two articles cut through literally thousands of pages of Oracle documentation and boil down the "making Forms and Reports run on the Web" process something you can actually read and understand. Not only does it work, it's simple and easy to follow. If you can get your forms and reports working on the Web, you can turn any client-server Forms and Reports-based application into a Web product.

» See All Articles by Columnist Steve Callan



Oracle Archives

Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 




Latest Forum Threads
Oracle Forum
Topic By Replies Updated
Oracle Data Mining: Classification jan.hasller 0 July 5th, 07:19 AM
Find duplicates - Unique IDs Lava 5 July 2nd, 08:30 AM
no matching unique or primary key rcanter 1 April 25th, 12:32 PM
Update values of one table based on condition of values in other table using Trigger Gladiator 3 February 29th, 06:01 PM