update 20241125
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Buffers.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
@@ -96,5 +97,27 @@ namespace DOCGEN.Klassen
|
||||
return Convert.ToBase64String(imageArray);
|
||||
|
||||
}
|
||||
|
||||
public void get_values(ref System.Data.DataTable dt, string excelfile)
|
||||
{
|
||||
ExcelEngine ex = new ExcelEngine();
|
||||
IApplication app = ex.Excel;
|
||||
MemoryStream ms = new MemoryStream(Helper.EncodeExtensions.DecodeBase642ByteArray(excelfile));
|
||||
IWorkbook workBook = app.Workbooks.Open(ms, ExcelOpenType.Automatic);
|
||||
foreach (System.Data.DataRow dr in dt.Rows)
|
||||
{
|
||||
int row = 0;
|
||||
int col = 0;
|
||||
row = Convert.ToInt32(dr["rowindex"]);
|
||||
col = Convert.ToInt32(dr["columnindex"]);
|
||||
|
||||
string value = workBook.Worksheets[Convert.ToInt32(dr["sheets"])].Range[row, col].Value.ToString();
|
||||
dr["value"] = value;
|
||||
}
|
||||
workBook.Close();
|
||||
workBook = null;
|
||||
ex.Dispose();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user