We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PdfLightTable: Can''t draw table, because there is not enough space for it.

Thread ID:





97843 Jan 13,2011 07:58 AM UTC Jan 17,2011 11:30 AM UTC ASP.NET Web Forms (Classic) 1
Tags: PDF
David Grant
Asked On January 13, 2011 07:58 AM UTC

I have a report that prints a group header then detail lines in a PdfLightTable for each break group in a result set. The datasource for the table is PdfHeaderSource.Rows with the detail table being populated programatically as the process iterates through the result set, creating a new instance of the table with each break group.

My problem is that depending on where (y co-ordinate) on the page the table is to be drawn, I sometimes get this error - "Can't draw table, because there is not enough space for it." If I change the vertical spacing between elements on the page the error does not occur, change it back - get the error. All with the same result set. I am using the result.Bounds property to find where the last table finished and calculate the starting position of the next table. I have set

format.Break = PdfLayoutBreakType.FitPage; and
format.Layout = PdfLayoutType.Paginate;

Because it is the same data set with or without the error I do not believe it is problem with horizontal (column width) fit. It is vertical fit.

What have I missed in setting pagination? How can I determine what space is required and what space is available so as to avoid the problem?


Priyadharshini J [Syncfusion]
Replied On January 17, 2011 11:30 AM UTC

Hi David,

Thank you for the details.

We are not able to reproduce the issue. We can draw a PdfLightTable in a specified location using the result.Bounds property and also paginate bounds property of the PdfLightTableLayoutFormat as shown in the code below:

result.Bounds Property:

PdfLayoutResult result = table.Draw(page, new RectangleF(10, 60, 300, 0),format1);
PdfLayoutResult result1 = table.Draw(page, new RectangleF(result.Bounds.X, result.Bounds.Bottom+20, result.Bounds.Width, result.Bounds.Height), format1);

PaginateBounds Property:

PdfLightTableLayoutFormat format2 = new PdfLightTableLayoutFormat();
format2.Layout = PdfLayoutType.Paginate;
format2.Break = PdfLayoutBreakType.FitElement;
format2.PaginateBounds = new RectangleF(result.Bounds.X,(2* result.Bounds.Bottom)+20,400,0);

I have placed a simple sample for the same in the location below:

Kindly try this and also could you please provide more details about your exact requirement. This will help us a lot in further investigation.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon