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.

Draw table beyond the page or end of the client area

Thread ID:

Created:

Updated:

Platform:

Replies:

75305 Jul 21,2008 06:11 AM Mar 18,2010 02:27 AM Windows Forms 13
loading
Tags: PDF
Dennis van der Stelt
Asked On July 21, 2008 06:11 AM

Hi there,

I've set margins and all, have drawn my little table and then do this

pdfTable.Draw(result.Page, new PointF(20, result.Bounds.Bottom + 30), format);

But unfortunatly, I try to draw this beyond the area where I'm allowed to draw and get the error "Can't draw table, because there is not enough space for it."

So how do I solve this? Try-Catch and solve the problem on a new page or anything? Or can this automatically be done?

Thanks,
Dennis


Sri Subhashini M [Syncfusion]
Replied On July 21, 2008 11:54 PM

Hi Dennis,

Thank you for your interest in Syncfusion PDF.

'Cant draw exception' has been thrown in PdfLightTable

The issue mentioned here is suspected to be a defect and we have sent this to our development team for more analysis. We will update you once we get back from them.

Please let me know if you need any further assistance.

Regards,
Suba



Dennis van der Stelt
Replied On July 23, 2008 03:29 AM

Well, this needs to go into production august 1 so if you guys fix this for us makes us decide if we buy the product or not!

I've got it working for 90% or so with an open source product. But I don't like open source because lack of support. So SyncFusion looked like it would work, but apparently I found two bugs. I can live with the first but this really has to be fixed, or an alternative has to be presented.

It's taking me huge amounts of time to produce nice looking PDFs with both this library as the open source library. Can't believe it's that hard.

I also think there need to be a lot more examples. I really don't care about drawing elipses and everything, but I do care A LOT about drawing tables and producing documents that span more than 1 page. But there aren't too many examples on that.


Sri Subhashini M [Syncfusion]
Replied On July 23, 2008 07:35 AM

Hi Dennis,

Sorry for the inconvenience caused.

We have noticed our devlopement team already. They are working with the issue with high priority. We will update you once I get back with them.

If possible, could you please update me the sample regarding the issue.

Regards,
Suba



Dennis van der Stelt
Replied On July 25, 2008 03:12 AM

It's actually quite easy what I did

page.Section.PageSettings.Margins.Bottom = 20;
result = pdfTable.Draw(page, new PointF(20, startDepth), format);
result = pdfTable2.Draw(result.Page, new PointF(20, result.Bounds.Bottom + 30), format);

pdfTable2 is drawn at the bottom of pdfTable1, but I add an additional 30 pixels. Because I set the bottom margin to 20, at some occasions the library is trying to draw in that 20 pixels margin and I get the exception. Or at least I think it's in that 20 pixels space.

It *MIGHT* have something to do with having no top margin, but I might be wrong there. You'll have to test it.


Administrator [Syncfusion]
Replied On July 25, 2008 09:17 AM

Hi Dennis,

I deeply regret for the inconvenience caused.

Could you please try the below sample.

http://www.syncfusion.com/support/user/uploads/Sample_564f8cd5.zip

Please let me know if you need any further details.

Regards,
Suba



Dennis van der Stelt
Replied On July 28, 2008 02:00 AM

Hi,

It works... But try setting the bottom margin to 600.

The page has a height of 842
The end of the first table is at 198

The space between the two tables should be 30, that's why we do result.Bounds.Bottom + 30 in the code.

Now imagine the row-height is about 15 or so.

198 + 30 + 15 = 243

The first row of the second table is drawn from height 228 to 242 (15 pixels heigh)
So when we can't draw the table there because of the margin, it throws the error.

Page height 842 - 243 = 599. So set the margin in line 179 of your example to 599 (or 600 to have a nice round number ;) and the drawing of the 2nd table will throw an exception.


Dennis van der Stelt
Replied On July 28, 2008 02:05 AM

This would work by the way, but I think this should be handled gracefully by the Syncfusion PDF library

try
{
result = table2.Draw(result.Page, new PointF(20, result.Bounds.Bottom + 30), format);
}
catch
{
page = doc.Pages.Add();
result = table2.Draw(page, new PointF(20, 20), format);
}


Sri Subhashini M [Syncfusion]
Replied On July 28, 2008 08:30 AM

Hi Dennis,

I regret for the inconvenience caused.

We have logged this as a issue and our development team is currently working on this. We will get back with you once the issue has been fixed.

Thank you for your patience.

Regards,
Suba



Administrator [Syncfusion]
Replied On March 17, 2009 08:34 AM

Even I am facing a similar issue. Has there been a fix to this (also mention the build number if there is one)


Geetha M [Syncfusion]
Replied On March 18, 2009 08:17 AM

Hi Ram,

Thank you for your interest in Syncfusion products.

I have forwarded your request to our development team and will update you once I hear back from them.

Regards,
Geetha


Geetha M [Syncfusion]
Replied On March 19, 2009 08:55 AM

Hi Ram,

Thank you for your patience.

The problem of Can't Draw exception will be corrected in PdfGrid table which will be available in our next public release. Meanwhile, could you please check if the below workaround suits you?

http://files.syncfusion.com/samples/Pdf.Windows/PdfLightTable/main.htm

Regards,
Geetha


Barry Shulam
Replied On March 5, 2010 03:31 PM

I am seeing the same error in 2010 vol1 8.103.0.30 which is the latest version.

Has this not fixed almost a year later?
Its holding up a new report.

Pravin Joshua D [Syncfusion]
Replied On March 18, 2010 02:27 AM

Hi Barry,

Thank you for your interest in Syncfusion products.

This is not an bug with our library. If we try to draw more number of columns on a particular page which does not have enough room available to accomodate all the columns, then this exception will be thrown. We need to workaround this by taking advantage of our PdfLightTableLayouter class and handle the horizontal overflow of columns to subsequent pages.

If you are able to reproduce the issue again, please report the issue with your sample through Direct Trac Developer Support Systemhttps://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well. If you have already reported, please ignore this.

Please let us know if you have any other questions.

Regards,
Pravin.


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.

;