I am in the process of converting an Excel spreadsheet project into ASP.NET with Aspose Cells. There are a series of Excel macros that run and part of the process requires that all the rows and columns get selected then the macro does a paste special with Transpose true to transpose the rows and colums. This results in the data reading as rows across the sheet rather of colums down the sheet. Is there a feature like this in Aspose Cells? If not, any idea how I can simulate it?
Aspose.Cells doesn't have such a paste special feature. But it's very easy to transpose the values. For example:
Workbook wb = new Workbook();
wb.Open("d:\\test\\book1.xls");
object[,] data = wb.Worksheets[0].Cells.ExportArray(0, 0, 3, 3);
for(int i = 0; i < 3; i ++)
for(int j = 0; j < 3; j ++)
wb.Worksheets[0].Cells[i, j].PutValue(data[j, i]);
wb.Save("d:\\test\\abc.xls");