Dynamic html table
Hi,
I try to do a dynamic table which will return headings, all rows from emp table. Let say I've done process on page which return simple table contect.
----------------------------Process on load after region----------------------------------------------------------
DECLARE
totalrows INT;
str VARCHAR2 (300);
CURSOR c_emp
IS
SELECT empno, ename, mgr
FROM emp;
BEGIN
HTP.p ('<table style="border:1px solid;">');
FOR i IN c_emp
LOOP
HTP.p ('<tr >');
HTP.p ('<td style="border:1px solid black;">' || i.empno || '</td>');
HTP.p ('<td style="border:1px solid black;">' || i.ename || '</td>');
HTP.p ('<td style="border:1px solid black;">' || i.mgr || '</td>');
HTP.p ('</tr>');
END LOOP;
HTP.p ('</table>');
END;
How to include headings of columns dynamically? And how to make it more sensible?
Thx for help and some good ideas !
Hi,
yes true.
We can apply class e.g. if using standard theme 14
DECLARE
l_cursor INTEGER := dbms_sql.open_cursor;
l_qry VARCHAR2(32000);
l_status NUMBER;
l_cvalue VARCHAR2(32000);
l_col_cnt NUMBER;
l_desc_t dbms_sql.desc_tab2;
l_desc_c dbms_sql.desc_tab;
l_table VARCHAR2(32000) := '<table class="t14Standard">';
l_th VARCHAR2(32000) := '<th class="t14ReportHeader">';
l_td VARCHAR2(32000) := '<td class="t14data">';
BEGIN
l_qry := 'SELECT * FROM emp';
dbms_sql.parse (l_cursor, l_qry, dbms_sql.native);
dbms_sql.describe_columns( l_cursor, l_col_cnt, l_desc_c );
htp.p(l_table);
htp.p('<tr>');
htp.p('<thead>');
FOR i IN 1 .. l_desc_c.count
LOOP
htp.prn(l_th || l_desc_c(i).col_name || '</th>');
END LOOP;
htp.p('</thead>');
htp.p('</tr>');
htp.p('<tbody>');
dbms_sql.describe_columns2( l_cursor, l_col_cnt, l_desc_t );
FOR i IN 1 .. l_desc_t.count
LOOP
dbms_sql.define_column( l_cursor, i, l_cvalue, 32765);
END LOOP;
l_status := dbms_sql.execute( l_cursor );
LOOP
EXIT
WHEN (dbms_sql.fetch_rows( l_cursor ) <= 0 );
--l_row_cnt := l_row_cnt + 1;
htp.p('<tr>');
FOR i IN 1 .. l_desc_t.count
LOOP
dbms_sql.column_value( l_cursor, i, l_cvalue );
htp.prn(l_td || l_cvalue || '</td>');
END LOOP;
htp.p('</tr>');
END LOOP;
htp.p('</<tbody>');
htp.p('</table>');
IF dbms_sql.is_open(l_cursor) THEN
dbms_sql.close_cursor(l_cursor);
END IF;
EXCEPTION WHEN OTHERS THEN
IF dbms_sql.is_open(l_cursor) THEN
dbms_sql.close_cursor(l_cursor);
END IF;
RAISE;
END;Br, Jari
Similar Messages
-
Help! How to send Dynamic HTML table as an email?!
hi
i want to send a dynamic html table as an email
i am using php/mysql and have a mysql database
i have a dynaimc table contins some data from the database
i have a form with textbox to write the email in and a submit button
i want to send the the table (or the information in the table) when i submit the form
is that possible???
plz help!Ok, now I have you. You create a queary to select the data you want, then use this code
$data = mysqli_query($dbc, $query) or die(mysqli_error($dbc));
while ($row = mysqli_fetch_array($data)) {
//Sending Email to form owner
$header = "From: [email protected]\n"
. "Reply-To: $email\n";
$subject = "Data From DB into email";
$email_to = "[email protected]";
$message =
$row['first_name'].
$row['last_name']
mail($email_to, $subject ,$message ,$header ) ;
So for each column, you will enter this
$row['first_name'].
So if the column is state, you would put
$row['state'].
Hopefully this is the answer you were looking for.
Gary -
Reading dynamic html table data
HI friends I am creating asp.net project and i want read html table data which is dynamically created.
This forum is for language questions. For help in asp.net, visit forums.asp.net.
Visual C++ MVP -
Can I include a Dynamic HTML Table into XML Forms?
Hi,
I have a requirement For XML Forms that I don´t know if possible, the requirement is that I can let the user create a HTML Table in a template generated by XML Forms, so he can include in the Content a HTML Table that is displayed with the elements he decided.
Thanx in Advanced!
Gerardo JHi,
To Create HTML Tables in the XML Forms, use the HTML Editor from the Menu and Function bar. When the form is generated then tables can be created using this editor.
Thanks and Regards,
Gauri Gosavi. -
hello, i am a fresher in jsp. i want to add new rows in html table dynamically.In my coding, just only shows in one row . please help my problem with correct coding and i don't want to use database. Thanks ...............!
Here is my coding-------------------
---------------- form.jsp --------------------->
<%@ page import="java.util.*,newtest1.Validation" %>
<jsp:useBean id="mybean" scope="page" class="newtest1.Validation" />
<jsp:setProperty name="mybean" property="name" param="name" />
<jsp:setProperty name="mybean" property="age" param="age" />
<% s[i][j] %>
<html>
<head><title>Form</title></head>
<body>
<form method="get">
<table border="0" width="700">
<tr>
<td width="150" align="right">Name</td>
<td width="550" align="left"><input type="text" name="name" size="35"></td>
</tr>
<tr>
<td width="150" align="right">Age</td>
<td width="550" align="left"><input type="text" name="age" size="35"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr><td> </td></tr>
<tr><td><input type="submit" name="submit" value="ADD"></td></tr>
<tr><td> </td></tr>
<tr><td width="100%" align="center" border=1>
<% int count=mybean.getStart();
for(int i=count; i<count+1; i++) { %>
<tr>
<td><jsp:getProperty name="mybean" property="name" /></td>
<td><jsp:getProperty name="mybean" property="age" /></td>
<td><%= count %></td>
<% count+=1; %>
</tr>
<% } %></td></tr>
</table>
</form>
</body>
</html>
----------------- Validation.java ----------------->
package newtest1;
import java.util.*;
public class Validation {
private String name;
private String age;
static int start=0;
public Validation() { name=null;
age=null;
++start;}
public void setName(String username) { if(username!="")
name=username;
public String getName() { return name; }
public void setAge(String userage) { if (age!="")
{age=userage;}
public String getAge() { return age; }
public int getStart() {
return start; }Hi, Do you mean to say,
You have an HTML page in which you have a text field and an add button. If you enter anything in that text field and click on Add button the text field contents should be displayed in the same HTML page and you should be able to go on entering new values into the text field and you should be able to retain and display all the previously entered values..
and finally the list of added items are not stored in the database..
If this is the case
i. Your html form should be submitted to the same page.
ii. You need to have a Vector which holds the entered values.
iii. Bind the vector object to the request object and collect the same vector object from the request and display its contents...
I think this would help... -
I want to create an HTML table of img maps dynamically from DB retrieves...
Hi,
How do I build dynamic HTML code in a function and then populate a HTML region to render it.. (did I say that right?)
I want to create an HTML table of img maps dynamically from DB retrieves...
Thank you, BillVikas and Andy,
Using Andy's code I'll go further...
I want to create a function that returns HTML code that has been built dynamically.
create or replace function "GET_CH_TABLE"
return VARCHAR2
is
HTML_STRING VARCHAR2(2000); -- Create a string variable
BEGIN
HTML_STRING:= '<table align="center">' ||chr(10)||
' <tr>' ||chr(10)||
' <td> TEST ' ||chr(10)||
' /td>' ||chr(10)||
' /tr>' ||chr(10)||
' tr>' ||chr(10)||
' td>' ||chr(10)||
' a href=https:// ............etc. etc.. building the <TABLE> and <TD> cells having whatever I want... example.. changing the name of an image dependant on something else..
return HTML_STRING; -- output the string to the region
--also tried htp.p(HTML_STRING);
END;
=====================================
Building the dynamic HTML is not my problem. It is how to get it into a region and to be read as HTML from a function call...
I'd like the source of the region to be the returned HTML from a function call to GET_CH_TABLE();
but it gives error:
ORA-06550: line 1, column 7: PLS-00221: 'GET_CH_TABLE' is not a procedure or is undefined
ORA-06550: line 1, column 7: PL/SQL: Statement ignored
Debug:
1: begin
2: GET_CH_TABLE();
3: end;
I -
Older Business HTML and Dynamic Page Table question
I am not sure if anyone will know here (or if this is the best place to post), but I have a question concerning using the Business HTML template library controls/API for use with ITS. I am attempting to use the "Dynamic Page Table" control, and have hit some problems. Does anyone have any example code they can share on getting this to work correctly (ie, paging through records, selecting from rows, etc)? I have "torn apart" the underlying Javascript and even modified my code to adjust for some formatting issues that the API's do not handle, however, my "pages" all display at once in the beginning and only hide when I use one of the paging icons (forward,back,all back, etc). THe "isVisible" parameter seems to do nothing for the "page" DIVs. Currently running the latest version of ITS and R/3 4.6b on the backend if that helps. Also, the example from the SAP Design Guild cookbook is very basic and does not "page" as I need. Thanks in advance!
CSolomonCheck the following Tables
FND_FORM_CUSTOM_RULES
FND_FORM_CUSTOM_SCOPES
FND_FORM_CUSTOM_ACTIONS
FND_FORM_CUSTOM_PARAMS -
A data table in one column of a dynamic data table
Hi , I have to design a dynamic data table(with dynamic columns and data) which looks as the following
DETAILS NAME ROLE NUMBER CLASS SECTION
15 MATHS SURESH 15 10 A
20 SCIENCE
25 ENGLISH
15 MATHS SURESH 15 10 A
20 SCIENCE
25 ENGLISH
The data in the column 'DETAILS' should have inner table. The data in this inner table should have hyper links. If there is no inner table infor mation there shold be an image with hyperlink. This data table should also have pagination and sorting features. Please send me some example code for this. Please help me out as i have client demo on mondayYou may find this example useful: [http://balusc.blogspot.com/2006/06/using-datatables.html#NestingDatatables].
To toggle between a nested datatable and a hyperlink with image just use the rendered attribute. E.g.
<h:column>
<h:dataTable rendered="#{!empty dataItem.innerList}">
</h:dataTable>
<h:commandLink rendered="#{empty dataItem.innerList}">
</h:commandLink>
</h:column>
... -
Display Dynamic HTML beside Flash Chart in Chart Region
Hello,
I have a vertical 3D flash chart with some categories I,II,IV... on x-axix. I have to show a legend beside the chart dynamically depending on the categories displayed like (I - PC, II - TV, IV-Laptop....) First I tried to do this with static data. I modified, Region Source of Chart region to include the legend. I am successful to create a table & put some static html code. Now I want this to be dynamic.
I found that with shotcuts I can put dynamic HTML code. I created shortcut with PL/SQL & successfully displayed them in a 'HTML REGION WITH SHORTCUTS', but I want that in Chart Region, not as a separate region. Shortcut is not working in Chart region.
How can I achieve this? Is there a way to call a process or substitution string or some thing from Chart Region to display my legend dynamically beside the chart.
Experts any hint is appreciated.
Sowji.Experts,
Can you please give any hint how this can be achieved? If I keep the dynamic legend as HTML with Shortcut region, the width & height are not matching with the chart region as it is dynamic. Also, I am unable to combine both 'chart' & 'html with shortcut' region to look like one region. So I am looking for options to insert the dynamic html in to chart region.
Sowji. -
Passing Dynamic Internal Tables to Memory
I have a bit of a conundrum right now that I can't seem to correct. I am working on adding an ALV report to an existing report program. I was able to write a simple helper program that builds a custom object that I defined that translates my raw data into two seperate dynamic tables, and then builds an ALV grid and outputs it. The reason I wrote this in a simple helper program was so that I could use SUBMIT ... EXPORTING LIST TO MEMORY from my primary report program and capture the input so I can later write it out under our company's standard ABAP list format as if I were using WRITE statements.
The output of the report itself is working beautifully. We have included functionality to automatically take the output, produce an HTML file from it, and then FTP it directly to a webserver so our clients can get easy access to it. What I want to be able to do though is give the clients two tab-delimited files that contain the raw data that was used to build the report. We have an interface in place to do that, but I somehow need to be able to pass these two dynamic internal tables which I have field-symbols to reference back to my calling program.
Here is what I am trying to do:
CALL METHOD OBJ_ALV_MR_EST_REASONS->PRODUCE_ESTIMATION_REPORT
IMPORTING
RPT_DATA_BY_REASON = ref_it_estreason
RPT_DATA_BY_DISTRICT = ref_it_district.
* Assign the field symbols
ASSIGN ref_it_estreason->* TO <it_estreason>.
ASSIGN ref_it_district->* TO <it_district>.
* Export the two internal tables to memory so they can be
* retrieved by the calling program
EXPORT reason = <it_estreason>[]
district = <it_district>[]
TO MEMORY ID 'ZCR_ESTIMATION_REASON_RPT'.
As you can see, my method returns two references to dynamic internal tables. I have used the memory debugger to see that these tables are being correctly written to the ABAP memory.
However, back in my parent program when I try to do the following,
CREATE DATA ref_it_estreason TYPE REF TO DATA.
CREATE DATA ref_it_district TYPE REF TO DATA.
ASSIGN ref_it_estreason->* TO <it_estreason>.
ASSIGN ref_it_district->* TO <it_district>.
IMPORT reason = <it_estreason>
district = <it_district>
FROM MEMORY ID 'ZCR_ESTIMATION_REASON_RPT'.
I get the REFS_NOT_SUPPORTED_YET exception which says that "For the statement Export/Import ..." object references, interface references, and data references are currently not supported".
I have tried multiple other ways of defining my field-symbols or my reference pointers but they all result in exceptions of some sort. Is there any way for me to get this data passed back? It seems like there must be a way to get the data from memory since I know it's being correctly stored there.
Thanks in advance.Shortly after posting this, I had an idea which I was able to implement to actually get this to work.
I decided that I would simply pass the FIELDCAT tables for each of my dynamic tables into the same memory ID as the tables themselves.
EXPORT reason_fcat = it_estreason_fcat
district_fcat = it_district_fcat
reason = <it_estreason>[]
district = <it_district>[]
TO MEMORY ID 'ZCR_ESTIMATION_REASON_RPT'.
Then, back in my calling program I execute the following code. This retrieves the FIELDCAT tables, builds two empty dynamic table type reference variables and then lets me create field-symbols to reference those components.
* Retrieve the fieldcat internal tables first
IMPORT reason_fcat = it_estreason_fcat
district_fcat = it_district_fcat
FROM MEMORY ID 'ZCR_ESTIMATION_REASON_RPT'.
* Generate an internal table type assigned to each
* reference variable based on the fieldcat listings we
* retrieve
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_estreason_fcat
IMPORTING
ep_table = ref_it_estreason.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_district_fcat
IMPORTING
ep_table = ref_it_district.
* Assign the field symbols
ASSIGN ref_it_estreason->* TO <it_estreason>.
ASSIGN ref_it_district->* TO <it_district>.
CREATE DATA ref_wa_estreason LIKE LINE OF <it_estreason>.
CREATE DATA ref_wa_district LIKE LINE OF <it_district>.
ASSIGN ref_wa_estreason->* TO <wa_estreason>.
ASSIGN ref_wa_district->* TO <wa_district>.
* Finally, we can retrieve the data from memory and assign
* to the internal tables referenced by our field-symbols
IMPORT reason = <it_estreason>[]
district = <it_district>[]
FROM MEMORY ID 'ZCR_ESTIMATION_REASON_RPT'.
This worked beautifully and saved me from having to do a major redesign. I don't know how helpful it would be for ABAP Objects to be passed to memory (I believe some type of serialization would need to be in order there), but for dynamically typed internal tables it worked like a dream with little overhead. -
Hi,
I have used the below mentioned code to create a Dynamic HTML Page for plsql clob attribute ie
PROCEDURE get_html_doc (
p_transaction_id IN NUMBER,
x_document IN OUT NOCOPY CLOB
IS
l_proc_name VARCHAR2 (150) := 'get_html_doc';
l_page HTP.htbuf_arr;
l_lines NUMBER DEFAULT 99999999;
l_nm OWA.vc_arr;
l_vl OWA.vc_arr;
l_clob CLOB;
BEGIN
l_nm ( 1) := 'DUMMY_JUST_TO_SET_UP_OWA_UTIL';
l_vl ( 1) := 'WHATEVER';
xyz.display_detail
(p_called_from => 'DOC_ATTR_VALUE',
p_transaction_id => p_transaction_id
OWA.init_cgi_env (l_nm.COUNT, l_nm, l_vl);
OWA.get_page (l_page, l_lines);
DBMS_LOB.createtemporary (x_document, TRUE, DBMS_LOB.SESSION);
FOR i IN 1 .. l_lines
LOOP
IF (i = 1)
THEN
DBMS_LOB.WRITE (x_document,
LENGTH (l_page (i)),
1,
l_page (i)
ELSE
DBMS_LOB.writeappend (x_document,
LENGTH (l_page (i)),
l_page (i)
END IF;
END LOOP;
END get_html_doc;
I am getting a ORA-06502: PL/SQL: numeric or value error.
In view of the following ie
a) htbuf_arr is table of varchar2(256)
b) Total size of the page cannot exceed 32 K (Not sure)
Is any one of the above responsible for the error.
-> Scenario of LENGTH (l_page (i)) has exceeded 256.
-> Scenario where the size of the document is greater than 32k.
RegardsI have answered your duplicate post on the WorkflowFAQ forum at http://smforum.workflowfaq.com/index.php?topic=1092.0
Matt
WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
Have you read the blog at http://www.workflowfaq.com/blog ?
WorkflowFAQ support forum: http://forum.workflowfaq.com
Edited by: WorkflowFAQ.com on Feb 24, 2010 1:10 PM -
Can someone confirm for me whether Portal supports dynamic html (i.e., mousing over a link provides a drop-down menu, etc.)?
Melissa,
Oracle9iAS Portal supports any html that can live inside a table cell which includes dynamic html.
Rich -
Generating dynamic HTML for odiSendMail
Hi,
I have a requirement where i need to dynamically generate a HTML table, which is to be sent as the body of an email notification. This table will essentially be a HTML representation of data from some DB tables. How can I achieve this. A detailed solution is highly appreciated.
ThanksHi,
Is there a way to dynamically generate the body of email in odiSendMail? If there is please let me know. -
How do you write an output in columns to an html table?
Ive written two programs. My first program compares the difference of two text files and prints the differences in an output. My second program creates a simple Html table. I would like to write my output to this table. How would I go about doing this in java?
Thanks in advance for your help.Thanks guys for the insight. Im very new to java so I'm a complete novice when it comes to writing code. What I came to realize was I needed to do was build a dynamic table. My issue was that I was building a static table and I couldint populate the table with my results. Below is an example of the code I wrote for my table. My apologies if didnt format my code correctly.
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Set;
public class HtmlDataTable {
public void writehtmltable(Set<String> filenameSet){
//creates table in the following path
File htmltable = new File("C:/Output.html");
try {
BufferedWriter bw = new BufferedWriter(new FileWriter(htmltable));
//write html data table
bw.write(htmltop);
for (String jarfilename:filenameSet){
String line="<tr> <td> </td> <td> </td> </td> <td>"+jarfilename + " </tr>";
bw.write(line);
bw.write(htmlbottom);
//close the resource
bw.close();
} catch (IOException e) {
e.printStackTrace();
private static String htmltop = "<!DOCTYPE html>\n"+
"<html>\n"+
"<head>"+
"<title>Jar Filename Existance Check</title>"+
"<style>"+
"table, th, td {"+
" border: 2px solid black;"+
"}"+
"</style>"+
"</head>"+
"<body>"+
"<table>\n"+
" <tr> <th colspan='100'>" +
"<h3><br>Jarfilename Existance Check</h3> </th> </tr>" +
"<th>POM File Data</th> <th>Lib Directory Files</th> <th>Missing Jarfiles</th>";
private static String htmlbottom = "</table></body></html>";
public static void main(String[] args) {
new HtmlDataTable().writehtmltable(null); -
Query in Servlet not displaying results in html table
Hi,
I am aware that putting html in a servlet is not good practice. In my case, it is just for testing purposes.
Environment: WLS 12c on Windows, DB 11.2.0.3
I created an html form and a servlet in a Dynamic Web Project. The form parameters are sent to the servlet,
but the results are not being displayed.
HTML form:
<input text name="p_1"
Servlet:
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.DriverManager;
import java.sql.ResultSet;
* Servlet implementation class QueryServlet
@WebServlet("/QueryServlet")
public class QueryServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
* @see HttpServlet#HttpServlet()
public QueryServlet() {
super();
// TODO Auto-generated constructor stub
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.setContentType("text/html");
PrintWriter out = response.getWriter();
Connection conn = null;
Statement stmt = null;
try {
conn = DriverManager.getConnection("jdbc:oracle:thin:@home-server:1521:val01", "USER", "PW");
stmt = conn.createStatement();
String sqlStr = "SELECT....
... WHERE p_1 =
+ "'" + request.getParameter("p_1") + "'"
out.println("<html><head><title>Query Results</title></head><body>");
out.println("<p>Your query is: " + sqlStr + "</p>");
out.println("<p>Your are connected to: " + conn + "</p>");
--> OUTPUT ONLY UNTIL HERE <--
// Get data
ResultSet rset = stmt.executeQuery(sqlStr);
int count = 0;
while(rset.next()){
int cid = rset.getInt("CID");
// Display data in html table
out.println("<table>");
out.println("<tr>");
out.println("<td>" + cid + "</td>");
rset.close();
out.println("<p>====== " + count + " records found =======</p>");
out.println("</body></html>");
catch (SQLException ex) {
ex.printStackTrace();
finally {
out.close();
try {
if (stmt != null) stmt.close();
if (conn != null) conn.close();
} catch (SQLException ex) {
ex.printStackTrace();
Help greatly appreciated. Thanks!Possibly, the js file is not being detected by the javascript runtime.It would be better if you tried something like :
("<script src="<%=request.getContextPath()%>/WEB-INF/classes/ua.js"></script>
Maybe you are looking for
-
How to convert MIDI to mono OR limit the spread across the speakers
I recorded a MIDI Piano piece for a song I'm working on and it is spread across both speakers, the lows in the left and the higher frequencies in the right, the middles in the middle. This is quite annoying for mixing, is there anyway I can limit thi
-
why can't i buy or subscribe to adobe pdf pack
-
hai, kindly let me know what are the advantage of revenue recognition and what way the companies will benifit out of it.. it is job of fi or sd consultants.and what is sd role in this. vijay
-
Hello *, in the "BusinessObjects Enterprise Administrator's Guide" for BOXI R 3.1 (which we are using) I found a lot of information regarding a new functionality called "Federation". To create a remote connection for example, the Admin Guide explains
-
Problem related to adobe services
Hi all,, I have read the adobe services couple of docs but its all confusing Am in search a clean routemap..Need some step by step docs -including problem solving techniques -pre post requisites -Application development I need presentation to show to