j-Rep2excel User's Guide

Index

Installing JRE

Rep2excel Manager

Installing j-Rep2excel

Integrate Rep2excel into your application

 

Installing Java Runtime Environment (JRE)

 

Switch to bash (For non-Windows user only)

The script/document provided by the vendor Lion Soft assume that you are using bash. If the script does not work, please verify that you are using bash, not sh(Bourne Shell) or other shell.

To switch to bash, just run

bash

Install JRE on the server

j-Rep2excel Server is 100% pure java. You should have Java Runtime Environment (JRE) installed on your server before you install j-Rep2excel Server.
If you have installed the JRE or JDK 1.5 or above, please ignore this section.

Download Free JRE from Sun Microsystems

Optional URL: http://www.java.com/en/download/manual.jsp

Once you download the JRE, please install it on the server.

Testing Java Runtime Environment

You’ll want to confirm that your system is configured properly for Sun’s JRE.

Check that the JRE is properly installed by running the following command from a terminal.

java -version

You should get similar output

java version "1.5.0_14"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode, sharing)

Install JRE on ubuntu linux, just run this command line:

sudo apt-get install sun-java6-jre

Install JRE on centOS linux (x86), just run this command lines:

wget http://gtd.lv2000.com/products/jre-6u24-linux-i586.bin
chmod a+x jre-6u24-linux-i586.bin
./jre-6u24-linux-i586.bin
mv jre1.6.0_24 /usr/local/jre
alternatives --install /usr/bin/java java /usr/local/jre/bin/java 1
java -version

Install JRE on centOS linux (x64), just run this command lines:

wget http://gtd.lv2000.com/products/jre-6u24-linux-i586.bin
chmod a+x jre-6u24-linux-i586.bin
./jre-6u24-linux-i586.bin
mv jre1.6.0_24 /usr/local/jre
alternatives --install /usr/bin/java java /usr/local/jre/bin/java 1
java -version

Install JRE for j-rep2excel only

If you have download the j-Rep2excel with JRE, you can install the downloaded JRE easily.

1) unzip to j-rep2excel folder.

2) run chmod a+x *.sh

3) run ./install-jre.sh

Installing j-Rep2excel Server

 

First make sure that the JRE is installed. If you download the win-j-rep2excel.zip, the JRE is included in the installation pack.

1. Download j-Rep2excel installation package. It will be a ZIP file.
2. Extract the archive to the desired install directory. The directory is identified by ${JR2X_HOME} in this document.

2.1 Recommended directory:

TIPS: Please install unzip utility first.

Install Unzip on ubuntu linux, just run this command line:

sudo apt-get install zip unzip

Install Unzip on centOS linux, just run this command lines:

yum install unzip

2.2 Layout of the subdirectories

Name Type Description
tomcat-embed Dir Tomcat server
Rep2excel Dir Stores j-Rep2excel programs
docs Dir Documents
win-service Dir Programs and docs on running j-Rep2excel as windows service
linux-daemon Dir Scripts and docs on running j-Rep2excel as linux daemon
shutdown.bat
startup.bat
  Scripts of starting up and shutting down j-Rep2excel.(For Windows)
shutdown.sh
startup.sh
  Scripts of starting up and shutting down j-Rep2excel.(For Linux)
rep2excel.properities.sample   Sample of configuration file

 

3. Create directory for configuration files of j-Rep2excel

Please create directory for the configuration files of the server. Make sure that the directory is writable for user that starts GTD report server.

Recommended directory:

This directory is named Configuration Directory in this document

4. Create directory for log files.

Please create directory for the log files. Make sure the directory is writable for user that starts GTD report server.

Recommended directory:

5. Create the configuration file rep2excel.properities, configure the server

The j-Rep2excel requires the following information when it is startting up.

  1. The port the server will listenning to
  2. The directory created at step 3. The server will save configuration files to the directory.
  3. The path of the log files. You may want to server save log files on the directory created st step 4.

By default the j-Rep2excel will load the configuration file from the path below before starting up the server.

${JR2X_HOME}/rep2excel.properities

You will see a file named rep2excel.properities.sample in ${JR2X_HOME}. [Learn More at 2.2]

Please edit the file and then rename the file to rep2excel.properities.

Sample file for Linux:

port=8003
configDir=/usr/local/rep2excel-data/config
logFile=/usr/local/rep2excel-data/log/rep2excel.log

Sample file for Windows: ( Note: If you use backslashes, you must double them )

port=8003
configDir=c:/rep2excel/config
logFile=c:\\rep2excel\\log\\rep2excel.log

The list below is a sample of installiing j-Rep2excel on linux.

