| Subject: | iTextSharp.dll pdfPTable issue - poss bug |
I am using iTextSharp Assembly version 5.02.0. in a MS C# Visual 2008 windows application.
I am attempting to generate a simple summary sheet with data in three pdfPTables based on the data that I show on the screen. All of the data is present on the screen and in debugging I have determined that it is always being sent to the itextSharp.dll - but for some reason, one of the pdfPTables is not being printed out by the dll.
It is always the same pdfPTable - - all of the others work perfectly fine and I use very similar code to process them all .
I am wondering if there may a namespace issue or problem -
I have changed the order of the tables so that the one with the problem is printed either first, second or third and the order does not matter - they all work fine except this one.
and , to make things, worse, (of course) it sometimes works perfectly fine - I cannot identify where the problem may be in my own code - and I have debugged it extensively .
has anyone ever experienced this sort of thing before ???
Any help or insight would be appreciated - Thanks.
Following is the snippet of code that presents the problem - but the other tables are managed very similarly ..
PdfPTable SttTable = new PdfPTable(5);
SttTable.DefaultCell.Padding = 3;
SttTable.WidthPercentage = 100;
SttTable.DefaultCell.BorderWidth = 1;
SttTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
PdfPCell stateC = new PdfPCell(FormatPhrase("State"));
PdfPCell availC = new PdfPCell(FormatPhrase("Available"));
PdfPCell typeC = new PdfPCell(FormatPhrase("Assigned"));
PdfPCell minC = new PdfPCell(FormatPhrase("To Specialists"));
PdfPCell qtdC = new PdfPCell(FormatPhrase("to Contracts"));
SttTable.AddCell(stateC);
SttTable.AddCell(availC);
SttTable.AddCell(typeC);
SttTable.AddCell(minC);
SttTable.AddCell(qtdC);
SttTable.HeaderRows = 5; // this is the end of the table header
int i = 0;
// List the summary for each state
// in the form of a table
List StateSumm = new List(Available.Keys);
for (StateSumItems = 0; StateSumItems < StateSumm.Count; StateSumItems++)
{
ProdTotals prod = Available[StateSumm[StateSumItems]];
if (StateSumItems % 2 == 1)
SttTable.DefaultCell.BackgroundColor = altrow;
if (StateSumItems % 2 == 0)
SttTable.DefaultCell.BackgroundColor = White;
string state = prod.State;
SttTable.AddCell(FormatPhrase(state));
string item1 = prod.Available.ToString();
SttTable.AddCell(FormatPhrase(item1));
string item2 = prod.Assigned.ToString();
SttTable.AddCell(FormatPhrase(item2));
string item3 = prod.AssignedToProcessors.ToString();
SttTable.AddCell(FormatPhrase(item3));
string item4 = prod.AssignedToContracts.ToString();
SttTable.AddCell(FormatPhrase(item4));
citems++;
}
document.Add(SttTable);
| Posted: 03 Dec 2010 09:02 AM |
|