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
close icon

format table cells

I have created a table to be published from a dataset. Is there any way to go through the cells of the pdf table and change the width/height based on the the data that is in that cell?

3 Replies

AJ Ajish Syncfusion Team March 21, 2006 09:02 AM UTC

Hi Matt, We can change the width/height of rows and columns based on the data that in that cell. 1) To change the column width use table.Columns[ index ].Width 2) To change the row height use table.Rows[index].Height 3) To get the Column name of the data source use table.Columns[ index ].DataColumnName 4) To measure the size of the string use MeasureString() Method of IPDFGraphics. Please let me know if you have any other questions. Regards, Ajish. Here is a sample for you to refer >I have created a table to be published from a dataset. Is there any way to go through the cells of the pdf table and change the width/height based on the the data that is in that cell?


AD Administrator Syncfusion Team March 21, 2006 05:46 PM UTC

I see in that example, measureString is used on the dataColumnName, but I want to measure the string that is in the cell. I have tried using Table.rows(i).cells(j).Value to get the contents of the cell, but that always returns a null value. Is there a way to get the contents of the table cell? >Hi Matt, > >We can change the width/height of rows and columns based on the data that in that cell. > >1) To change the column width use > >table.Columns[ index ].Width > > >2) To change the row height use > > >table.Rows[index].Height > > >3) To get the Column name of the data source use > > >table.Columns[ index ].DataColumnName > > >4) To measure the size of the string use MeasureString() Method of IPDFGraphics. > >Please let me know if you have any other questions. > >Regards, >Ajish. > > >Here is a sample for you to refer > > > >>I have created a table to be published from a dataset. Is there any way to go through the cells of the pdf table and change the width/height based on the the data that is in that cell?


AJ Ajish Syncfusion Team March 22, 2006 11:14 AM UTC

Hi Matt, Currently in Essential PDF, it is only possible to set the height of the entire row or width of the entire column as whole it is not possible to have separate width/height dimension for a single cell. Regarding cell value issue table.Row[ index].cell[index]. Value is used to set value to a particular cell and it cannot be used to get value of the cell. However I will consult with development team and will update you when I hear back. Thanks, Ajish.

Loader.
Live Chat Icon For mobile
Up arrow icon