[root@li107-23 local]# pwd
/usr/local
[root@li107-23 local]# unzip rep2excel.zip
...........
[root@li107-23 local]# mkdir rep2excel-data
[root@li107-23 local]# cd rep2excel-data/
[root@li107-23 rep2excel-data]# mkdir config
[root@li107-23 rep2excel-data]# mkdir log
[root@li107-23 rep2excel-data]# cd log
[root@li107-23 log]# echo "" > rep2excel.log
[root@li107-23 log]# cd ..
[root@li107-23 rep2excel-data]# cd ..
[root@li107-23 local]# pwd
/usr/local
[root@li107-23 local]# cd rep2excel
[root@li107-23 rep2excel]# chmod a+x *.sh
[root@li107-23 rep2excel]# echo "port=8003" > rep2excel.properities
[root@li107-23 rep2excel]# echo "configDir=/usr/local/rep2excel-data/config" >> rep2excel.properities
[root@li107-23 rep2excel]# echo "logFile=/usr/local/rep2excel-data/log/rep2excel.log" >> rep2excel.properities
[root@li107-23 rep2excel]# cat rep2excel.properities
port=8003
configDir=/usr/local/rep2excel-data/config
logFile=/usr/local/rep2excel-data/log/rep2excel.log
[root@li107-23 rep2excel]# ./start.sh

 

Testing j-Rep2excel in console mode

 

Testing is best done from a command prompt in a console window (or “DOS window”). In this way you can have the server display status messages in the window where they are easy to see. If something is wrong with your configuration, these messages make it easier for you to identify and fix any problems.

Start j-Rep2excel from command line.

1. Open console window or terminal

* If j-Rep2excel is installed on Windows OS, you can open a new CMD prompt by choosing START, RUN, type cmd, click OK.

2. Change work directory to ${JR2X_HOME}

cd ${JR2X_HOME}

3. Run shartup.bat (For Windows) or shartup.sh (For Linux)

c:\Program Files\rep2excel>startup.bat

linux:/usr/local/rep2excel # chmod a+x *.sh
linux:/usr/local/rep2excel # ./startup.sh

Tip: Please mush run chmod before running startup.sh

When the server finishes its startup sequence, you should see something like this, which indicates that the server is ready to service client connections.

***********************
*
* Server Started
*
***********************

Visit j-Rep2excel via browser.

Please open the browser (IE/Firefox etc), and then visit j-Rep2excel. The URL looks like:

http://localhost:<port>/

Port is specified in ${JR2X_HOME}/rep2excel.properities, default value: 8003

Now you can see the index page of j-Rep2excel.

Stopping j-Rep2excel

 

1. You can stop the j-Rep2excel by executing this command:

c:\Program Files\rep2excel>shutdown.bat

linux:/usr/local/rep2excel # ./shutdown.sh

Rep2excel Manager

Charset

 

There are 3 ways to tell j-Rep2excel to parse the input html file using correct charset.

1) You can set the charset in your html file. This sample is for Arabic customers:

<html>
<head>
<META http-equiv=Content-Type content="text/html; charset=windows-1256">
</head>
<body dir=RTL bgcolor="#ffffff">

2) Sepecify the charset by URL or select box. For example:

http://localhost:8003/getexcel.do?filepath=D:\working\rep\APPLICANTS.htm&charset=windows-1256

sample

3) You can also set default charset for all input html files.

 Please go to this page http://<server-name>:<port>/charset.do (e.g. http://localhost:8003/charset.do) and setup default value of charset that is used for read the html file.

charset

 

Integrate Rep2excel into your application

Call rep2excel from oracle forms from web

 

You can call rep2excel from oracle forms using web.show_document built-in.
If you are now using web.show_document to open a HTML file generated by oracle report server, you can invoke rep2excel to get excel easily.

The following sample code demonstrates how to change your code to work with rep2excel.
Your original code:

declare
v_url varchar2(1000);
begin
v_url := 'http://SVR_NAME:7777/dev60cgi/rwcgi60?server=rep_svr&report=test_report.rdf&userid=scott/tiger@test&destype=cache&desformat=HTMLCSS';
web.show_document(v_url,'_blank');
end;

Please change the first parameter of web.show_document, like this

declare
v_url varchar2(1000);
begin
v_url := 'http://SVR_NAME:7777/dev60cgi/rwcgi60?server=rep_svr&report=test_report.rdf&userid=scott/tiger@test&destype=cache&desformat=HTMLCSS';
--Modify begin
web.show_document('http://web-server:8003/getexcel.do?filepath='||v_url||'&job=getexcel','_blank');
--Modify end
end;

There is a example included in rep2excel installation patch. You can download the latest version
from http://www.lv2000.com/examples/run_rep_example.zip

Configure OHS (Oracle HTTP Server) to support Java-Rep2excel

 

You can call rep2excel from oracle forms using web.show_document built-in.
If you have deployed OHS, and you call Oracle Forms and Reports via OHS, you don't need to specify the server name of java-Rep2excel and oracle reports server in your pl/sql code.

For example, in the pl/sql code below, you need to specify 2 server's name.

web.show_document('http://rep2excel-server:8003/getexcel.do?filepath=http://REP_SVR_NAME:7777/dev60cgi/rwcgi60.....','_blank');

If you install the OHS, and then configure OHS work as proxy of Java-Rep2excel, Forms Server and Reports Server, you don't need to specify the host name in pl/sql code. For example:

web.show_document('/rep2excel/getexcel.do?filepath=/reports/rwservlet/getjobid.....','_blank');

Overview

If you have OHS installed. You will run Oracle Forms via this link:

http://<ohs-server-name>:8888/forms/frmservlet?....

The reports will be downloaded from this link:

http://<ohs-server-name>:8888/reports/rwservlet?...

And then Java-Rep2excel link

http://<ohs-server-name>:8888/rep2excel/getexcel.do

 

Step by steps guide

Step 1:

Edit ${JAVA_REP2EXCEL_HOME}/rep2excel.properities, specify the context, for example:

context=rep2excel

Restart the java-Rep2excel server, check whether this link works:

http://localhost:8003/rep2excel/index.do

Step 2:

Edit ${Oracle_instance)\config\OHS\${OHS_name)\httpd.conf, for example C:\Oracle\Middleware\asinst_1\config\OHS\ohs1\httpd.conf, append the following lines.

<Proxy /rep2excel>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /rep2excel http://localhost:8003/rep2excel
ProxyPassReverse /rep2excel http://localhost:8003/rep2excel
ProxyPreserveHost on

Note: You can install java-Rep2excel on same computer with OHS, you can also install it on other server. For example:

http://10.63.217.188:8003/rep2excel

Now, please check whether this link works.

http://ohs-server-name:8888/rep2excel/index.do

Step 3:

The following sample code demonstrates how to change your code to work with rep2excel.
Your original code:

WEB.SHOW_DOCUMENT ('/reports/rwservlet/getjobid' || vjob_id ||'?server='||vc_reportserver, '_blank');

Please change your code like this:

WEB.SHOW_DOCUMENT ('/rep2excel/getexcel.do?filepath=' || '/reports/rwservlet/getjobid' || vjob_id ||'?server='||vc_reportserver, '_blank');

Enjoy!

Call rep2excel from web page

If you call oracle report server from a html form, you can also call rep2excel to convert the oracle report output. and you will have to do some coding, see the sample code:

function runReport()
{
// semi-constants for JavaScript 8-)
var cgiexe = "rwcgi60.exe";
var slash = "/";
var colon = ":";
var qmark = "?";
var paramsep = "&";
/**
** URL parameter values
** We should check for nulls, http://, etc. but not for now ...
*/
var WEBHOST = document.REPFORM.WEBHOST.value;
var WEBPORT = document.REPFORM.WEBPORT.value
var SERVER= document.REPFORM.SERVER.value;
var REPORT = document.REPFORM.REPORT.value;
var USERID= document.REPFORM.USERID.value;
var dtlist = document.REPFORM.DESTYPE;
var DESTYPE = dtlist.options[dtlist.selectedIndex].value;
var dflist = document.REPFORM.DESFORMAT;
var DESFORMAT = dflist.options[dflist.selectedIndex].value;
// construct the final URL given the parameters

//Leo Change begin
var URL = "http://" + WEBHOST + colon + WEBPORT + "/dev60cgi/"
+ cgiexe + qmark +
"server=" + SERVER + paramsep +
"report=" + REPORT + paramsep +
"userid=" + USERID + paramsep +
"destype=" + DESTYPE + paramsep ;
if (DESFORMAT == "REP2EXCEL")
{
URL = URL + "desformat=HTML"
URL = "http://server-name:8003/getexcel.do?filepath=" + URL;

if (document.REPFORM.mailto.value != "") //Send excel file
URL = URL + "&mailto=" + document.REPFORM.mailto.value;

}else
{
URL = URL + "desformat=" + DESFORMAT;
}
// If you have any question about this form,
// please do not hesidate to contact support@lv2000.com .
//Leo Change End

runWindow = window.open(URL);
}

For more details, please refer to the example from http://www.lv2000.com/examples/run_rep_example.zip

 

Setup Options for Java virtual machine (JVM)

The j-Rep2excel program is running inside the JVM. So we offer the way for you to customize the parameters for the JVM

For Windows

Click "Server" menu, click "preference" meau button, the "Setting" dialog appears. You can change the JAVA_OPTS inbox in the Java Home tab

For example, you may want to allow J-Rep2excel use more memory, please add option like this: -Xmx1024m

Tips

If you machine is powerful enough, we suggest you to use Java 8, and allow J-Rep2excel to allocate more memory.

For Linux

Please run this command: ./rep2excel -C

You can also just edit this file: JAVA_OPTS if you want to do advanced configuration