Hi team,
Am successfully reading text file into data table.
with using data table, i created excel file.
but my Text file and Data table is having values like
Column1
-------------------------
01
10
(12)
but my output excel getting as
Column1
-------------------------
1
10
-12
here is my code
IWorksheet worksheet = workbook.Worksheets.Create(1);
string filter = "Table='" + sheetName.Value + "'";
DataView dtView = new DataView(dt, filter, "Code", DataViewRowState.CurrentRows);
worksheet.ImportDataTable(dtView.ToTable(), true, 1, 1);
worksheet.UsedRange.AutofitColumns();
Am using Microsoft 365 ProPlus.
After excel creation, i observed , my cell number format is General. due to this (13) converting as -13. but it should not do like.
for value 01 cases, can use worksheet.UsedRange.NumberFormat = "00#"; but in the same column it self my values in (13) also getting.
How can i achieve cell number format as Text.
Thanks for advance
J. Sateesh Kumar