Dynamic Data Spill Over on Slides when Creating a Table Using Aspose.Slides in C#

Hello Team,

We have been using Aspose Slides to create dynamic presentations that visualize and communicate data insights. One of the components we frequently use is the tables, which allow us to present data in an organized manner. However, we have encountered an issue related to dynamic data spillage of table over the slide boundaries.

Please find the image for your reference,
Screenshot (468).jpg (182.9 KB)

Please find the attached sample code for reference,
Create Table Function.docx (15.1 KB)

Thank you for considering our request for assistance. We eagerly await your response and advice on how to effectively handle dynamic data spillage of table within Aspose Slides.

Thanks!

@Rashique,
Thank you for contacting support. I am working on the issue and will get back to you as soon as possible.

@Rashique,
Please check your results using the latest version of Aspose.Slides for .NET if possible. If the issue persists, please share the following information:

  • additional standalone code example generating the data for the table
  • .NET target platform in your app
  • Aspose.Slides version you used

Please note that the code example you provided contains an unknown FirstRow entity. Please also share the standalone code example.

@andrey.potapov

Please find the attached zip file for the standalone code and sample ppt.

  • .NET target platform: .Net 5.0
  • Aspose.Slides version: Aspose.Slides.Net (23.1.0)

Data spill over.zip (29.0 KB)

I have hardcoded only 6 data rows to show in the single slide and the remaining data to display in subsequent slides. But in some cases, even 4 or 5 rows get spilled over, is there any possibility to fix this using table height or some other way?

Thanks

@Rashique,
Unfortunately, the ZIP file you provided does not contain the standalone code you mentioned.

@andrey.potapov Sorry please find this Zip file attached

Data spill over.zip (40.0 KB)

Thanks

@Rashique,
Thank you for the code example. I will get back to you as soon as possible.

@Rashique,
Could you please also share the code that calls the CreateTable method you provided?

@andrey.potapov
Please find the attached file for the code example
Data spill over code.docx (17.2 KB)

@Rashique,
Unfortunately, the code example is incomplete (the colWidth and 1rowHeight variables are unknown). Please share a standalone code example (and presentation file if you used one).

@andrey.potapov

Please find the zip file for code and presentation file

Data spill over.zip (43.6 KB)

Thanks

@Rashique,
Thank you for the code example. I see that you are filling in the table with data, and the number of rows may be such that the table extends beyond the slide’s boundaries. Could you please describe the expected result?

@andrey.potapov
The row data count will be 20 sometimes, So I have hardcoded only 6 data rows to show in the single slide and the remaining data to display in subsequent slides. But in some cases, even 4 or 5 rows get spilled over, is there any possibility to fix this using table height or some other way?

@Rashique,
If I understand you correctly, you want to split a large table so that each part of the table fits on the next slide. Could you please confirm?

@andrey.potapov

Yes, Exactly that is what I am looking for.

Thanks

@Rashique,
Unfortunately, this cannot be done automatically with Aspose.Slides. However, you can try to solve the task algorithmically. To split a large table into multiple parts that fit on separate slides, you can estimate the table’s height each time after adding a new row. If the table becomes too large, you need to delete the last row and start creating a new table on the next slide, also estimating its height.

You can get the slide height like this:

var slideHeight = presentation.SlideSize.Size.Height;

The table height can be estimated like this:

if (table.Y + table.Height > slideHeight)
{ 
    // 1. Remove the last row.
    // 2. Start a new table on the next slide.
}