We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Importing datatable into excel

Hi ,

I am inporting datatable into excel shhet everything is working fine but if the length of name in particular column is greater than the width it is giving lines in between (i think it is shrinking to fit) .Later i am converting this excel t pdf even the lines are coming there .Can you tel me how i can fit the name into the cell without breaking .

I am using

worksheet.Cells.ImportDataTable(dt, false, "A28");

dt is datatable which has values into it dynamically .

Please help me regarding this as i am new to aspose.

Thank you,

Bindu.

Hi Bindu,

I think you may try to auto-fit columns and rows for your need.

e.g..,

worksheet.Cells.ImportDataTable(dt, false, "A28");

worksheet.AutoFitColumns();

worksheet.AutoFitRows();

For further reference, please check: http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/autofit-rows-columns.html

Thank you.

Hi ,

Thank you for the reply but i have the column which is merged from 3 columns and autofit rows and columns donot work with merged columns .Can you please let me know if there is a work around for this.

Even i include autofit rows and columns it is not working.

Thanks in Advance,

Bindu.

Hi Bindu,

Which version of Aspose.Cells for .NET you are using. Could you try the attached version, please?

If the problem still persists, kindly post your created file here, we will check it soon.

Thank you.

[Hi,

I am using aspose 4.3.3.1 .I have attached my generated file.I downloaded the dll you have sent but it stil didnot fix my problem.Can u please look into it.

Thank You,

Bindu.

Hi Bindu,

Please try this fix. We have fixed the bug of AutoFitRows when the cell is merged.