We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Issue with keeping table from overflowing on the slide


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
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.Paragraphs[0].Portions[0].Text = st.TableContents.Rows[i][k].ToString();

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.

Hi Jeffery,

Please try using Aspose.Slides for .NET 5.9.0 for your investigation as it is the latest version available. Please also visit the thread link 1, link 2 and link 3 for your kind reference. Please share the working code project if there is still an issue along with source data. You may need to devise your own logic for table data overflowing the slide size as well.

<span style=“font-size:9.0pt;line-height:115%;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>Many Thanks,