Overblog Tous les blogs Top blogs Technologie & Science Tous les blogs Technologie & Science
Editer l'article Suivre ce blog Administration + Créer mon blog
MENU

Articles Oracle Forms, PL/SQL, Java, J2EE

Publicité

Oracle Forms: How to display a HTML content without creating any file

For a checking out purpose, I would be able to display the HTML content of a Text Item in the default Internet Browser window.
My first thought was to create a HTML file on the local machine then call it with the Webutil functions:

  • client_text_io() functions to create the local file
  • client_host() function to launch the file into the Internet Browser


That does the job, but requires that Webutil is configured.
So I thought about eliminating all the Webutil stuff by concentrating all the logical within a single Web.Show_Document() call:


PROCEDURE HTML_Display
IS
   LC$Output Varchar2(32000);
   LC$Texte  Varchar2(32000) := Name_In(:system.trigger_item) ;
Begin
   -- HTML output that needs no file generation ! --
   LC$Output := 'javascript:document.write("' ;
   LC$Output := LC$Output || '<html><body><FONT face=sans-serif size=3>' ;
   LC$Output := LC$Output || replace( LC$Texte, CHR(10), '<br>') ;
   LC$Output := LC$Output || '</body></html>");' ;
   web.show_document(LC$Output,'_blank');
End;

Publicité
Retour à l'accueil
Partager cet article
Repost0
Pour être informé des derniers articles, inscrivez vous :
Commenter cet article
R
Hi Francois,<br /> <br /> You posted:<br /> <br /> Works fine with IE 6.0.2800 SP1 and also with Firefox 2.0<br /> Francois <br /> <br /> How come? i'm also using IE6 but service pack2 but not working only in FF. you mean it's only working with service pack1 IE?
Répondre
M
Doesnt work in IE..  I tried it and found this Oracle forum posthttp://forums.oracle.com/forums/thread.jspa?messageID=1161101?The problem is actually caused as a result of recent Microsoft Security changes which prevents Forms from passing URLs to the browser which contain the prefix "javascript". In short, you can not longer use the "javascript" protocol in Forms with WEB_SHOW.DOCUMENT. This is not a bug, but rather a change in security.
Répondre
F
Works fine with IE 6.0.2800 SP1 and also with Firefox 2.0Francois
P
Nice tip!<br /> <br /> Patrick
Répondre