It's a regression in 3.2. This demo used to work properly, at least in 3.1 it
was so.
Can you create a bug in bugzilla so that we have a public record for this bug? I will try to fix the problem by POI-3.5
which is expected in about a month time.
Yegor
I am fairly new to working with POI. I have been working on building a
PowerPoint from scratch, and so far it has gone fairly well. I have been
able to add pictures, and moves (using POI.3.2-FINAL).
But I am having problems with tables. I tried the example code for a table,
but when I run it, the bullets are not suppressed, and I can't get the
correct font size. Now this might be partly due to reading the PowerPoint
into Office 2007, but I assume that it should still be compatible.
I was able to get the bullet suppressed by still including
"rt.setBulletChar". If I comment out the line with setBulletChar, then the
bullets show up. I believe if I also suppress "cell.setVerticalAlignment" or
"cell.setHorizontalAlignment", once again the bullets appear.
But nothing I have down gets the setFontSize(10) to be recognized.
Is there something I am missing?
// TODO code application logic here
//table data
String[][] data = {
{"INPUT FILE", "NUMBER OF RECORDS"},
{"New Item File", "11,559"},
{"Vendor File", "300"},
{"Purchase History File", "10,000"},
{"Total # of requisitions", "10,200,038"}
};
SlideShow ppt = new SlideShow();
Slide slide = ppt.createSlide();
//create a table of 5 rows and 2 columns
Table table = new Table(5, 2);
for (int i = 0; i < data.length; i++) {
for (int j = 0; j < data[i].length; j++) {
TableCell cell = table.getCell(i, j);
RichTextRun rt = cell.getTextRun().getRichTextRuns()[0];
cell.setText(data[i][j]);
rt.setFontSize(10);
rt.setBullet(false);
rt.setBulletOffset(0); //bullet offset
rt.setTextOffset(1); //text offset (should be greater than
bullet offset)
rt.setBulletChar('\u2022'); //bullet character
cell.setVerticalAlignment(TextBox.AnchorMiddle);
cell.setHorizontalAlignment(TextBox.AlignCenter);
}
}
//set table borders
Line border = table.createBorder();
border.setLineColor(Color.black);
border.setLineWidth(1.0);
table.setAllBorders(border);
//set width of the 1st column
table.setColumnWidth(0, 300);
//set width of the 2nd column
table.setColumnWidth(1, 150);
slide.addShape(table);
table.moveTo(100, 100);
FileOutputStream out = new FileOutputStream("hslf-table.ppt");
ppt.write(out);
out.close();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]