test_print_report.asp
<html>
<Evista>
<meta content = text/html; charset = big5 http-oquiv = content-type>
<title> Cliente Use el informe RDS Produce Excel </title>
</ablo>
<Body bgColor = SkyBlue TopMargin = 0 LeftMargin = 20 OnContextMenu = return False RightMargin = 0 BottomMargin = 0>
<Form Action = test_print_report.asp Method = Post Name = MyForm>
<Div align = Center> <Center>
<tabla border = 5 bgcolor =#ffe4b5 estilo = altura: 1px; arriba: 0px borderColor =#0000ff>
<tr>
<td align = middle bgcolor =#ffffff borderColor =#000080>
<font color =#000080 size = 3>
Informe RDS USE RDS Produce Excel
</font>
</td>
</tr>
</table>
</div>
<Div align = izquierda>
<input type = button value = Query Data Name = Query Language = VBScript OnClick = Fun_query () style = Height: 32px; Ancho: 90px>
<input type = button value = clare data name = claro lenguaje = vBscript onClick = fun_clear () style = altura: 32px; Ancho: 90px>
<input type = Botton Value = Excel Report Name = Report Language = VBScript onClick = Fun_excel () style = Height: 32px; Ancho: 90px>
</div>
<div id = addData> </div>
</form> </center>
</body>
</html>
<Script Language = VBScript>
Dim RDS, RS, DF
Dim strsql, strrs, strcn, rowcnt
dim xlapp, xlbook, xlsheet1, xlmodule, xlpagesetup
Dim Headrowcnt, Titlerowcnt, ContentRowcnt, Footrowcnt
Dim Pagerowcnt, Pageno, TotalPagecnt, ContentRownowcnt
Dim columnallwidth, columnawidth, columnbwidth, columncwidth, columndwidth
Sub Fun_query ()
establecer rds = createObject (rds.dataSpace)
Establecer df = rds.createObject (rdsserver.dataFactory, http: // ISCS00074)
strcn = driver = {SQL Server}; Server = ISCS00074; uid = sa; app = Microsoft Development Environment; Database = pubs; user id = sa; contraseña =;
strsql = select * de trabajos
establecer rs = df.query (strcn, strsql)
Si no es RS.EOF entonces
strrs = <table border = 1> <tr> <td> job_id </td> <td> job_desc </td> <td> max_lvl </td> <td> min_lvl </td> </tr> <tr> <TD> + rs.getString (,, </td> <td>, </td> </tr> <tr> <td>,) + </td> </tr> </table>
addData.InnerHTML = STRRS
strrs =
demás
msgbox ¡No hay datos en la tabla!
final si
final
sub fun_clear ()
strrs =
addData.InnerHTML = STRRS
final
Sub Fun_excel ()
establecer rds = createObject (rds.dataSpace)
Establecer df = rds.createObject (rdsserver.dataFactory, http: // ISCS00074)
strcn = driver = {SQL Server}; Server = ISCS00074; uid = sa; app = Microsoft Development Environment; Database = pubs; user id = sa; contraseña =;
strsql = select Count (*) como registro de trabajos
establecer rs = df.query (strcn, strsql)
TotalPageCnt = RS (RecordCnt)
&norte