A ver si te sirve esto, NO LO HE PROBADO
Lo que no entiendas preguntalo, de todas maneras si tiras de tu codigo copiado veras que el link que pintas llama a un agente y le pasa un parametro asi que podras ver como lo hacen en tu pueblo.(<href='/inet/defenciu.nsf/modiQueja?openagent&clave=")
Sub Initialize
Dim s As New NotesSession
Dim ESTABD As NotesDatabase
Dim VISTA As NotesView
Dim count As Integer ' ESTO SOBRA
Dim nav As NotesViewNavigator ' ESTO SOBRA
Dim documento As NotesDocument
Dim DOCWEB As NotesDocument ' ESTO SERA EL AGENTE EN MEMORIA PARA COGER LOS PARAMETROS
Set DOCWEB=S.DOCUMENTCONTEXT ' ESTO SERA EL AGENTE EN MEMORIA PARA COGER LOS PARAMETROS
CUANTOS=CInt(parametro(Ucase(DOCWEB.QUERY_STRING_DECODED(0)),"CUANTOS"))
If CUANTOS=0 Then CUANTOS=10' Por poner un minimo de 10 en caso de no decir CUANTOS
COMIENZO=CInt(parametro (Ucase(DOCWEB.QUERY_STRING_DECODED(0)),"COMIENZO"))
Set ESTABD=s.CurrentDatabase
Set VISTA = estabd.GetView("By Category") ' ESTO SOBRA, porque lo reutilizas debajo
Set VISTA=estabd.GetView("wwadmin")
Set documento=vista.GetFirstDocument()
Call encabezado ("Quejas de usuarios",xtipo) ' AQUI NO SE SABE QUE ES XTIPO
Print "<table summary='Tabla quejas' class='bordeTablaInteriorIzq' align='center' >"
Print "<caption >QUEJAS RECIBIDAS</caption>"
Print "<thead class='cabeceraAzul'>"
Print" <tr >"
Print " <th scope='col'></th>"
Print " <th scope='col' >Clave</th>"
Print " <th scope='col' >Fecha Alta</th>"
Print " <th scope='col' >Apellidos y nombre</th>"
Print " <th scope='col' >Comentario</th>"
Print" <th scope='col' >Estado</th>"
Print" </tr>"
Print"</thead>"
Print "<tfoot class='cabeceraAzul'>"
Print" <tr >"
Print" <th scope='row'>2011</th>"
Print "<td colspan='5'> </td>"
Print" </tr>"
Print" </tfoot>"
Print" <tbody>"
' ESTE BUCLE NOS COLOCA EL PUNTERO EN EL PARAMETRO COMIENZO
FOR A=1 To COMIENZO
Set DOCUMENTO=VISTA.GETNEXTDOCUMENT(DOCUMENTO)
Next
' While Not documento Is Nothing ESTO LO COMENTAMOS PORQUE COGE TODOS LOS DOCS
' EN SU LUGAR PONDREMOS UN BUCLE CON FOR
FOR A=1 To CUANTOS
Print"<tr class='cabecerRojo'>"
Print " <td style='padding:10px 0 0 10px'>"
Print " <a href='/inet/defenciu.nsf/modiQueja?openagent&clave="
Print documento.clave(0)
Print "'><img src='/graficos/botonBuscar.jpg' alt='ver registro' title='ver registro' style='border:0;'</a> </a>"
Print " </td>"
Print " <td style='padding:10px 0 0 10px'>"+documento.clave(0)+"</td>"
Print " <td style='padding:10px 0 0 10px'>"+documento.falta(0)+"</td>"
Print " <td style='padding:10px 0 0 10px'>"+documento.apellidos(0)+documento.nombre(0)+"</td>"
Print " <td style='padding:10px 0 0 10px'>"+documento.motivo(0)+"</td>"
Print " <td style='padding:10px 0 0 10px'>"+documento.estado(0)+"</td>"
Print "</tr>"
Print "<tr><td colspan='6' height='1' bgcolor='#000'></td></tr>"
Set documento=vista.GetNextDocument(documento)
'Wend ESTO SOBRA PORQUE ES DEL WHILE AHORA PONDREMOS NEXT
Next
Print "</tbody>"
Print"</table>"
Print {<a HREF="/TUBASEDEDATOS.NSF/ESTEAGENTE?OPENAGENT&CUANTOS=10&COMIENZO=}+cstr(comienzo+cuantos)+{">Siguiente pagina</a>}
End Sub
' ESTA FUNCION TE DEVUELVE EL VALOR DEL PARAMETRO QUE LE PASES
Function parametro(cadena As String, variable As String) As String
If InStr(cadenza,variable)>0 Then
' LO HE ENCONTRADO
cadena2=StrToken(CADENA,PARAMETRO+"=",2)
If InStr(cadena2,"&")>0 Then
parametro=StrToken(cadena2,"&",1)
Else
parametro=cadena2
End If
Else
' NO ESTA ESE PARAMETRO
parametro="0"
End If
End Function
|
Creado el 23 nov. 2011 12:04por Manolo Molina
Al pasar el codigo al agente, estas variables se quedan en rojo en Initialize, pense que eran por que no estaban definidas con un Dim, pero no es eso.
CUANTOS=CInt(parametro(Ucase(DOCWEB.QUERY_STRING_DECODED(0)),"CUANTOS"))
COMIENZO=Cint(parametro(Ucase(DOCWEB.QUERY_STRING_DECODED(0)),"COMIENZO"))
En fin te ha caido un pesado con pocos conocimientos, gracias por todo.
Creo que me queda poco tiempo trabajando por aqui , pero yo intentare aprender mientras este, ahora me han puesto la tarea herculea de crear un formulario para subir documentos a una base de datos,con el añadido de que suba imagenes , me dicen con la elocuencia y simpatia que eso se hace con un UNID entre la base de datos de imagenes y la base de datos de documentos para enlazar la imagen correspondiente con los datos. Han hablao de que para subir objetos notes usa un formulario multipartes ..ESO QUE ES ¡¡¡¡
En el momento que quieras deja de contestar no es cuestion que me estes asesorando a cada paso.
Gracias por todo, te estoy enormemente agradecido
Manolo
Granada
Leer más...
|
Creado el 23 nov. 2011 22:54por Daniel Recio
Igual te salen en rojo porque no estan declarados o los has declarado como STRING, al poner CINT lo conviertes a entero, asi que la declaracion deberia ser
DIM CUANTOS AS INTEGER
Animo hombre, y se prudente que por aqui para gente de tu mismo dominio.
Un formulario multipartes como te han dicho al final es la declaracion HTML del elemento FORM, pero vamos que eso lo hace el Lotus solito, no tienes que hacer nada. Para mi que te estan calentando demasiado y a lo mejor es mejor para ellos y para ti invertir en la base, poco a poco.
Tu no dudes en preguntar lo que quieras
Leer más...
|
Creado el 25 nov. 2011 14:26por Manolo Molina
¡ Hola ¡
FUNCIONA EL REPAGINAR EN UN AGENTE EL PROBLEMA ERA
Function parametro(cadena As String, variable As String) As String
If InStr(cadenza,variable)>0 Then
' LO HE ENCONTRADO
cadena2=StrToken(CADENA,PARAMETRO+"=",2)
If InStr(cadena2,"&")>0 Then
parametro=StrToken(cadena2,"&",1)
Else
parametro=cadena2
End If
Else
' NO ESTA ESE PARAMETRO
parametro="0"
End If
End Function
que pone cadena2 cadena cadenza, y mi atrevimiento porque yo veo un codigo y lo respeto si pone cadenza es cadenza
pero esta vez puse cadena en todos.
GRACIAS .
Leer más...
|
Creado el 25 nov. 2011 15:58por Daniel Recio
Me alegro hombre, si es que con mis dedazos lo raro es que no me equivoque
Leer más...
|
Creado el 29 nov. 2011 14:12por Manolo Molina
¡ Hola ¡
Gracias por tu amables respuestas, son dedos de pianista sin duda , el teclado estaba mal.
Me queda un poquito para alcanzar el final en este tema, ahora tengo que crear un ciclo para que cree los numeros de paginas , y puedo imaginar como hacerlo, pero me surge una duda , yo puedo crear un ciclo que sume a comienzo una cantidad y cree numeros de paginas con un comienzo =comienzo+20 , pero como al mismo tiempo leo los registros para saber el final, son 900 registros si calculo 25 por pagina , pues pongo esas paginas, pero lo chuli es que automaticamente lea el numero de registro y cree las paginas en funcion del numero de registros, en php count , en lotus...¿?
Un saludo
Leer más...
|
Creado el 29 nov. 2011 14:32por Manolo Molina
¡ Hola ¡
Estaba revisando el agente y la repaginación que funcionaba en principio. Pero viendolo con mas detenimiento el CUANTOS funciona , pero el COMIENZO no, como veia que ponia registros mas o menos y aparecian mas o menos, pense que funcionaba , pero lo que hacee es poner más o menos registros pero no empieza desde comienzo sino siempre desde el principio.
el parametro quedo asi:
Function parametro(cadena As String, variable As String) As String
If Instr(cadena,variable)>0 Then
' LO HE ENCONTRADO
cadena=Strtoken(CADENA,PARAMETRO+"=",2)
If Instr(cadena,"&")>0 Then
parametro=Strtoken(cadena,"&",1)
Else
parametro=cadena
End If
Else
' NO ESTA ESE PARAMETRO
parametro="0"
End If
End Function
Leer más...
|
Creado el 15 dic. 2011 12:42por Manolo Molina
¡ Hola ¡
Al final con ayuda consegui que funcionara la repaginacion con un agente dejo el codigo por si es util a alguien
Sub Initialize
Dim s As New NotesSession
Dim A As Integer
Dim ESTABD As NotesDatabase
Dim VISTA As NotesView
Dim documento As NotesDocument
Dim DOCWEB As NotesDocument ' ESTO SERA EL AGENTE EN MEMORIA PARA COGER LOS PARAMETROS
Set DOCWEB=S.DOCUMENTCONTEXT ' ESTO SERA EL AGENTE EN MEMORIA PARA COGER LOS PARAMETROS
Dim CUANTOS As Integer
Dim COMIENZO As Integer, x As Integer
Dim totaldocs As Long, paginas As Long, y As Long, z As Long
Dim misvalores As String
misvalores=Lcase(DOCWEB.QUERY_STRING_DECODED(0))
xtipo=""
Call encabezado ("Quejas de usuarios",xtipo) ' AQUI NO SE SABE QUE ES XTIPO
' CUANTOS=Cint(parametro(Ucase(DOCWEB.QUERY_STRING_DECODED(0)),"CUANTOS"))
cuantos=Val(davalor(misvalores, "cuantos"))
comienzo=Val(davalor(misvalores, "comienzo"))
If CUANTOS=0 Then CUANTOS=10' Por poner un minimo de 10 en caso de no decir CUANTOS
' COMIENZO=Cint(parametro (Ucase(DOCWEB.QUERY_STRING_DECODED(0)),"COMIENZO"))
If comienzo=0 Then comienzo=1
Set ESTABD=s.CurrentDatabase
Set VISTA=estabd.GetView("wwadmin")
totaldocs=vista.EntryCount
paginas=Int(totaldocs/cuantos)
'Set documento=vista.GetFirstDocument()
Set documento=vista.GetNthDocument(comienzo)
Print "<table summary='Tabla quejas' class='bordeTablaInteriorIzq' align='center' >"
Print "<caption >QUEJAS RECIBIDAS</caption>"
Print "<thead class='cabeceraAzul'>"
Print" <tr >"
Print " <th scope='col'></th>"
Print " <th scope='col' >Clave</th>"
Print " <th scope='col' >Fecha Alta</th>"
Print " <th scope='col' >Apellidos y nombre</th>"
Print " <th scope='col' >Comentario</th>"
Print" <th scope='col' >Estado</th>"
Print" </tr>"
Print"</thead>"
Print "<tfoot class='cabeceraAzul'>"
Print" <tr >"
Print" <th scope='row'>2011</th>"
Print "<td colspan='5'> </td>"
Print" </tr>"
Print" </tfoot>"
Print" <tbody>"
' ESTE BUCLE NOS COLOCA EL PUNTERO EN EL PARAMETRO COMIENZO
' For A=0 To COMIENZO
' Set DOCUMENTO=VISTA.GETNEXTDOCUMENT(DOCUMENTO)
' Next
' While Not documento Is Nothing ESTO LO COMENTAMOS PORQUE COGE TODOS LOS DOCS
' EN SU LUGAR PONDREMOS UN BUCLE CON FOR
For A=1 To CUANTOS
Print"<tr class='cabecerRojo'>"
Print " <td style='padding:10px 0 0 10px'>"
Print " <a href='/inet/defenciu.nsf/modiQueja?openagent&clave="
Print documento.clave(0)
Print "'><img src='/graficos/botonBuscar.jpg' alt='ver registro' title='ver registro' style='border:0;'</a> </a>"
Print " </td>"
Print " <td style='padding:10px 0 0 10px'>"+documento.clave(0)+"</td>"
Print " <td style='padding:10px 0 0 10px'>"+documento.falta(0)+"</td>"
Print " <td style='padding:10px 0 0 10px'>"+documento.apellidos(0)+documento.nombre(0)+"</td>"
Print " <td style='padding:10px 0 0 10px'>"+documento.motivo(0)+"</td>"
Print " <td style='padding:10px 0 0 10px'>"+documento.estado(0)+"</td>"
Print "</tr>"
Print "<tr><td colspan='6' height='1' bgcolor='#000'></td></tr>"
Set documento=vista.GetNextDocument(documento)
'Wend ESTO SOBRA PORQUE ES DEL WHILE AHORA PONDREMOS NEXT
Next
Print "</tbody>"
Print"</table>"
For x=1 To paginas
y=x*cuantos
z=((x-1)*cuantos)+1
If z=comienzo Then Print "("
Print "<a href='/inet/Defenciu.nsf/adminquejasF?OPENAGENT&cuantos="+Ltrim(Str(cuantos))+"&comienzo="+Ltrim(Str(z))+"'>"
Print x
Print "</a>"
If z=comienzo Then
Print ")"
End If
If x<paginas Then Print ", "
Next
' Print {<a HREF="?OPENAGENT&CUANTOS=10&COMIENZO=}+Cstr(comienzo+cuantos)+{">1</a>}
End Sub
Un saludo
Leer más...
|
|