I have used the below code to write data into Excelsheet.
File.WriteAllText(@"C:\CourtInitiationFiles\ExportExcel.xlsx", "Court initiation"); -- For Main heading purpose
File.AppendAllText(@"C:\CourtInitiationFiles\ExportExcel.xlsx", sb.ToString()); --
Actual data (It contains column header and values.)
After this my excel looks like below..
Court Initiation -- Wrong place
S.No Name &nb ...
Go to the complete details ...