HTML reports [message #312874] |
Thu, 10 April 2008 00:35 |
sdhanuka
Messages: 173 Registered: March 2008
|
Senior Member |
|
|
Hi,
I need to add some javascripts to the HTML reports that we create using the SQL*plus commands :
SET MARKUP HTML ON SPOOL ON.
This generates by default a <body> and an <html> tag. So to modify my report should i use the Preformat command in sql*plus.
[MERGED by LF]
[Updated on: Fri, 11 April 2008 06:08] by Moderator Report message to a moderator
|
|
|
SQL*PLUS HTML reports (help please) [message #312887 is a reply to message #312874] |
Thu, 10 April 2008 01:07 |
sdhanuka
Messages: 173 Registered: March 2008
|
Senior Member |
|
|
Hi,
I need to add some javascripts to the HTML reports that we create using the SQL*plus commands :
SET MARKUP HTML ON SPOOL ON
This generates by default a <body> and an <html> tag. So to modify my report should i use the Preformat command in sql*plus.
|
|
|
|
|
Submit buttons in HTML report [message #313286 is a reply to message #312874] |
Fri, 11 April 2008 05:47 |
sdhanuka
Messages: 173 Registered: March 2008
|
Senior Member |
|
|
Hi i am using oracle 9i. I need to add buttons and calender to the html report generated by
SET MARKUP HTML ON SPOOL ON
SPOOL filename.html
.
.
.
.
.
please tell me how to do so ?
|
|
|
|
|
|
|
|
Re: SQL*PLUS HTML reports (help please) [message #313313 is a reply to message #313306] |
Fri, 11 April 2008 06:34 |
skooman
Messages: 913 Registered: March 2005 Location: Netherlands
|
Senior Member |
|
|
I think it's more like various tools can create output in HTML format (ie Discoverer, OBI EE, Reports) And it now turns out that SQL*Plus can do it too - it never occured to me that it can, underestimated good old SQL*Plus!
Without knowing this functionality at all: I think SQL*Plus just "spools" to HTML, adding some tags to the data. Creating buttons and calenders in SQL*Plus would be a truly new experience to me - I doubt if it's possible.
Getting back to the basics: why do you want this? Why use SQL*Plus to create nice looking reports, while there are so many products out there designed to do just that?
|
|
|
Re: SQL*PLUS HTML reports (help please) [message #313322 is a reply to message #313313] |
Fri, 11 April 2008 06:51 |
sdhanuka
Messages: 173 Registered: March 2008
|
Senior Member |
|
|
OK i am just few weeks old to oracle 9i.
I do not know about other tools that can create nice looking reports.
Ya i know that spool just creates some basic html tags. Thats the reason why i asked can if i modify that report to add buttons and calendars
|
|
|
Re: SQL*PLUS HTML reports (help please) [message #313329 is a reply to message #313322] |
Fri, 11 April 2008 07:05 |
skooman
Messages: 913 Registered: March 2005 Location: Netherlands
|
Senior Member |
|
|
Perhaps you can just use any tool that can edit HTML and edit the result in that tool??
(I have no idea what I'm talking about now, never edited HTML, but I guess there are tools out there...)
|
|
|
|
Re: SQL*PLUS HTML reports (help please) [message #313351 is a reply to message #313342] |
Fri, 11 April 2008 08:22 |
skooman
Messages: 913 Registered: March 2005 Location: Netherlands
|
Senior Member |
|
|
Did you read my last post?
Anyway, I can imagine that tools can seem confusing at first, but there is no other way then start learning the right tool I think. You stated "I need to create simple hmtl reports", that might be true, but if you need more then just showing data (you already found out how to do that), you simply have to use a serious tool for it.
|
|
|
Re: SQL*PLUS HTML reports (help please) [message #313470 is a reply to message #313342] |
Sat, 12 April 2008 14:04 |
|
Barbara Boehmer
Messages: 9102 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
It is unclear what you want to do, what tool you should use, or what forum this belongs in. If this is mostly related to SQL*Plus, then it belongs in the SQL Clients forum. For web stuff, you probably want iSQL*Plus. If it is specifically related to the Reports of the Oracle Developer Suite, that has nothing to do with reports generated from SQL*Plus, then it belongs here. If it has more to do with HTML, then it may belong in the Application Express forum or APEX for short, which was formerly called the HTMLDB.
If you want to create simple HTML reports, you can use the SQL*PLUS SET commands and SQL SELECT command to do that:
SCOTT@orcl_11g> SET DEFINE OFF SCAN OFF
SCOTT@orcl_11g> SET MARKUP HTML ON
SCOTT@orcl_11g> SELECT * FROM dept
<br>
2 /
<br>
<p>
<table WIDTH='90%' BORDER='5'>
<tr>
<th scope="col">
DEPTNO
</th>
<th scope="col">
DNAME
</th>
<th scope="col">
LOC
</th>
</tr>
<tr>
<td align="right">
10
</td>
<td>
ACCOUNTING
</td>
<td>
NEW YORK
</td>
</tr>
<tr>
<td align="right">
20
</td>
<td>
RESEARCH
</td>
<td>
DALLAS
</td>
</tr>
<tr>
<td align="right">
30
</td>
<td>
SALES
</td>
<td>
CHICAGO
</td>
</tr>
<tr>
<td align="right">
40
</td>
<td>
OPERATIONS
</td>
<td>
BOSTON
</td>
</tr>
</table>
<p>
SCOTT@orcl_11g>
<br>
SCOTT@orcl_11g> SET MARKUP HTML OFF
<br>
SCOTT@orcl_11g> spool off
If you want to add things like radio buttons, you can do that manually, by editing your file. Here is an example:
http://www.htmlcodetutorial.com/forms/_INPUT_TYPE_RADIO.html
Oracle has some built-in pl/sql functions and procedures that can be called from SQL, for example:
SCOTT@orcl_11g> CREATE TABLE pizza_size
2 (name VARCHAR2 (10),
3 value VARCHAR2 (10),
4 checked VARCHAR2 (10),
5 attributes VARCHAR2 (10))
6 /
Table created.
SCOTT@orcl_11g> INSERT ALL
2 INTO pizza_size VALUES ('pizzasize', 'S', NULL, 'small')
3 INTO pizza_size VALUES ('pizzasize', 'M', 'CHECKED', 'medium')
4 INTO pizza_size VALUES ('pizzasize', 'L', NULL, 'large')
5 SELECT * FROM DUAL
6 /
3 rows created.
SCOTT@orcl_11g> SELECT htf.formradio (name, value, checked, attributes) FROM pizza_size
2 /
HTF.FORMRADIO(NAME,VALUE,CHECKED,ATTRIBUTES)
--------------------------------------------------------------------------------
<INPUT TYPE="radio" NAME="pizzasize" VALUE="S" small>
<INPUT TYPE="radio" NAME="pizzasize" VALUE="M" CHECKED medium>
<INPUT TYPE="radio" NAME="pizzasize" VALUE="L" large>
SCOTT@orcl_11g>
This is explained in the documentation here:
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/w_htf.htm#sthref15490
If you want some GUI that allows you to create things through menus, rather than manually typing things in, then you probably want something like Application Express or the Oracle Developer Suite with Forms and Reports.
|
|
|
Re: SQL*PLUS HTML reports (help please) [message #313489 is a reply to message #313470] |
Sun, 13 April 2008 02:36 |
sdhanuka
Messages: 173 Registered: March 2008
|
Senior Member |
|
|
Hi thanks for the valuable inputs.
But SET MARKUP HTML ON SPOOL ON dynamically creates html tables and tags. I want to control and edit the tables it creates like add a table id and submit buttons.
If i edit the html page it would not matter because each time i spool it a new page will get created and the older edited report will be replaced. I have never used oracle reports.
The documentation you gave me on HTF is of oracle 11g. I am working on oracle 9i.
|
|
|
|
Re: SQL*PLUS HTML reports (help please) [message #313531 is a reply to message #313526] |
Sun, 13 April 2008 08:33 |
Frank Naude
Messages: 4587 Registered: April 1998
|
Senior Member |
|
|
You can always print the required HTML tags yourself. For example:
spool index.htm
prompt <FORM>
prompt <H1>Please enter your name:</H1>
prompt <INPUT TYPE=text NAME=name>
prompt <INPUT TYPE=SUBMIT VALUE="Go">
prompt </FORM>
spool off
|
|
|
Re: SQL*PLUS HTML reports (help please) [message #313535 is a reply to message #313526] |
Sun, 13 April 2008 08:44 |
sdhanuka
Messages: 173 Registered: March 2008
|
Senior Member |
|
|
Thanks Frank.
Apart from creating buttons I wanted to add a few javascripts to the html reports created by sql*plus. How to do that do we add this:
prompt < script type=text/javascript>
function cal()
{
for statements..
{
if( condition)
{
.
.
}
}
}
</script>
|
|
|
|
|