<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<link href="./runtime/styles/xp/grid.css" rel="stylesheet" type="text/css" >
<script src="./runtime/lib/grid.js"></script>
<style type="text/css">
<!--
.active-controls-grid {height:80%; width:100%; font:Arial, Helvetica, sans-serif; background:background-color:#FFFFFF;}
.active-column-0 {width:40pt; text-align:center; background-color:#FFFFCC;}
.active-column-1 {width: 110pt; background-color:#CCFFFF;}
.active-column-2 {width: 60pt; text-align:center; background-color:#FFFFCC;}
.active-column-3 {width: 100pt; text-align:center; background-color:#CCFFFF;}
.active-column-4 {width: 100pt;}
.active-column-5 {width: 100pt; text-align:center; background-color:#CCFFFF;}
.active-grid-column {border-right: 1px solid black;}
.active-grid-row {border-bottom: 1px solid black;}
.active-templates-header{font-weight:bold; color:green; text-align:center;}
-->
</style>
</head>
<body>
try{
String datagrid = "var myData=[\n";
rs=stmt.executeQuery("select * from Requests where status='Pending' order by Req_No");
while(rs.next()) {
int r=rs.getInt(1); //System.out.println("req="+r);
java.sql.Date reqdate=rs.getDate(5);
String req_date=df.format(reqdate);
String st=rs.getString(22);
datagrid += "[\"\"<a href='ShowRequests.jsp?req=r' target=_blank>r</a>"+"\",\""+reqdate+"\",\""+rs.getString(3)+"\",\""+rs.getString(2)+"\",\""+rs.getString(4)%>/ <%rs.getString(16)+"\",\""+rs.getString(6)+"\",\""+rs.getString(7)+"\",\""+rs.getString(8)+"\",\""+rs.getString(9)+"\",\""+rs.getString(10)+"\",\""+%><a href="#null" onclick='window.open("ViewFiles.jsp?dir=<%=r%>&st=<%=st%>","","menubar=0,toolbar=1,resizable=1") '>Input Files</a><%"\"]\n";
}
datagrid += "];\n";
rs.close(); %>
<script>
var myTitle=["Request #", "Request Date", "Work Order", "Project", "Req. Dept. / Req. User", "Aggregate","Domain","Analysis Type","Related Information","Project Status","Related Files"];
<%=datagrid %>
var obj = new Active.Controls.Grid;
var row = new Active.Templates.Row; //add double click event
row.setEvent("ondblclick", function(){this.action("myAction")});
obj.setTemplate("row", row);
obj.setModel("row", new Active.Rows.Page);
obj.setColumnHeaderHeight(25);
obj.setProperty("row/count", myData.length-1);//(myData.length-1) is total rows
obj.setProperty("column/count", 6);
obj.setProperty("data/text", function(i, j){return myData[i][j]});
obj.setProperty("column/texts", myTitle);
obj.setProperty("row/pageSize", 25);
document.write(obj);
</script>
<% }
}catch(SQLException se){
out.print(se.getMessage()); }
%>
</FORM>
</BODY>
</HTML>
This topic is archived.