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. Image for the cookie policy date

DataTable Trouble

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

3 Replies

GM Geetha M Syncfusion Team March 4, 2011 12:08 PM UTC

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



VE victor elizondo March 4, 2011 06:02 PM UTC

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


GM Geetha M Syncfusion Team March 8, 2011 09:09 AM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon