Home » Other » Client Tools » Edit HTML REPORTS
Edit HTML REPORTS [message #317595] Fri, 02 May 2008 02:24 Go to next message
sdhanuka
Messages: 173
Registered: March 2008
Senior Member
Hey

I am using oracle 9i.

I am creating html reports using

set markup html on


When this page is created it generates a <br> tag after every line on the page. I want to disable that because my javascripts do not work when <br> is embedded on the WEBPAGE.

How to do so...?

Thanks
Re: Edit HTML REPORTS [message #317604 is a reply to message #317595] Fri, 02 May 2008 03:01 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
There is no <br> tag in the result I have, can you post an example of what you did, just few lines.

Regards
Michel
Re: Edit HTML REPORTS [message #317610 is a reply to message #317604] Fri, 02 May 2008 03:17 Go to previous messageGo to next message
sdhanuka
Messages: 173
Registered: March 2008
Senior Member
Ok i will do it

SQL PLUS CODE THAT GENERATES HTML PAGES WITH JAVA SCRIPT

set arraysize 1 
set heading on
set feedback off 
set verify off
set linesize 150
set pages 9999
set term off
set echo off 
set markup html on entmap off preformat off 
spool c:\sql\why.html
prompt <HTML>
prompt <HEAD>
prompt <TITLE>Test HTML Output </TITLE>
prompt <STYLE TYPE="text/css">
prompt <!-- TD {font-size: 8pt; font-family: arial; font-style: normal} -->
prompt </STYLE>
prompt <script type="text/javascript">
prompt function disp_alert()
prompt {
prompt alert("SAMPLE JAVASCRIPT");
prompt }
prompt </script>
prompt </HEAD>
prompt <BODY>
prompt <TABLE BORDER=1>
select * from emp;
prompt </TABLE>
prompt <input type="button" onclick="disp_alert()" value="Sample Java Script" />
prompt </BODY>
prompt </HTML>

spool off;


code of the webpage created:

And the code of the webpage is
<HTML>
<br>
<HEAD>
<br>
<TITLE>Test HTML Output </TITLE>
<br>
<STYLE TYPE="text/css">
<br>
<!-- TD {font-size: 8pt; font-family: arial; font-style: normal} -->
<br>
</STYLE>
<br>
<script type="text/javascript">
<br>
function disp_alert()
<br>
{
<br>
alert("SAMPLE JAVASCRIPT")
<br>
}
<br>
</script>
<br>
</HEAD>
<br>
<BODY>
<br>
<TABLE BORDER=1>
<br>
<p>
<table border='1' width='90%' align='center' summary='Script output'>
<tr>
<th scope="col">
EMPNO
</th>
.
.
.
.
.
<td align="right">
     10500
</td>
<td align="right">
      3000
</td>
<td align="right">
        20
</td>
</tr>
</table>
<p>
</TABLE>
<br>
<input type="button" onclick="disp_alert()" value="Sample Java Script" />
<br>
</BODY>
<br>
</HTML>
<br>




Re: Edit HTML REPORTS [message #317615 is a reply to message #317610] Fri, 02 May 2008 03:30 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Move your "set markup html on" just before the query, after the "prompt", and put a "set markup off" just after the query.
Or use the "title" clause of "set markup" to put all your code in the set statement itself.
See an example at:
SQL*PlusŪ User's Guide and Reference
Chapter 7 Generating HTML Reports from SQL*Plus
Section Creating Reports using Command-line SQL*Plus

Regards
Michel
Re: Edit HTML REPORTS [message #317617 is a reply to message #317615] Fri, 02 May 2008 03:38 Go to previous messageGo to next message
sdhanuka
Messages: 173
Registered: March 2008
Senior Member
hey no luck with doing the first solution setting markup before the query

set arraysize 1 
set heading on
set feedback off 
set verify off
set linesize 150
set pages 9999
set term off
set echo off 
spool c:\sql\why.html
prompt <HTML>
prompt <HEAD>
prompt <TITLE>Test HTML Output </TITLE>
prompt <STYLE TYPE="text/css">
prompt <!-- TD {font-size: 8pt; font-family: arial; font-style: normal} -->
prompt </STYLE>
prompt <script type="text/javascript">
prompt function disp_alert()
prompt {
prompt alert("SAMPLE JAVASCRIPT");
prompt }
prompt </script>
prompt </HEAD>
prompt <BODY>
prompt <TABLE BORDER=1>
set markup html on entmap off 
select * from emp;
set markup html off
prompt </TABLE>
prompt <input type="button" onclick="disp_alert()" value="Sample Java Script" />
prompt </BODY>
prompt </HTML>

spool off;


Output:

SQL> start c:\sql\new.html
SP2-0734: unknown command beginning "<title> HI..." - rest of line ignored.
SP2-0734: unknown command beginning "EMPNO ENAM..." - rest of line ignored.
SP2-0042: unknown command "DEPTNO" - rest of line ignored.
SP2-0226: Invalid line number
SP2-0226: Invalid line number
SP2-0226: Invalid line number
SP2-0734: unknown command beginning "EMPNO ENAM..." - rest of line ignored.
SP2-0042: unknown command "DEPTNO" - rest of line ignored.
SP2-0226: Invalid line number
SP2-0226: Invalid line number
SP2-0226: Invalid line number
SP2-0734: unknown command beginning "EMPNO ENAM..." - rest of line ignored.
SP2-0042: unknown command "DEPTNO" - rest of line ignored.
SP2-0226: Invalid line number
SP2-0226: Invalid line number
SP2-0226: Invalid line number
SQL> start c:\sql\new.html
SP2-0734: unknown command beginning "<title> HI..." - rest of line ignored.
SP2-0734: unknown command beginning "EMPNO ENAM..." - rest of line ignored.
SP2-0042: unknown command "DEPTNO" - rest of line ignored.
SP2-0226: Invalid line number
SP2-0226: Invalid line number
SP2-0226: Invalid line number
SP2-0734: unknown command beginning "EMPNO ENAM..." - rest of line ignored.
SP2-0042: unknown command "DEPTNO" - rest of line ignored.
SP2-0226: Invalid line number
SP2-0226: Invalid line number
SP2-0226: Invalid line number
SP2-0734: unknown command beginning "EMPNO ENAM..." - rest of line ignored.
SP2-0042: unknown command "DEPTNO" - rest of line ignored.
 10* SMITH      CLERK           7902 17-DEC-80        800
SP2-0226: Invalid line number
 10* SMITH      CLERK           7902 17-DEC-80        800
SQL>


I have read that document over 5-6 times it has not helped me achieve what i want.

About the title clause I did not understand what you want me to do.

Help please..
Re: Edit HTML REPORTS [message #317621 is a reply to message #317617] Fri, 02 May 2008 03:47 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
start c:\sql\new.html

You executed the previously generated HTML page not the SQL script.

Regards
Michel
Re: Edit HTML REPORTS [message #317626 is a reply to message #317621] Fri, 02 May 2008 03:55 Go to previous message
sdhanuka
Messages: 173
Registered: March 2008
Senior Member
Oh Oh Embarassed ...

Thanks...It worked .......YES!
Previous Topic: visual query builder needed
Next Topic: With clause gives strange error
Goto Forum:
  


Current Time: Sun Dec 08 05:56:13 CST 2024