problema con itextsharp [RESUELTO]

(1/1)

PETTETE:
Hola buenas,
El asunto que em trae hoy es un problema que tengo con itextsharp.
He anclado una tabla en un pdf, dandole una posicion fija.
Se supone que la tabla debería de salir en todas las paginas del pdf, pero solo aparece en la última página.

Os adjunto parte del código poruq el código entero es muy largo...

Código
tabla0.horizontalalignment = Element.ALIGN_RIGHT
       tabla0.totalwidth = 180.0F
       tabla0.lockedwidth = True
       tabla0.spacingafter = 20.0F
 
       tabla1.setwidths(New Single() {27.5F, 80.0F, 20.0F, 22.0F})
       tabla1.totalwidth = 565.0F  ' ANCHURA TOTAL DE LA TABLA
       tabla1.LockedWidth = True
       tabla1.spacingafter = 6.5F
 
       tabla2.setwidths(New Single() {22.0F, 30.0F, 115.0F, 15.0F, 33.0F})
       tabla2.totalwidth = 560.0F
       tabla2.LockedWidth = True
       tabla2.splitrows = True
       tabla2.HeaderRows = 1  ' LA FILA 1 DE LA TABLA2 SE CONVIERTE EN LA CABECERA DE LA TABLA Y SIEMPRE QUE SALTA DE PAGINA APARECERÁ ESTA FILA.
 
       'tabla6.setwidths(New Single() {24.0F, 30.0F, 114.0F, 30.0F, 34.0F})
       'tabla6.totalwidth = 539.0F
       'tabla6.LockedWidth = True
 
       tabla7.setwidths(New Single() {22.0F, 31.0F, 119.0F, 17.7F, 30.5F})
       tabla7.totalwidth = 565.0F
       tabla7.LockedWidth = True
 
       tabla3.SetWidths(New Single() {46.5F, 27.5F, 16.5F, 26.5F, 39.5F, 12.5F, 27.0F, 38.5F})
       tabla3.TotalWidth = 565.0F
       tabla3.LockedWidth = True
       tabla3.SpacingBefore = 6.0F
 
 
For i = numreg - 8 To numreg ' CONTAMOS LAS ULTIMAS 8 LINEAS DEL TXT
 
           Dim micelda = New pdf.PdfPCell(New Phrase(b(i).ToString(), New Font(Font.ITALIC, 8.0F, Font.NORMAL)))
           micelda.FixedHeight = 54.0F
 
           micelda.HorizontalAlignment = iTextSharp.text.Element.ALIGN_CENTER
           micelda.VerticalAlignment = iTextSharp.text.Element.ALIGN_MIDDLE
 
           tabla3.addcell(micelda)
       Next
 
 Public Class EVENTOS_ITEXT '
 
       Inherits PdfPageEventHelper
 
       Public Overrides Sub OnEndPage(writer As PdfWriter, document As Document) ' OVERRIDES reemplaza el método por el método personalizado
 
 
           contador_paginas_total += 1
           'If contador_paginas_total = 1 Then
           '    tabla6.WriteSelectedRows(0, -1, 28.2, 552, writer.DirectContent())
           'tabla5.writeselectedrows(0, -1, 28.4, 132, writer.DirectContent())
           'tabla3.WriteSelectedRows(0, -1, 28.4, 190, writer.DirectContent())
 
           '    tabla0.WriteSelectedRows(0, -1, 315, 700, writer.DirectContent())
 
           '    tabla1.WriteSelectedRows(0, -1, 28.4, 600, writer.DirectContent())
           'End If
           'If contador_paginas_total = 1 Then
 
           tabla7.WriteSelectedRows(0, -1, 22.0, 571.5, writer.DirectContent())
 
 
           'tabla5.writeselectedrows(0, -1, 28.4, 132, writer.DirectContent())
 
           tabla3.WriteSelectedRows(0, -1, 22, 195, writer.DirectContent())
 
           tabla0.WriteSelectedRows(0, -1, 325, 720, writer.DirectContent())
 
           tabla1.WriteSelectedRows(0, -1, 22, 620, writer.DirectContent())
 

En caso de necesitar mas datos solo teneis que pedirlos..l

No se porque pasa eso de que solo aparezca en la ultima página...

PETTETE:
Ya he coinseguido resolverlo.

A sido una tontería, solo había que cambiar el orden de llamada de los SUBs.

Navegación

[0] Índice de Mensajes