Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

web.show_document

255383Jun 30 2004 — edited Feb 6 2006
I was trying to execute the web.show_document using javascript as part of the URL as follows :
WEB.SHOW_DOCUMENT ('javascript:window.open ("URL"
,"",fullscreen=no,titlebar=no
,location=no,toolbar=no
,menubar=no,status=no")','_blank');

IS it possible to do so? if yes, why didn't this work. It compiled fine but resulted in "Page can Not be Displayed" message in the browser

Comments

InoL
web.show_document needs a URL as parameter. 'javascript:window.open' is not a URL.
Hi,

Ino is correct as far as releases before Forms9i are concerned. In web.show_document() of Forms9i onwards javascript calls are supported. However, I wouldn't try it the way you do because it doesn't make sense to open a new windoe just to open a second. Basically what you should do is to create a Javascript function that is contained on the Forms Applet page.

function startNewWindow(URL){

window.open(URL,....);

}

From Forms9i or later you call

web.show_document('javascript:startNewWindow("http://...")','_self');

Frank

a simple testcase would be


web.show_document('javascript:alert("hello world"','_self');
qtpham
Hi Frank,

I try what you said in Forms9i, but no thing happens ???

François Degrelle
I have the following (Forms9i)

Web.show_document('javascript:window.close()', '_self') ;

in a POST-FORM trigger and it works fine.
Hi,

there also was a syntax error in my "hello world" example.

web.show_document('javascript:alert("hello world");','_self');

Frank
qtpham
Hi,

Yes, it work with the window.close, but when I put the thing as Frank recommended:

web.show_document('javascript:alert("hello world"','_self');

Nothing happened !

And when I tested with Forms9i by adding the following codes in the formsweb.cfg:

HTMLbeforeForm=<script language="JavaScript">function startNewWindow(URL){window.open(URL,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbarscrollbars=1,resizable=1,width=1000,height=750,top=2,left=2');}</script>

In my form, I have:

Web.show_document('javascript:startNewWindow("http://server:7778/reports/rwservlet/showjobs?server=repserver")','_self') ;

But nothing happened ???

Pls advice.
qtpham
Hi,

Finally I have found that in Forms9i, the javascript window.open cannot run with the parapmeters "toolbar=0,location=0,directories=0,status=0" or any of them. Is this a bug of Forms9i ???

In my form, I can call the web.show_document as:

web.show_document('javascript:window.open("/reports/rwservlet/showjobs?server=repserver","Title");','_self');

But, there will have error if I call:

web.show_document('javascript:window.open("/reports/rwservlet/showjobs?server=repserver","toolbar=0");','_self');

Frank, can you please check ?

Regards.
InoL
This works for me as the when-button-pressed trigger:
begin
  WEB.SHOW_DOCUMENT ('javascript:window.open("http://www.google.com","","fullscreen=no,titlebar=no,location=no,toolbar=no,menubar=no,status=no,resizable=yes");self.close()','_blank');
end;
qtpham
Hi Laurensse,

Thanks for your recommend. It works. However when I call my reports from forms9i, the title of the pop-up browser still displays the full URL of the reports. For example

http://report_server:7778/reports/rwservlet/getjobid178?server=repserver

My purpose to use java script in web.show_document is to hide the above URL. It's OK to hide status bar, location etc. But the title of the pop-up browser still displays the full URL.

Part of my codes to call reports from forms are:

v_url := 'javascript:window.open("'||'/reports/rwservlet/getjobid'||vjob_id||'?server=' || v_prn_server||
'","Reports","fullscreen=no,titlebar=no,location=no,toolbar=no,menubar=no,status=no,resizable=yes");self.close()' ;

WEB.SHOW_DOCUMENT (v_url, '_blank');

Any ideal how to change the title of the pop-up browser ?

Thanks,


Pham
InoL
You can change the window title of an HTML report. In the Report Builder set the Before Report Value to include a title, e.g.:
<html>
<title>My Report</title>
<body dir=&Direction bgcolor="#ffffff">
However, this does not work for PDF :-( I don't know how to do it for PDF.

By the way, if you output to HTML you should include scrollbars=yes in the window.open, otherwise you won't be able to scroll the output.
qtpham
Hi,

Unfortunately our reports are in PDF format !

Any ideal how to archive this with PDF reports ?

Pham
InoL
Something that may come close to what you want is this: generate the report to file instead of the reports cache and open the file in the browser. You have to define a directory and alias in the httpd.conf file where you store the reports.
When you open the file you still see the full url in the title, but a least you see something like 'http://myserver:7778/docs/myreport.pdf'

Include the following in your code:
  -- Path to store the reports (for testing in 9iDS)
  v_docpath   := 'c:\ora9ids\j2ee\home\default-web-app\docs\';
  v_doc       := 'myfile.pdf';
  v_docurl    := '/docs/';
  ...  
  set_report_object_property(repid,report_destype,file);
  set_report_object_property(repid,report_desname, v_docpath||v_doc); 
  ...
  v_url := v_docurl||v_doc;
  web.show_document('javascript:window.open("'||v_url||'","","fullscreen=no,...");self.close()','_blank');
qtpham
Hi Laurensse,

Actually I also want to hide such URL. Let I tell you our situation. We don't want to use SSO of Forms/Reports9i for some reasons, which come from our S/W vendor. Thus, we have found that anyone can see our reports if they know the url, for example

http://report_server/reprots/rwservlet/getjobid178?server=repserver

Of course the chance to know the jobid is very low, but our auditor didn't agree with this.

All we want is to hide such url as much as possible when calling a report. Part of this can be archived by using JavaScript as you have mentioned. Unfortunately the title of browser still displays the url.

Any ideal how to archive this ?

Pham
InoL
If security is your objective, then you can also secure reports without SSO. See, for instance, http://otn.oracle.com/products/reports/htdocs/getstart/whitepapers/securing9i.pdf. Basically, you use authentication and an authentication cookie.

You can also keep the cache very small, so the change of calling a report from the cache is very small. Control the cache size in the <repserver>.conf file, e.g.
<property name="maxCacheFileNumber" value="10"/>

Another option may be to run reports with the EXPIRATION parameter.
483856
hi.

finally, can you summarize what settings are required in IE options
and formsweb.cfg or any other place to make this javascript business work.

regards
because i am still stucked.
regards.
1 - 15
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 6 2006
Added on Jun 30 2004
15 comments
17,678 views