diff --git a/API_NetFramework/bin/DOCGEN.dll b/API_NetFramework/bin/DOCGEN.dll index 13598d33..8ef9b4d7 100644 Binary files a/API_NetFramework/bin/DOCGEN.dll and b/API_NetFramework/bin/DOCGEN.dll differ diff --git a/API_NetFramework/bin/DOCGEN.pdb b/API_NetFramework/bin/DOCGEN.pdb index 121aebce..3a5fe2fb 100644 Binary files a/API_NetFramework/bin/DOCGEN.pdb and b/API_NetFramework/bin/DOCGEN.pdb differ diff --git a/API_NetFramework/bin/OnDoc_NetFramework.dll b/API_NetFramework/bin/OnDoc_NetFramework.dll index 81054e1a..750652f4 100644 Binary files a/API_NetFramework/bin/OnDoc_NetFramework.dll and b/API_NetFramework/bin/OnDoc_NetFramework.dll differ diff --git a/API_NetFramework/bin/OnDoc_NetFramework.pdb b/API_NetFramework/bin/OnDoc_NetFramework.pdb index d077c789..feaf1877 100644 Binary files a/API_NetFramework/bin/OnDoc_NetFramework.pdb and b/API_NetFramework/bin/OnDoc_NetFramework.pdb differ diff --git a/API_NetFramework/obj/Debug/API_NetFramework.csproj.AssemblyReference.cache b/API_NetFramework/obj/Debug/API_NetFramework.csproj.AssemblyReference.cache index 24487850..f5685152 100644 Binary files a/API_NetFramework/obj/Debug/API_NetFramework.csproj.AssemblyReference.cache and b/API_NetFramework/obj/Debug/API_NetFramework.csproj.AssemblyReference.cache differ diff --git a/API_NetFramework/obj/Debug/OnDoc_NetFramework.dll b/API_NetFramework/obj/Debug/OnDoc_NetFramework.dll index 81054e1a..750652f4 100644 Binary files a/API_NetFramework/obj/Debug/OnDoc_NetFramework.dll and b/API_NetFramework/obj/Debug/OnDoc_NetFramework.dll differ diff --git a/API_NetFramework/obj/Debug/OnDoc_NetFramework.pdb b/API_NetFramework/obj/Debug/OnDoc_NetFramework.pdb index d077c789..feaf1877 100644 Binary files a/API_NetFramework/obj/Debug/OnDoc_NetFramework.pdb and b/API_NetFramework/obj/Debug/OnDoc_NetFramework.pdb differ diff --git a/Client/Diverses/SplashScreen.Designer.cs b/Client/Diverses/SplashScreen.Designer.cs index 0223ba36..7fd71941 100644 --- a/Client/Diverses/SplashScreen.Designer.cs +++ b/Client/Diverses/SplashScreen.Designer.cs @@ -64,7 +64,7 @@ this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(156, 26); this.label2.TabIndex = 2; - this.label2.Text = "6. Januar 2025"; + this.label2.Text = "8. Januar 2025"; // // SplashScreen // diff --git a/Client/DocMgmt/Serienbrief.cs b/Client/DocMgmt/Serienbrief.cs index 0e4da73c..5897d9ce 100644 --- a/Client/DocMgmt/Serienbrief.cs +++ b/Client/DocMgmt/Serienbrief.cs @@ -465,7 +465,7 @@ namespace OnDoc.UIControls private void RibbonButtonNew_Click(object sender, EventArgs e) { - OnDoc.DocMgmt.DokTypSelect DokTypSelect = new OnDoc.DocMgmt.DokTypSelect(); + OnDoc.DocMgmt.DokTypSelect DokTypSelect = new OnDoc.DocMgmt.DokTypSelect(false); DokTypSelect.vorlagentype = 1; DokTypSelect.ShowDialog(this); if (DokTypSelect.DialogResult == DialogResult.OK) @@ -513,7 +513,7 @@ namespace OnDoc.UIControls { DOCGEN.DocGet dg = new DOCGEN.DocGet(AppParams.connectionstring); - string filedata = dg.get_word_vorlage(sb.officevorlagenr); + string filedata = dg.get_word_vorlage(sb.officevorlagenr, sb.dokumenttypnr); clsFileHelper fh = new clsFileHelper(); string tempfilename = ""; diff --git a/Client/UIControls/Administrator/AdminDokTypGenerierung.cs b/Client/UIControls/Administrator/AdminDokTypGenerierung.cs index 75cc049b..f6077b4e 100644 --- a/Client/UIControls/Administrator/AdminDokTypGenerierung.cs +++ b/Client/UIControls/Administrator/AdminDokTypGenerierung.cs @@ -117,6 +117,7 @@ namespace OnDoc.UIControls.Administrator try { cbbearbeitungzwingend.Checked = Convert.ToBoolean(r["bearbeitung_zwingend"]) == true; } catch { cbbearbeitungzwingend.Checked = false; } try { chkfilloffice.Checked = Convert.ToBoolean(r["FillOffice"]) == true; } catch { chkfilloffice.Checked = false; } + try { cbboxcompatibilitymode.Text = r["compatibilitymode"].ToString(); } catch { cbboxcompatibilitymode.Text = ""; } } private void sfButton1_Click(object sender, EventArgs e) diff --git a/Client/bin/Debug/DOCGEN.dll b/Client/bin/Debug/DOCGEN.dll index 13598d33..8ef9b4d7 100644 Binary files a/Client/bin/Debug/DOCGEN.dll and b/Client/bin/Debug/DOCGEN.dll differ diff --git a/Client/bin/Debug/DOCGEN.pdb b/Client/bin/Debug/DOCGEN.pdb index 121aebce..3a5fe2fb 100644 Binary files a/Client/bin/Debug/DOCGEN.pdb and b/Client/bin/Debug/DOCGEN.pdb differ diff --git a/Client/bin/Debug/OnDoc.exe b/Client/bin/Debug/OnDoc.exe index e88da815..02c341a7 100644 Binary files a/Client/bin/Debug/OnDoc.exe and b/Client/bin/Debug/OnDoc.exe differ diff --git a/Client/bin/Debug/OnDoc.pdb b/Client/bin/Debug/OnDoc.pdb index 6bcffdd0..513bc23f 100644 Binary files a/Client/bin/Debug/OnDoc.pdb and b/Client/bin/Debug/OnDoc.pdb differ diff --git a/Client/bin/Debug/OnDocClient.zip b/Client/bin/Debug/OnDocClient.zip index c6bb5f3e..6be0c333 100644 Binary files a/Client/bin/Debug/OnDocClient.zip and b/Client/bin/Debug/OnDocClient.zip differ diff --git a/Client/bin/Debug/de-DE/OnDoc.resources.dll b/Client/bin/Debug/de-DE/OnDoc.resources.dll index 80425e34..d1913996 100644 Binary files a/Client/bin/Debug/de-DE/OnDoc.resources.dll and b/Client/bin/Debug/de-DE/OnDoc.resources.dll differ diff --git a/Client/obj/Debug/Client.csproj.AssemblyReference.cache b/Client/obj/Debug/Client.csproj.AssemblyReference.cache index 4206f646..1b819113 100644 Binary files a/Client/obj/Debug/Client.csproj.AssemblyReference.cache and b/Client/obj/Debug/Client.csproj.AssemblyReference.cache differ diff --git a/Client/obj/Debug/Client.csproj.GenerateResource.cache b/Client/obj/Debug/Client.csproj.GenerateResource.cache index 663d395f..1c6318ff 100644 Binary files a/Client/obj/Debug/Client.csproj.GenerateResource.cache and b/Client/obj/Debug/Client.csproj.GenerateResource.cache differ diff --git a/Client/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/Client/obj/Debug/DesignTimeResolveAssemblyReferences.cache index 39df589c..0e71e64f 100644 Binary files a/Client/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/Client/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Client/obj/Debug/OnDoc.exe b/Client/obj/Debug/OnDoc.exe index e88da815..02c341a7 100644 Binary files a/Client/obj/Debug/OnDoc.exe and b/Client/obj/Debug/OnDoc.exe differ diff --git a/Client/obj/Debug/OnDoc.pdb b/Client/obj/Debug/OnDoc.pdb index 6bcffdd0..513bc23f 100644 Binary files a/Client/obj/Debug/OnDoc.pdb and b/Client/obj/Debug/OnDoc.pdb differ diff --git a/Client/obj/Debug/de-DE/OnDoc.resources.dll b/Client/obj/Debug/de-DE/OnDoc.resources.dll index 80425e34..d1913996 100644 Binary files a/Client/obj/Debug/de-DE/OnDoc.resources.dll and b/Client/obj/Debug/de-DE/OnDoc.resources.dll differ diff --git a/DOCGEN/Klassen/SyncFWord.cs b/DOCGEN/Klassen/SyncFWord.cs index ae896f35..bfe0d430 100644 --- a/DOCGEN/Klassen/SyncFWord.cs +++ b/DOCGEN/Klassen/SyncFWord.cs @@ -154,15 +154,16 @@ namespace DOCGEN.Klassen } - public string Generate_Word(string base64, clsDocData docdata, string img_UL="", string img_UR="",string img_faktura="") + public void set_compatibilitymode(ref WordDocument document,string force) { - string formattype = ""; - MemoryStream ms = new MemoryStream(Helper.EncodeExtensions.DecodeBase642ByteArray(base64)); - WordDocument document = new WordDocument(ms, FormatType.Automatic); CompatibilityMode compatibilityMode = document.Settings.CompatibilityMode; - Logging.Logging.Debug(compatibilityMode.ToString(), "ondoc sf", docdata.Dokumentid); + Logging.Logging.Debug(compatibilityMode.ToString(), "ondoc sf", force); switch (compatibilityMode) { + case CompatibilityMode.Word2003: + document.Settings.CompatibilityMode = CompatibilityMode.Word2010; + break; + case CompatibilityMode.Word2010: document.Settings.CompatibilityMode = CompatibilityMode.Word2010; break; @@ -170,9 +171,62 @@ namespace DOCGEN.Klassen document.Settings.CompatibilityMode = CompatibilityMode.Word2013; break; default: - //document.Settings.CompatibilityMode = CompatibilityMode.Word2003; + //document.Settings.CompatibilityMode = CompatibilityMode.Word2003; break; } + if (force != "" && force != "Standard") + { + if (force == "Word 2013") + { + document.Settings.CompatibilityMode = CompatibilityMode.Word2013; + Logging.Logging.Debug("Übersteuerung CompatibilityMode: neu" + force, "ondoc", ""); + } + if (force == "Word 2010") + { + document.Settings.CompatibilityMode = CompatibilityMode.Word2010; + Logging.Logging.Debug("Übersteuerung CompatibilityMode: neu" + force, "ondoc", ""); + } + + } + } + public string Generate_Word(string base64, clsDocData docdata, string img_UL="", string img_UR="",string img_faktura="") + { + string formattype = ""; + MemoryStream ms = new MemoryStream(Helper.EncodeExtensions.DecodeBase642ByteArray(base64)); + WordDocument document = new WordDocument(ms, FormatType.Automatic); + CompatibilityMode compatibilityMode = document.Settings.CompatibilityMode; + set_compatibilitymode(ref document, docdata.CompatibilityMode); + Logging.Logging.Debug(compatibilityMode.ToString(), "ondoc sf", docdata.Dokumentid); + //switch (compatibilityMode) + //{ + // case CompatibilityMode.Word2003: + // document.Settings.CompatibilityMode = CompatibilityMode.Word2010; + // break; + + // case CompatibilityMode.Word2010: + // document.Settings.CompatibilityMode = CompatibilityMode.Word2010; + // break; + // case CompatibilityMode.Word2013: + // document.Settings.CompatibilityMode = CompatibilityMode.Word2013; + // break; + // default: + // //document.Settings.CompatibilityMode = CompatibilityMode.Word2003; + // break; + //} + //if (docdata.CompatibilityMode !="" && docdata.CompatibilityMode != "Standard") + //{ + // if (docdata.CompatibilityMode=="Word 2013") + // { + // document.Settings.CompatibilityMode = CompatibilityMode.Word2013; + // Logging.Logging.Debug("Übersteuerung CompatibilityMode: neu" + docdata.CompatibilityMode, "ondoc", ""); + // } + // if (docdata.CompatibilityMode == "Word 2010") + // { + // document.Settings.CompatibilityMode = CompatibilityMode.Word2010; + // Logging.Logging.Debug("Übersteuerung CompatibilityMode: neu" + docdata.CompatibilityMode, "ondoc", ""); + // } + + //} //if (compatibilityMode == CompatibilityMode.Word2010) { document.Settings.CompatibilityMode = CompatibilityMode.Word2010; } //if (compatibilityMode > CompatibilityMode.Word2010) { document.Settings.CompatibilityMode = CompatibilityMode.Word2013; } formattype = document.ActualFormatType.ToString(); diff --git a/DOCGEN/bin/Debug/DOCGEN.dll b/DOCGEN/bin/Debug/DOCGEN.dll index 13598d33..8ef9b4d7 100644 Binary files a/DOCGEN/bin/Debug/DOCGEN.dll and b/DOCGEN/bin/Debug/DOCGEN.dll differ diff --git a/DOCGEN/bin/Debug/DOCGEN.pdb b/DOCGEN/bin/Debug/DOCGEN.pdb index 121aebce..3a5fe2fb 100644 Binary files a/DOCGEN/bin/Debug/DOCGEN.pdb and b/DOCGEN/bin/Debug/DOCGEN.pdb differ diff --git a/DOCGEN/clsDocGet.cs b/DOCGEN/clsDocGet.cs index 2df63116..b2862fc6 100644 --- a/DOCGEN/clsDocGet.cs +++ b/DOCGEN/clsDocGet.cs @@ -80,7 +80,7 @@ namespace DOCGEN return ""; } - public string get_word_vorlage(int vorlagenr) + public string get_word_vorlage(int vorlagenr, int dokumenttypnr) { DB db = new DB(connectionstring); string sql = "Select dbo.BinaryToBase64(vorlage) as Data from office_vorlage_datei where office_vorlage_dateinr=" + vorlagenr; @@ -88,7 +88,13 @@ namespace DOCGEN string base64 = db.dsdaten.Tables[0].Rows[0][0].ToString(); MemoryStream ms = new MemoryStream(Helper.EncodeExtensions.DecodeBase642ByteArray(base64)); WordDocument document = new WordDocument(ms, FormatType.Automatic); + db.Get_Tabledata("Select isnull(CompatibilityMode,'') from dokumenttyp where dokumenttypnr=" + dokumenttypnr.ToString(), false, true); + SyncFWord sfw = new SyncFWord("", ""); + sfw.set_compatibilitymode(ref document, db.dsdaten.Tables[0].Rows[0][0].ToString()); + sfw = null; var formattype_original = document.ActualFormatType; + + MemoryStream destms = new MemoryStream(); if (formattype_original.ToString().ToUpper() == "DOTMXXX") { diff --git a/DOCGEN/obj/Debug/DOCGEN.dll b/DOCGEN/obj/Debug/DOCGEN.dll index 13598d33..8ef9b4d7 100644 Binary files a/DOCGEN/obj/Debug/DOCGEN.dll and b/DOCGEN/obj/Debug/DOCGEN.dll differ diff --git a/DOCGEN/obj/Debug/DOCGEN.pdb b/DOCGEN/obj/Debug/DOCGEN.pdb index 121aebce..3a5fe2fb 100644 Binary files a/DOCGEN/obj/Debug/DOCGEN.pdb and b/DOCGEN/obj/Debug/DOCGEN.pdb differ