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

Free Support Forum - aspose.com

Import Data in worksheet columnwise and rowwise

Hi


I have a worksheet and I want to import data from Data table into worksheet column wise and Row wise separately. Please suggest how can I do that?
Note: I am getting a warning message while using ImportDataColumn function that this method is now obsolete, please use importData instead.

Also, how can I change a cell Numberformat to '@'

Thanks

Hi Richa,


Could you please elaborate your requirement with the help of an example? Are you looking for a Transpose function to convert the rows to columns and vice versa?
Hi,

richagupta:
Note: I am getting a warning message while using ImportDataColumn function that this method is now obsolete, please use importData instead.

I have checked the latest release of Aspose.Cells for .NET 8.5.2.2, the Cells.ImportDataColumn method is not present in this revision of the API so you have to change the logic accordingly.

richagupta:
Also, how can I change a cell Numberformat to '@'

Please check the detailed article on Setting Number Format for your concerns as stated above. Please note, you can set the Style.Number property to 49 in order to mimic the @ format. Please check the following piece of code for better understanding.

C#

var document = new Workbook("D:/book1.xlsx"); var cells = document.Worksheets[0].Cells; //Get the Style from the cell or create a new one using Workbook.CreateStyle method var style = cells["A1"].GetStyle(); //Set Number property to 49 style.Number = 49; //Set the Style to the cell cells["A1"].SetStyle(style);