Dear All,
I prepaid below Excel sheel through c# converted from DataTable to Excel thorugh Loop but the Last row I did manually in Excel.
What i need when my loop will finish then in Last row should be the Total in Excel and the row is not fixed my sometime row will be 5 may 50 whenever finish my loop then last should be Total like below.

Nilesh ShahRank #42 · 34.2K reputationPosted Oct 30, 2017, 12:08 PM EDT
when you loop thru your DB records, and write the same to excel, you must be storing somewhere the row index or row number to indicate current row in excel. I here assume it is rowIndex.
so when you completed your loop to write all rows, write this code.
Leon DRank #851 · 2.6K reputationPosted Oct 30, 2017, 6:02 PM EDT
SandyRank #2,015 · 718 reputationPosted Oct 30, 2017, 8:44 PM EDT