Integrate Repexpert into your application

In addition to run RepExpert manually, you may want to run RepExpert from your application automatically.

RepExpert provide 2 interfaces, through which your application can call RepExpert to open specified report.

If you are using web-based Oracle forms and Reports

 

Maybe you are using web-based Forms and Reports applications, your Oracle Forms call the Oracle Report Server, generate the report output, and then launch browser (such as IE) to display the report.

This model is named Browser/Server Architecture in some articles.

Because the IE is not professional tool for Oracle Reports, you can launch RepExpert instead of IE to display/print your reports.

How it works

The RepExpert contains an add-on for IE named RepExpert IEHelper, you can see this add-on in IE.

Repexpert IEHelper will monitor the navigation activity of IE (Internet Explorer), and analyze the URL and determine whether the URL is link to a file of report output.

If the URL contains all pre-defined keywords, the Repexpert IEHelper will execute RepExpert and it will download the file and open it instead of IE.

Configure RepExpert to be launched by URL
There are 2 ways to configure RepExpert to be launched by URL.

No. 1

1. Execute RepExpert, Click Settings Menu -> URL Keywords Setup -> Group #1/2/3/4

2. Fill in your keywords.

The keyword is part of the URL, it can be used to identify the URL to oracle report output.

To disable one group of keywords, please clear all keywords and click OK.

To learn more on "Output to printer directly" check box, please see How to output report to printer directly without displaying.

3. Click OK.

Please view this live demo : How to setup keywords of URL

 

No. 2

The RepExpert contains a built-in keyword: &callrepexpert=yes. So every URL contains this keyword will be used to invoke RepExpert.

So, please just append &callrepexpert=yes to your URL, and then the URL can launch RepExpert.

See the sample below:

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';
v_url := v_url || '&userid=scott/tiger@test&destype=cache&desformat=HTMLCSS';
v_url := v_url || '&callrepexpert=yes';
web.show_document(v_url,'_blank');
end;

 

Troubleshooting

If the RepExpert is not launched as you want, you should first check the keyword settings.

The following link contains built-in keyword "&callrepexpert=yes", please click it.

http://www.lv2000.com/examples/getreport.php?file=00001.htm&mime=text/html&callrepexpert=yes

If you want to know whether Repexpert IEHelper works properly, please download the tool from http://www.lv2000.com/products/IeHelperSts.zip

The file is helpful for you diagnosing the error.

A simple JSP program for download files from web-server

 

You can use RUN_REPORT_OBJECT(v_report_id,Pl_id) built-in to output oracle report to cache directory, then use a JSP program to download the file.

There is a sample below.

<%@ page import="java.io.*"%><%
// This is simple code for downloading a file from HTTP server 
// Usage: http://server-name:port/getreport.jsp?filename=[file_name]
// Author: Lion Van
// Email: support@lv2000.com
String cachedir="c:\\reports\\";//TODO: Replace c:\reports\ with the exact directory 
// where your report output is stored.
// e.g. /usr/oracle/9ias/6iserver/reports60/server/cache/

String sFileName=request.getParameter("filename");
response.setHeader("Content-disposition","inline;filename="+sFileName);

BufferedOutputStream bos = null;
BufferedInputStream bis = null;
try{
bos = new BufferedOutputStream(response.getOutputStream());
bis = new BufferedInputStream(new FileInputStream(cachedir+sFileName) );
byte buff[]=new byte[2042];
int bytesread;
while ((bytesread=bis.read(buff,0,buff.length))!=-1)
bos.write(buff,0,bytesread);
} catch(final IOException e) { 
System.out.println ( "IOException." );
throw e;
}catch(Exception e){System.out.println(e);}
finally{
if (bis!=null)
bis.close();
}
%>

 

If your Oracle Report is running on client computer

 

Maybe the Oracle Report is installed and running on the client computer, it connect to database and output report to local files ystem.

This model is named Client/Server Architecture in some articles.

How to configure

You can use RUN_REPORT_OBJECT(v_report_id,Pl_id) built-in to output oracle report to cache directory, and then use HOST built-in to run RepExpert.

For example, the Oracle Report Application output report to c:\cache\1.htm

The RepExpert is installed in C:\Program Files\RepExpert folder.

The Host command looks like:

HOST('CMD /C START C:\Program Files\RepExpert\RepExpert.exe c:\cache\1.htm');