|
<%
Response.ContentType = "application/hta"
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
Response.Charset= "shift_jis"
%>
<HTML>
<HEAD>
<TITLE>HTML Application</TITLE>
<HTA:APPLICATION ID="oHTA">
</HEAD>
<BODY>
<INPUT type=button value=Excelへロード onClick='LoadExcel();'>
<INPUT type=button value=閉じる onClick='window.close();'>
<%
Set OraDatabase = OraSession.GetDatabaseFromPool(10)
SqlQuery = "select * from H1.MS04 where 商品コード >= 12"
Set OraDynaset = OraDatabase.CreateDynaset(SqlQuery,2)
Set Columns = OraDynaset.Fields
%><TABLE border=1 id=ExcelData><%
Do while not OraDynaset.EOF
%><tr><td><% = Columns( "商品コード" ).Value %></td><%
%><td><% = Columns( "全角品名" ).Value %></td><%
%><td><% = Columns( "在庫評価単価" ).Value %></td></tr><%
OraDynaset.MoveNext
Loop
%></TABLE><%
%>
<SCRIPT language=JavaScript>
function LoadExcel() {
var ExcelSheet;
ExcelApp = new ActiveXObject("Excel.Application");
ExcelSheet = new ActiveXObject("Excel.Sheet");
ExcelSheet.Application.Visible = true;
for (i=0; i < document.all.ExcelData.rows.length; i++) {
for (j=0; j < document.all.ExcelData.rows(i).cells.length; j++) {
ExcelSheet.ActiveSheet.Cells(i+1,j+1).Value = document.all.ExcelData.rows(i).cells(j).innerText;
}
}
}
</SCRIPT>
</BODY>
</HTML>
| |