Código fuente de ejemplo6.asp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<% @ LANGUAGE="VBSCRIPT" EnableSessionState = False %>
<%Option Explicit
Response.Buffer = true
Response.Cachecontrol = "no-cache"
%><html>
<head>
<title>dbGrid: generador de listados</title>
<style type="text/css">
body { font-family: Arial, sans-serif;}
a { color:#336699; text-decoration: none;}
a:hover { color: #CC0000; text-decoration: underline;}
.normal { font-size: 11px; font-family: Arial, sans-serif}
.listado { font-size: 12px; font-family: Arial, sans-serif; padding: 1px; padding-left: 4px;}
</style>
<style type="text/css" media="print">
.nodisp { display:none}
</style>
<script language="JavaScript">
function imprimir(){window.print()}
</script>
<Basefont size=2>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<center>
<!--#include file="dbgrid.asp" -->
<%
Dim oDb, mkList, rtn
rtn = Request( "rtn" )
Set oDb = new dbGrid
oDb.UsaDSN = true
oDb.nomDSN = "prueba"
if request("rtn") = "ext" Then
  oDb.GrEstilo = "listado"
  oDb.GrCampos = false
  oDb.GrTbl = false
  oDb.GrBusca = false
  oDb.GrOrden = false
  oDb.GrNumRes = 50
  oDb.GrWidth = 0
  oDb.Colors = array( "CCCCCC","000000","EEEEEE","000000","FFFFFF","FFFFFF","FFFFFF","FFDDDD" )
  Response.write "<div class='nodisp'>[ <a href='javascript:imprimir()'><b>Imprimir</b></a> ] &nbsp;" & vbCrLf
  Response.write "[ <a href='' onclick='f1.rtn.value=" & chr(34) & "tbl" & chr(34)
  Response.write ";f1.submit();return false'><b>Volver</b></a> ]<br><br></div>" & vbCrLf
  oDb.Activar
else
  oDb.GrEstilo = "normal"
  oDb.GrCampos = true
  oDb.GrTbl = true
  oDb.GrBusca = true
  oDb.GrOrden = true
  oDb.GrNumRes = 5
  oDb.Colors = Array("B0B8C0","000000","E0EAF4","000000","FFFFFF","F0F8F0","F4F0F8","FFD8D0")
  Response.write "<h4>Generador de listados</h4>" & vbCrLf
  oDb.Activar
  If rtn="" or rtn="tbl" or rtn="ext" Then
    Response.write "<br>Seleccione la tabla, columnas, criterios de búsqueda, orden y,<br>" & vbCrLf
    Response.write "a continuación, pulse aquí: " & vbCrLf
    Response.write "[ <a href='' onclick='f1.rtn.value=" & chr(34) & "ext" & chr(34)
    Response.write ";f1.submit();return false'><b>Generar listado para imprimir</b></a> ]<br><br>" & vbCrLf
  End If
end If
set oDb = nothing
%>
</center>
</body>
</html>