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.

DataTable Trouble

Thread ID:

Created:

Updated:

Platform:

Replies:

98491 Mar 3,2011 07:33 PM Mar 8,2011 04:09 AM ASP.NET Web Forms (Classic) 3
loading
Tags: PDF
victor elizondo
Asked On March 3, 2011 07:33 PM

Hello

I have a problem that I didn't contemplated.

If I write a DataTable in a PDF Sheet with the line below:

PdfLightTableLayoutResult result = table.Draw(page, new PointF(10, 100), format) as PdfLightTableLayoutResult;

It works wonderful until a row(s) (actually a cell(s)) in the DataTable has a very large value(s) (See the attached image).

I think that the code above splits the text of the dataset into the cell in a few lines in the PDF file, but if the text in this example in the datatable has a lot of cells with a lot of text ocurrs the error in the image.

What kind of solution do i need? Make the text tinyer? How can I do this?

Best Regards.



datatable_f4a369c4.rar

Geetha M [Syncfusion]
Replied On March 4, 2011 07:08 AM

Hi Victor,

Thank you for your continued interest in Syncfusion products.

I am afraid that I am not able to reproduce the problem. I have placed the test sample in the following link:
F984912022904243.zip

Could you please try running it and send me the modified sample so that I can check and get back to you?

Regards,
Geetha


victor elizondo
Replied On March 4, 2011 01:02 PM

Hi

Thanks for the answer. I've atteched the code where you can see the error.

It's due the couple of lines below:

format.Break = PdfLayoutBreakType.FitElement;
format.Layout = PdfLayoutType.Paginate;

If in the code that I send you comment that lines everything will works fine.

Now, I also including a image and i would like to know if it's posible that the datatable in the PDF file had the same distribution of the grid, because in the dataset all the columns has the same width and that's not correct.

Best Regards.



Desktop_89b9653f.rar

Geetha M [Syncfusion]
Replied On March 8, 2011 04:09 AM

Hi Victor,

Thank you for the details.

I was able to reproduce the problem. It can be avoided by using PdfGrid. Following is the code snippet:

PdfGrid table = new PdfGrid();
table.DataSource = CreateDataTable();

table.Style.AllowHorizontalOverflow = true;
table.Columns[8].Width = 425;

PdfGridLayoutFormat format = new PdfGridLayoutFormat();
format.Break = PdfLayoutBreakType.FitElement;
format.Layout = PdfLayoutType.Paginate;

PdfGridLayoutResult result = table.Draw(page, new PointF(10, 100), format);

I have placed the modified sample in the following link:
F98491-222313712.zip

Please try this and let us know if you have any questions.

Regards,
Geetha


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.

;