Hi, 
I am trying to create a table where there are three layers of data:
Category, SubCategory and line item examples.
I iterate through a List and use getter methods to retrieve the
data.  The data is in line item by Sub Category, by Category order,
meaning that Category is the major sort.  The report is 10 columns.
I test to see if either the Category or subcategory are the same as
the last read.
When a new category or subcategory is  reached, I create a cell that
has colspan of 10 since I want the caption on the left and nothing
else on that row.  This seems to work fine, until I reach one that
is blank.  I test for null and do the following:
 
if (model2.getTherapeuticSubClass() == null) {
       Cell cell = new Cell("N/A");
       cell.setColspan(10);
       cell.setHorizontalAlignment(Element.ALIGN_LEFT);
       table2.addCell(cell);      //this is where it bombs when
blank
      } else if (model2.getTherapeuticSubClass() != null){
       Cell cell = new Cell();
       cell.setColspan(10);
       table2.addCell(model2.getTherapeuticSubClass());
 
The error I get is:
R java.lang.IndexOutOfBoundsException: reserve - incorrect
column/size

Does anyone see what I am doing wrong?

Thanks.

 

Tony Bono
 
 

Reply via email to