-none- 2007-09-17 - By Paulo Soares
Back Use a PdfPTable, Table is not supported anymore.
Paulo
> -- --Original Message-- -- > From: itext-questions-bounces@(protected) > [mailto:itext-questions-bounces@(protected)] On > Behalf Of N@(protected) > Sent: Monday, September 17, 2007 2:42 PM > To: itext-questions@(protected) > Subject: [iText-questions] Problem with nested table > > Hi, > It's the first time I use this library (iTextSharp) and I've > some problem with nested table. Every time I've this exception: > "Adding a cell at the location (1,0) with a colspan of 1 and > a rowspan of 1 is illegal (beyond boundaries/overlapping)." > > The primary table is definde as (1,6) so I've one columns ad > six rows... > > Every row (cell) has a nested table inside it. The problem > start with the second row wich have a (2,2) table nested. > this is the code for the second row: > > Table tableSecondRiga = new Table(2, 2); > tableSecondRiga.AutoFillEmptyCells = false; > //tableSecondRiga.Height = (float)((4.1 / > CMTOINCH) * INCHTOPONTS); > Chunk mittenteHeaderChunk = new Chunk("Mittente", > new iTextSharp.text.Font(ITS.Font.TIMES_ROMAN, 16, > ITS.Font.BOLDITALIC, ITS.Color.WHITE)); > Chunk destinatarioHeaderChunk = new > Chunk("Destinatario", new > iTextSharp.text.Font(ITS.Font.TIMES_ROMAN, 16, > ITS.Font.BOLDITALIC, ITS.Color.WHITE)); > Cell mittenteHeader = new Cell(mittenteHeaderChunk); > Cell destinatarioHeader = new > Cell(destinatarioHeaderChunk); > mittenteHeader.HorizontalAlignment = Cell.ALIGN_MIDDLE; > destinatarioHeader.HorizontalAlignment = > Cell.ALIGN_MIDDLE; > mittenteHeader.BackgroundColor = ITS.Color.BLUE; > destinatarioHeader.BackgroundColor = ITS.Color.BLUE ; > mittenteHeader.Width = 50; > destinatarioHeader.Width = 50; > //mittenteHeader.Height = > (float)((0.8/CMTOINCH)*INCHTOPONTS); > destinatarioHeader.Width = (float)((0.8 / > CMTOINCH) * INCHTOPONTS); > //tableSecondRiga.AddCell(mittenteHeader, 1, 1); > //tableSecondRiga.AddCell(destinatarioHeader, 1, 2); > tableSecondRiga.AddCell(mittenteHeader, 0, 0); > tableSecondRiga.AddCell(destinatarioHeader, 0, 1); > tableSecondRiga.EndHeaders(); > // Mittente > Paragraph nomeMittentePar = new > Paragraph(mittente, new iTextSharp.text.Font > (ITS.Font.TIMES_ROMAN, 14)); > Paragraph indMittentePar = new > Paragraph(indirizzoMittente, new > iTextSharp.text.Font(ITS.Font.TIMES_ROMAN, 14)); > Paragraph capCittaMittentePar = new > Paragraph(capMittente + " " + cittaMittente, new > iTextSharp.text.Font(ITS.Font.TIMES_ROMAN, 14)); > Paragraph agenziaUoMittentePar; > if (mittente.CompareTo("Sogei") == 0) > agenziaUoMittentePar = new > Paragraph(descUOMittente, new > iTextSharp.text.Font(ITS.Font.TIMES_ROMAN, 14)); > else > agenziaUoMittentePar = new > Paragraph(agenziaMittente, new > iTextSharp.text.Font(ITS.Font.TIMES_ROMAN, 14)); > Cell mittenteValueCell = new Cell(); > mittenteValueCell.Add(nomeMittentePar); > mittenteValueCell.Add(indMittentePar); > mittenteValueCell.Add(agenziaUoMittentePar); > mittenteValueCell.Add(capCittaMittentePar); > mittenteValueCell.Width = 50; > //mittenteValueCell.Height = (float)((3.3 / > CMTOINCH) * INCHTOPONTS); > //tableSecondRiga.AddCell(mittenteValueCell, 2, 1); > tableSecondRiga.AddCell (mittenteValueCell, 1,0); > // Destinatario > Paragraph nomeDestinatarioPar = new > Paragraph(destinatario, new > iTextSharp.text.Font(ITS.Font.TIMES_ROMAN, 14)); > Paragraph indDestinatarioPar = new > Paragraph(indirizzoDestinatario, new > iTextSharp.text.Font(ITS.Font.TIMES_ROMAN, 14)); > Paragraph capCittaDestinatarioPar = new > Paragraph(capDestinatario + " " + cittaDestinatario, new > iTextSharp.text.Font(ITS.Font.TIMES_ROMAN, 14)); > Paragraph agenziaUoDestinatarioPar; > if (mittente.CompareTo("Sogei") == 0) > agenziaUoDestinatarioPar = new > Paragraph(descUODestinatario, new > iTextSharp.text.Font(ITS.Font.TIMES_ROMAN , 14)); > else > agenziaUoDestinatarioPar = new > Paragraph(agenziaDestinatario, new > iTextSharp.text.Font(ITS.Font.TIMES_ROMAN, 14)); > Cell destinatarioValueCell = new Cell(); > destinatarioValueCell.Add(nomeDestinatarioPar); > destinatarioValueCell.Add(indDestinatarioPar); > destinatarioValueCell.Add(agenziaUoDestinatarioPar); > destinatarioValueCell.Add (capCittaDestinatarioPar); > destinatarioValueCell.Width = 50; > //destinatarioValueCell.Height = (float)((3.3 / > CMTOINCH) * INCHTOPONTS); > //tableSecondRiga.AddCell(destinatarioValueCell, 2, 2); > tableSecondRiga.AddCell(destinatarioValueCell, 1, 1); > Cell riga2Cell = new Cell(tableSecondRiga); > //table.AddCell(riga2Cell, 1, 0); > table.AddCell(riga2Cell); > > I saw that someone posted this error thinking it wold be a > bug in 4.0.4, but with no response... Someone knows the solution??
Aviso Legal: Esta mensagem ? destinada exclusivamente ao destinat?rio. Pode conter informa? ?o confidencial ou legalmente protegida. A incorrecta transmiss?o desta mensagem n?o significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. ? proibido a qualquer pessoa que n?o o destinat?rio de usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ __ ____ ____ ____ ____ ____ ____ ____ ____ ____ iText-questions mailing list iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
|
|