Reputation: 27
I have 9 columns and I want to sum value of each column in ClosedXML.
These are the columns :
foreach (Attivita attivita in listaSomthing)
{
worksheet.Cell(index, 1).Value = attivita.Somthing;
worksheet.Cell(index, 2).Value = attivita.Somthing;
worksheet.Cell(index, 3).Value = attivita.Somthing;
worksheet.Cell(index, 4).Value = attivita.Somthing;
worksheet.Cell(index, 5).Value = attivita.Somthing;
worksheet.Cell(index, 6).Value = attivita.Somthing;
worksheet.Cell(index, 7).Value = attivita.Somthing;
worksheet.Cell(index, 8).Value = attivita.Somthing;
worksheet.Cell(index, 9).Value = attivita.Somthing;
}
I need to sum total of Cell(index, 1), Cell(index, 2)...Cell(index, 9).
And this is the table:
I didn't find any useful info in the ClosedXML documentation.
Can anyone help me, please?
Thanks in advance!
Upvotes: 1
Views: 6230
Reputation: 86
There are two ways:
For the first option you can find something inside the documentation
https://github.com/ClosedXML/ClosedXML/wiki/Using-Formulas
Upvotes: 3