Hi,
I’m using version 4.3 of Aspose.Slides. I have this data that comes from a datatable I want to display in a table on multiple slides. The problem is that when I set the height of the table, it seems to be irrelevant. The height just seems to automatically adjust depending on the number of rows.
Here’s the part of the code where I really start to implement the Aspose library.
foreach (SingleTable st in tablelist)
{
//*the table WAY OF DOING it
st.CheckDataTableColumn(st.TableContents);
st.CheckDataTableRows(st.TableContents);
Slide sld = pres.AddEmptySlide();
LoadMagNameandReleasedate(sld, b, pres);
int xPosition = 100;
int yPosition = 400;
int tableWidth = 5500;
int tableHeight = 0;
int columns = st.TableContents.Columns.Count;
int rows = st.TableContents.Rows.Count;
Aspose.Slides.Table table = sld.Shapes.AddTable(xPosition, yPosition, tableWidth, tableHeight, columns, rows);
table.AlternativeText =“mytable”;
table.SetBorders(0, Color.White);
for (int i = 0; i < rows; i++)
{
for (int k = 0; k < columns; k++)
{
TextFrame tabletf = table.GetCell(k, i).TextFrame;
tabletf.Paragraphs[0].Portions[0].FontHeight = 8;
tabletf.Paragraphs[0].Portions[0].FontIndex = GetFontIndex(“Arial”, pres);
tabletf.FitTextToShape();
tabletf.Paragraphs[0].Portions[0].Text = st.TableContents.Rows[i][k].ToString();
}
}
}
pres.Write(“C:\demo.ppt”);
}
I get this data from a .csv file and then break up the individual tables on the csv. Then I’m processing each datatable and displaying them on the slide. I attached a powerpoint so you can see the issue I’m having. Is there any way where I can make that table height static or possibly change something else so that too many rows doesn’t end up overflowing the size of the slide? Your help would be greatly appreciated.