update 20241125

This commit is contained in:
Stefan Hutter
2024-11-24 19:38:37 +01:00
parent 6bdbc4173e
commit 341ea50f06
281 changed files with 14362 additions and 180 deletions

View File

@@ -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();
}
}
}