Free Support Forum - aspose.com

Cant set table height

Hello, i’ve got a problem, i can’t set dynamically the height of a table. The table contains several columns and lines. But i can change the width.

table.setHeight(2000); //DOESNT WORK
table.setWidth(2000); //WORK

Do you know why ? Thanks.

Dear Spypunk,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Actually, it is bug, e.g if you read the table height before setting it, it will set the height successfully, but if you don’t do so, it will not.

Just comment the line marked by me; the table height will not be set.

We will fix it as soon as possible.

Presentation pres = new Presentation();

Slide sld = pres.getSlideByPosition(1);

Table tbl = sld.getShapes().addTable(100, 100, 200, 200, 3, 2);

//comment this line

int ht=tbl.getHeight(); //because of this line, it sets height successfully

tbl.setHeight(2000);

tbl.setWidth(2000);

pres.write(new FileOutputStream("c:\\out.ppt"));