You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "ORANSKY, JEFF" <jo...@att.com> on 2012/02/29 18:15:08 UTC

Hslf issue adding cell borders individually

I am having an issue setting borders in specific cells of a table use the hslf API for POI.  I am creating a table for Powerpoint and in the last column I want to put borders around that column.  This is from my code:

                  TableCell cell = table.getCell(tableRow, tableColumn);
                                if (tableColumn == lastColumn) {
                                        if (tableRow == 1) {
                                                cell.setBorderTop(borderLine);
                                        }
                                        if (tableRow == lastRow) {
                                                cell.setBorderBottom(borderLine);
                                        }
//                                      if (tableRow > 0) {
//                                              cell.setBorderLeft(borderLine);
//                                              cell.setBorderRight(borderLine);
//                                      }
                                }

If I just set the top border in row one it comes out fine, then I uncomment the tableRow == lastRow to set the bottom border and not only do no borders show up, but the table is completely collapsed and  you have to select the bottom and drag to resize the table.

Any idea why this is happening?


Jeff Oransky
Technical Architect, ACSI
Office: (925)901-7379
Cell: (925) 548-2786
jo8461@att.com




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Hslf issue adding cell borders individually

Posted by Yegor Kozlov <ye...@dinom.ru>.
Can you post full Java code that generates a collapsed table?

Yegor
On Wed, Feb 29, 2012 at 9:15 PM, ORANSKY, JEFF <jo...@att.com> wrote:
> I am having an issue setting borders in specific cells of a table use the hslf API for POI.  I am creating a table for Powerpoint and in the last column I want to put borders around that column.  This is from my code:
>
>                  TableCell cell = table.getCell(tableRow, tableColumn);
>                                if (tableColumn == lastColumn) {
>                                        if (tableRow == 1) {
>                                                cell.setBorderTop(borderLine);
>                                        }
>                                        if (tableRow == lastRow) {
>                                                cell.setBorderBottom(borderLine);
>                                        }
> //                                      if (tableRow > 0) {
> //                                              cell.setBorderLeft(borderLine);
> //                                              cell.setBorderRight(borderLine);
> //                                      }
>                                }
>
> If I just set the top border in row one it comes out fine, then I uncomment the tableRow == lastRow to set the bottom border and not only do no borders show up, but the table is completely collapsed and  you have to select the bottom and drag to resize the table.
>
> Any idea why this is happening?
>
>
> Jeff Oransky
> Technical Architect, ACSI
> Office: (925)901-7379
> Cell: (925) 548-2786
> jo8461@att.com
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org