updfate 20250919

This commit is contained in:
Stefan Hutter
2025-09-19 14:20:47 +02:00
parent 98dc8ed0cb
commit d81d620468
2488 changed files with 1833953 additions and 103283 deletions

View File

@@ -203,6 +203,7 @@ namespace OnDocOffice
}
public string Generate_Excel_in_Office(ref clsDocData docdata, ref clsdok dok, string vorlage, string connectionstring, string tempdir, string dokumentid, string apptype, string extension, int OfficeSleep, int bookmarks_docio)
{
this.connectstring = connectionstring;
this.dokumentid = docdata.Dokumentid;
string filename = tempdir + dokumentid + "." + extension;
@@ -214,7 +215,8 @@ namespace OnDocOffice
Helper.clsFileHelper fh = new Helper.clsFileHelper();
fh.SaveBase64ToFile(vorlage, filename);
Start_Application();
workBook = excel.Workbooks.Add(filename);
workBook = excel.Workbooks.Open(filename);
//workBook = excel.Workbooks.Add(filename);
//workBook = excel.Workbooks.Open(filename);
foreach (Worksheet ws in workBook.Sheets)
{
@@ -246,6 +248,31 @@ namespace OnDocOffice
}
i = i + 1;
}
foreach (Worksheet ws in workBook.Sheets)
{
ws.Activate();
foreach (clsDocValue dv in docdata.DocValues)
{
try
{
if (dv.TMBeginn == "TGEDKCursor" || dv.TMBeginn == "TGEDKCursorB" || dv.FieldName == "TGEDKCursor" || dv.FieldName == "TGEDKCursorB")
{
try
{
excel.Range[workBook.Names.Item(dv.FieldName).NameLocal].Select();
cursor = true;
sheetcursor = i;
}
catch
{
}
}
}
catch { }
}
i = i + 1;
}
if (docdata.Barcode == true)
{
string barcode = Bar25I(dokumentid.Substring(6, 16));
@@ -349,11 +376,13 @@ namespace OnDocOffice
word.AutomationSecurity = Microsoft.Office.Core.MsoAutomationSecurity.msoAutomationSecurityByUI;
//word = new Microsoft.Office.Interop.Word.Application();
word.Run("Autoexec");
Logging.Logging.Debug("Nach AutoExec", "OnDoc", "Word bearbeiten");
word.NormalTemplate.Saved = true;
return true;
}
catch
catch (Exception ex)
{
Logging.Logging.Debug("AutoExex Error: " + ex.Message, "OnDoc", "Word bearbeiten");
return false;
}
}
@@ -2035,6 +2064,7 @@ namespace OnDocOffice
{
DB db=new DB(connectionstring);
clsdok dok = new clsdok("", "", "", "");
dok = db.GetDocumentAsBase64(dokumentid);
string SQL = "SELECT dbo.dokumenttyp.ErstellungInOffice FROM dbo.dokument INNER JOIN dbo.dokumenttyp ON dbo.dokument.dokumenttypnr = dbo.dokumenttyp.dokumenttypnr where dbo.dokument.dokumentid=@dokumentid";
db.clear_parameter();