|
Re: query o/p in html page [message #556066 is a reply to message #556065] |
Thu, 31 May 2012 02:01 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Yes, with HPT.PRN.
P.S. Here's an example I used in an Apex application. Apex itself created a page (which includes most HTML tags, from <head> to <body>) - I just created one region. If you are going to create the WHOLE page by yourself, you'll have to actually "print" it line by line.
OK, here you go, just for an illustration. It creates a table with 5 images in a row.
procedure p_dg_ts_slike (par_ts_broj in number)
is
l_filename varchar2(255) := 'TS' || par_ts_broj || '-';
l_filename_i varchar2(255);
l_postoji boolean;
l_flen number;
l_bsize number;
begin
htp.prn('<table border="0">');
htp.prn('<tr>');
for i in 1 .. g_maxnum_img loop
l_filename_i := l_filename || to_char(i) ||'.jpg' ;
utl_file.fgetattr(pkg_degis.g_slike, l_filename_i, l_postoji, l_flen, l_bsize);
if l_postoji then
htp.prn('<td align="center">');
htp.prn('<style="width: 170px; height: 140px"> ' ||
' <img id="slika' || i || '"' ||
' src="http://<removed>/' ||
l_filename_i || '?rnd=' || abs(dbms_random.random) ||
' " width="150" height="120" style="border:2px solid black" '
);
htp.prn('</br>');
htp.prn('</br>' || l_filename_i);
htp.prn('</td>');
if mod(i, 5) = 0 then
htp.prn('<tr>');
end if;
end if;
end loop;
htp.prn('</tr>');
htp.prn('</table>');
end p_dg_ts_slike;
The result looks like this:
<table border="0"><tr><td align="center"><style="width: 170px; height: 140px"> <img id="slika1" src="http://<removed>/TS3032-1.jpg?rnd=2011247857 " width="150" height="120" style="border:2px solid black" </br></br>TS3032-1.jpg</td> Yes, I know, it is unformatted, but that's what the page source looks like. Manually reformatted (and easier to read):<table border="0">
<tr>
<td align="center">
<style="width: 170px; height: 140px">
<img id="slika1"
src="http://<removed>/TS3032-1.jpg?rnd=2011247857 "
width="150"
height="120"
style="border:2px solid black"
</br></br>TS3032-1.jpg
</td>
Page looks like this (blurred):
I hope you got the idea.
[Updated on: Thu, 31 May 2012 02:20] Report message to a moderator
|
|
|
|
|