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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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?

Thanks,
David


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

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);
table.Draw(page,format2.PaginateBounds,format2);


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

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

Regards,
Priyadharshini.


CONFIRMATION

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.

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.

;