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://www.gtdreport.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://www.gtdreport.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.

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

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