Thanks for your posting and using Aspose.Cells for .NET.
Please use the Style.IndentLevel property to indent your cell text. It will fulfill your needs.
Please check the following code for your more help about indenting text. The code also illustrates how to access the cell using column and row indices or using cell name.
I have attached the screenshot and output xlsx file generated by this code for your reference.
C#
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
int r=2;
int c=2;
//Access cell C3 using row and column
Cell cell = worksheet.Cells[r, c];
//You can also access Cell C3 using its name like this
Please see the sample code below with the template file (attached) for your reference. Hopefully it will fit your needs on how to specify indent level for cells based on some range of data. The output file is also attached.
Sample code:
Worksheet worksheet = workbook.Worksheets[0];
Cells cells = worksheet.Cells;
int row = 0;
int col = CellsHelper.ColumnNameToIndex(“G”);
Style style;
//Browse first ten rows.
for (int i = 0; i < 10; i++)
{
row = i;
style = cells[i, 0].GetStyle();
style.IndentLevel = cells[i, col].IntValue;
cells[i, 0].SetStyle(style);
}
workbook.Save(“e:\test2\outIndentBook.xlsx”);
Let us know if you need anything else or you have other requirements.