Information for advanced users and administrator

Q:

Some of our reports are very important and we don't want that they can be printed more than once. Therefore we needed a software that can enable us to send the print directly to printer. (If we give preview, user can get multiple prints or save it to some file like pdf, html to get the further prints later).

But the issue with RepExpert is if user opens RepExperts and changes the property 'Output directly to printer' or changes the URL parameters, the output will not go to the printer directly. So it should be restricted (password controlled or so)

One more thing we have many remote locations and if someone uninstalls the RepExpert from his computer, the output will come in the preview instead of printer.

A:

Repexpert can output oracle report to printer directly, Repexpert can also hide the source code of HTML report.

You use web.show_document() bulti-in to show report output. If the link(URL) is caught by browser (e.g. MS-IE), end users can see the source code and save it.

There is a solution to solve this problem.

1) Encrypt the link(URL) in your forms, pass the encrypted URL to a redirect script named 'getreports.jsp' ;

Example :
Suppose you use the following sample code to get reports .
web.show_document( v_url ,'_blank');

You can change to sample code to :

DECLARE
v_url VARCHAR2(700);
v_encrypted_url VARCHAR2(1000);
BEGIN
-- encrypt the url
v_encrypted_url:=encrypt_url(v_url); --A sample . You should change the encryption algorithm .
web.show_document('http://servername:7777/getreports.jsp?filepath='||v_encrypted_url||'&callrepexpert=yes','_blank');
END ;


2) RepExpert catchs the link to 'getreports.jsp', open this link instead of browser.


3) The redirect script program (getreports.jsp) determine whether the request is from RepExpert or not . If the request is send by Repexpert , the program will decrypted the URL, and return the original link. If not, the program will return error message.

Example:
The sample code of getreports.jsp :

<%
// Usage: http://server-name:port/getreports.jsp?filepath=[encrypted_url]
// Author: Lion Van
// Email: support@lv2000.com
try{
String userAgent=request.getHeader("User-Agent");
if (userAgent.compareToIgnoreCase("Repexpert")==0) //Request comes from Repexpert.
{
String filepath=request.getParameter("filepath");
//Decrypt the url
String original_url="";
int ilen=filepath.length();
for (int i=0;i<ilen;i++)
{
char chr=filepath.charAt(i);
if (chr=='1'){chr='0';}
else if (chr=='6'){chr='1';}
else if (chr=='3'){chr='2';}
else if (chr=='8'){chr='3';}
else if (chr=='5'){chr='4';}
else if (chr=='9'){chr='5';}
else if (chr=='4'){chr='6';}
else if (chr=='0'){chr='7';}
else if (chr=='2'){chr='8';}
else if (chr=='7'){chr='9';}
original_url+=chr;
}
// out.println(original_url);
response.sendRedirect(original_url);
}else{
out.println("<p>Hey! you should install RepExpert on your pc</p>");
out.println("If you have installed Repexpert, please contact your network administrator");
//TODO: Record the event
}

}catch(Exception e){System.out.println(e);}
finally{
}
%>

4) Repexpert use the original link to download report output files.

Please click here to download the example.

 

Q:

The RepExpert has to be installed and configured on every pc. Configuration means the url settings and property 'Output directly to printer'. Installation is not the problem for an ordinary user as it is wizard based but configuration should not be done on every pc. Some config file should be copied to the newly installed pc and the things should be done automatically.

A:

About the url settings:

Since version 1.3.3, RepExpert will catch all URLs contains '&callrepexpert=yes' . So if you append the url link to oracle report with '&callrepexpert=yes' . For example :

web.show_document( v_url||'&callrepexpert=yes' ,'_blank');

You do not need to config the kewords of url on every pc that hosting RepExpert.

About the property 'Output directly to printer' .

You can Modify RDF file to print special report directly without delay. See the page below please

http://www.lv2000.com/manual2.htm#2

 
 
FUNCTION encrypt_url(p_url varchar) RETURN varchar IS
v_len number(5);
v_cur number(5);
v_url varchar2(2000):=NULL;
v_chr varchar2(1);
v_num number(3);
v_num_high number(3);
v_num_low number(3);
BEGIN
--TODO : Change the encryption algorithm, you should change the corresponding decryption algorithm
-- in getreports.jsp
v_len := lengthb(p_url);
v_cur:=1;
loop
exit when v_cur>v_len;
v_chr := substrb(p_url,v_cur,1);
v_num := ascii(v_chr);
if v_num=32 then
v_url:=v_url||'+';
elsif (v_num>=65 and v_num<=90) THEN -- A - Z
v_url:=v_url||v_chr;
elsif (v_num>=97 and v_num<=122) THEN -- a - z
v_url:=v_url||v_chr;
ELSIF (v_num>=48 and v_num<=57) THEN -- 0 - 9
--encrypt the number
-- 0 -> 1
-- 1 -> 6
-- 2 -> 3
-- 3 -> 8
-- 4 -> 5
-- 5 -> 9
-- 6 -> 4
-- 7 -> 0
-- 8 -> 2
-- 9 -> 7
IF v_chr IN ('0','2','4') THEN
v_chr := v_chr+1;
ELSIF v_chr IN ('1','3') THEN
v_chr := v_chr+5;
ELSIF v_chr IN ('6','9') THEN
v_chr := v_chr-2;
ELSIF v_chr = '5' THEN
v_chr := '9' ;
ELSIF v_chr = '7' THEN
v_chr := '0' ;
ELSIF v_chr = '8' THEN
v_chr := '2' ;
END IF ;

v_url:=v_url||v_chr;
else
v_url:=v_url||'%';
v_num_high := floor(v_num/16);
if v_num_high>=10 then
v_chr:=chr(v_num_high+55);
else
v_chr:=chr(v_num_high+48);
end if;
v_url:=v_url||v_chr;

v_num_low:=mod(v_num,16);
if v_num_low>=10 then
v_chr:=chr(v_num_low+55);
else
v_chr:=chr(v_num_low+48);
end if;
v_url:=v_url||v_chr;
end if;
v_cur:=v_cur+1;
end loop;
return v_url;
END;