Rep2excel provides 2 user interfaces
Call Rep2excel through command line |
Rep2excel support command line interface, you can call it through dos prompt, you can also call it by HOST built-in in Oracle Forms.
The output of Rep2excel looks like:
For example, the file d:\working\rep\emp_list2.htm will be converted, see below
D:\working\Rep2excel111\Release>rep2excel
-i:d:\working\rep\emp_list2.htm
Input file : d:\working\rep\emp_list2.htm
Output file: d:\working\rep\emp_list2.xls
..................................................
..................................................
Finish succefully!
Deploy Rep2excel in web server, call it through http link |
Rep2excel supports CGI interface, you can install rep2excel on a web-server which supports CGI and invoke this program using WEB.SHOW_DOCUMENT built-in.[Demo Online]
First, you should install rep2excel as CGI service. See here.
Please fill the full location of an oracle report output file into File Path box, then click Submit button.
The location of the file may be a URL, e.g.
IE will show you excel output
Integrate Rep2excel into your application |
Index
Sample code
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?';
v_url := v_url || '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?';
v_url := v_url || 'server=rep_svr&report=test_report.rdf&userid=scott/tiger@test&destype=cache&desformat=HTMLCSS';
--Modify begin
v_url:=encode_url(v_url);--This step is optional
web.show_document('http://web-server:7777/cgi-bin/rep2excel.exe?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
In an encoded string, blanks are changed into + and special
characters are made by the % symbol, followed by the hexadecimal digits of the
ASCII code.
For example the character "-" is substituted by the string
"%2d".
Note: The URL encoding is optional, actually Rep2excel can detect the correct URL.
The sample code of function encode_url is
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://localhost:7777/cgi-bin/rep2excel.exe?filepath=" +
escape(URL);
URL = "http://" + WEBHOST + colon + WEBPORT + "/dev60cgi/rep2excel.exe?filepath="
+ escape(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