Hi,
Well, you need to add a line of code to display your text completely.
e.g..,
WS.Worksheets[0].Cells.ImportTwoDimensionArray(DoubleArray, 6,3);
WS.Worksheets[0].AutoFitColumn(3);
WS.Worksheets.ActiveSheetIndex = 0;
Thank you.
Hi,
And if you don't want to autofit cells in the columns and you just want to auto-span other cells if a cell's value is long, you may try to modify your code and it will work fine:
e.g.(you just need to declare your array variable for your data as)
var DoubleArray = new object[2,1];
Actually we treat null values as "" for Cells.ImportTwoDimensionArray() and that caused the two lines not to display properly. Any how, you may try the above option for the time being and we will figure it out soon.
Thank you.
Dear Amjad,
Best regards,
Hi,
Did you read my previous reply, I repeat it here again.
If you don't want to autofit cells in the columns and you just want to auto-span other cells if a cell's value is long, you may try to modify your code and it will work fine:
e.g.(you just need to declare your array variable based on your no. of your data (rows and columns)
//if you have 2 values (2 rows and 1 columns), you may declare your array as.
var DoubleArray = new object[2,1];
Actually we treat null values as "" for Cells.ImportTwoDimensionArray() and that caused the two lines not to display properly. Any how, you may try the above option for the time being and we will figure it out soon.
Thank you.
Thanks,
Hi,
Thanks for your patience.
Please try this fix.
In this fix,We use Cell.GetStyle and SetStyle method replace the property of Cell.Style.
If you want to set style of the cell, please change your codes as :
//Getting the style of the cell.
Style style = cell.GetStyle();
//Setting the property of the style.
.......
//Setting the style of the cell
cell.SetStyle(style);