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

Free Support Forum - aspose.com

Insert new column row value

Hi, is it possible to insert a column value right next after a column row is printed? Attachment is my sample output

Hi Ninj,

Thanks for your posting and considering Aspose.Cells.

You can create your expected output file with the following sample code. I have attached the output xlsx file generated by this code and screenshot for your reference.

As you can see, it uses Cell.PutValue() method to put value inside the cell and Worksheet.Comments.Add() method to add the comments inside the cell.

If you have any other requirement, please let us know we will look into it and help you asap.

C#


Workbook workbook = new Workbook();


Worksheet worksheet = workbook.Worksheets[0];


Cell cell = worksheet.Cells[“A1”];

cell.PutValue(“Code”);


cell = worksheet.Cells[“B1”];

cell.PutValue(“Description”);


cell = worksheet.Cells[“A2”];

cell.PutValue(“AA”);


cell = worksheet.Cells[“B2”];

cell.PutValue(“Post 1”);


int idx = worksheet.Comments.Add(“B3”);

Comment comment = worksheet.Comments[idx];

comment.Note = “This is a comment”;



cell = worksheet.Cells[“A4”];

cell.PutValue(“BB”);


cell = worksheet.Cells[“B4”];

cell.PutValue(“Post 2”);


idx = worksheet.Comments.Add(“B5”);

comment = worksheet.Comments[idx];

comment.Note = “Another comment will be here.”;


workbook.Save(“output.xlsx”);