Hi,
there is a problem with cell.Style.Rotation,
the style is done on all cell of the row and not on the cell only.
Regards
Hi,
there is a problem with cell.Style.Rotation,
the style is done on all cell of the row and not on the cell only.
Regards
Hi,
Thanks for considering Aspose.
Well, I find no problem,
Following is my code and attached is the output file.
It seems that when i use objSheet.Cells.InsertColumn(), the style of column 0 (or column left to inserted columns) is apply on inserted columns.
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
Cells cells = worksheet.Cells;
cells["A1"].Style.Rotation = 35;
cells["A1"].PutValue("test");
cells.InsertColumn(1);
cells["B1"].PutValue("test col 1");
workbook.Save("d:\\test\\cellsrotation.xls");
Hi,
Thanks for considering Aspose.
Well. the behaviour is the same as MS Excel (You may try to check it MS Excel). When you insert a column, MS Excel activates the format painter and by default the left most cell(s) (Left column's cells) formatting is applied to the newly inserted column's cell(s). Aspose.Cells follows the MS Excel standard so you are getting this behavior.
Thank you.
Ok, do you know how can i avoid this stupid "feature" ?
May be i can clear style on a column with aspose ?
Hi,
I think you may try remove the formats of those inserted cells in the column
E.g.,
Ok last question, third parameter of ClearFormats is endRow of the range, but i have no idea to how many row i have to Clear.
Is there another method which only take a column index in parameter ?
Same question for a row since i saw that there is the same "features" when we insert a row.
thanks for your help
I think you may try to use Cells.MaxDataRow and Cells.MaxDataColumn properties for your need to get the last row/column index which contains data.
E.g,
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
Cells cells = worksheet.Cells;
cells["A1"].Style.Rotation = 35;
cells["A1"].PutValue("test");
cells.InsertColumn(1);
cells["B1"].PutValue("test col 1");
int mrow = cells.MaxDataRow +1;
cells.ClearFormats(0,1,mrow,1);
workbook.Save("d:\\test\\cellsrotation.xls");
Thank you.
thanks a lot for your help.