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

@@ -49,7 +49,7 @@ namespace DOCGEN.Generator
DataTable dt = new DataTable();
DataTable dt2 = new DataTable();
string Apptype = "";
dt = db.Get_Vorlage_By_DokumentID(dokumentid);
dt = db.Get_Vorlage_By_DokumentID(dokumentid,useoffice);
db.dsdaten.Tables.Clear();
dt2 = db.Get_ApplicationType_from_Vorlage(Convert.ToInt32(dt.Rows[0]["nr"].ToString()));
Apptype = dt2.Rows[0][0].ToString();

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DOCGEN.Klassen
{
public class Excel_Reader
{
public void get_valus_from_excel(ref System.Data.DataTable dt, string excel)
{
SyncFExcel se = new SyncFExcel();
se.get_values(ref dt, excel);
foreach (System.Data.DataRow dr in dt.Rows)
{
DOCGEN.Klassen.Excel_Reader er = new DOCGEN.Klassen.Excel_Reader();
}
}
}
}

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