update 20260303
This commit is contained in:
@@ -50,6 +50,7 @@ using Logging;
|
||||
|
||||
|
||||
|
||||
|
||||
namespace DOCGEN.Klassen
|
||||
{
|
||||
public class SyncFWord
|
||||
@@ -212,7 +213,34 @@ namespace DOCGEN.Klassen
|
||||
|
||||
switch (item.type.ToString())
|
||||
{
|
||||
|
||||
case "2":
|
||||
foreach (WSection section in document.Sections)
|
||||
foreach (WTextBody textBody in section.ChildEntities)
|
||||
{
|
||||
foreach (WFormField formField in textBody.FormFields)
|
||||
{
|
||||
if (formField.Name == item.field.ToString())
|
||||
{
|
||||
string type = formField.FieldType.ToString();
|
||||
if (type == "FieldFormDropDown")
|
||||
{
|
||||
WDropDownFormField cb = (WDropDownFormField)formField;
|
||||
if (item.itemvalue.ToString().ToUpper() != "")
|
||||
{
|
||||
int i = 0;
|
||||
foreach (WDropDownItem wd in cb.DropDownItems)
|
||||
{
|
||||
wd.Text = "";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
ReplaceBookmarkContent(ref document, item.itemname, "", item.itemvalue, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "4":
|
||||
case "7":
|
||||
case "8":
|
||||
@@ -413,10 +441,19 @@ namespace DOCGEN.Klassen
|
||||
//Iterates through form fields
|
||||
foreach (WFormField formField in textBody.FormFields)
|
||||
{
|
||||
if (formField.Name.ToString().ToUpper() == item.field.ToString().ToUpper() || formField.Name.ToString().ToUpper() == item.bmstart.ToString().ToUpper())
|
||||
string name = formField.Name;
|
||||
if (name=="") { name = item.bmstart.ToString(); }
|
||||
if (name != "")
|
||||
{
|
||||
formField.Text = item.itemvalue;
|
||||
break;
|
||||
if (formField.Name.ToString().ToUpper() == item.field.ToString().ToUpper() || formField.Name.ToString().ToUpper() == item.bmstart.ToString().ToUpper())
|
||||
{
|
||||
if (item.itemvalue == "Heidi Muster")
|
||||
{
|
||||
string a = "1";
|
||||
}
|
||||
formField.Text = item.itemvalue;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -424,6 +461,67 @@ namespace DOCGEN.Klassen
|
||||
|
||||
}
|
||||
|
||||
private IWTable CreateTableAtBookmark(BookmarksNavigator navigator, WordDocument document)
|
||||
|
||||
{
|
||||
|
||||
var bookmarkStart = navigator.CurrentBookmark?.BookmarkStart;
|
||||
|
||||
|
||||
|
||||
if (bookmarkStart != null)
|
||||
|
||||
{
|
||||
|
||||
var paragraph = bookmarkStart.OwnerParagraph;
|
||||
|
||||
|
||||
|
||||
if (paragraph != null)
|
||||
|
||||
{
|
||||
|
||||
if (paragraph.ChildEntities.Count > 0)
|
||||
|
||||
{
|
||||
|
||||
paragraph.ChildEntities.Clear(); // Remove existing content but keep the paragraph structure
|
||||
|
||||
}
|
||||
|
||||
//Get index of paragraph in the textBody which contains BookmarkStart
|
||||
|
||||
int index = paragraph.OwnerTextBody.ChildEntities.IndexOf(paragraph);
|
||||
|
||||
WTable table = new WTable(document);
|
||||
|
||||
//Insert table next to that paragraph
|
||||
// paragraph.OwnerTextBody.ChildEntities.RemoveAt(index+1);
|
||||
paragraph.OwnerTextBody.ChildEntities.Insert(index + 1 , table);
|
||||
|
||||
return table;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// If the bookmark's owner is a text body, add the table there
|
||||
|
||||
//if (bookmarkStart.Owner is IWTextBody textBodyFallback)
|
||||
|
||||
//{
|
||||
|
||||
// return textBodyFallback.AddTable();
|
||||
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
private void Insert_CLMTable(CLMDocItem item, ref WordDocument document)
|
||||
{
|
||||
|
||||
@@ -484,8 +582,13 @@ namespace DOCGEN.Klassen
|
||||
|
||||
//Bookmark bookmark = document.Bookmarks.FindByName(bm);
|
||||
//WSection section = GetOwnerEntity(bookmark.BookmarkStart) as WSection;
|
||||
IWTable table = new WTable(document);
|
||||
//IWTable table = section.AddTable();
|
||||
TextBodyPart part = bookmarkNavigator.GetBookmarkContent();
|
||||
|
||||
part.Clear();
|
||||
//IWTable table = new WTable(document);
|
||||
IWTable table = CreateTableAtBookmark(bookmarkNavigator, document);
|
||||
|
||||
|
||||
|
||||
if (headers.Count > 0 && headers.Count == dt.Columns.Count)
|
||||
{
|
||||
@@ -590,7 +693,9 @@ namespace DOCGEN.Klassen
|
||||
|
||||
}
|
||||
catch { }
|
||||
bookmarkNavigator.InsertTable(table);
|
||||
// bookmarkNavigator.InsertTable(table);
|
||||
bookmarkNavigator = null;
|
||||
//IWTable table = section.AddTable();
|
||||
//bookmark = null;
|
||||
//section = null;
|
||||
table = null;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -380,6 +380,7 @@ namespace DOCGEN
|
||||
converter.Settings.AutoDetectComplexScript = true;
|
||||
converter.Settings.ImageResolution = 640;
|
||||
converter.Settings.ImageQuality = 100;
|
||||
converter.Settings.PreserveFormFields = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -66,8 +66,6 @@ X:\docdemo\EDOKA_2024\DOCGEN\bin\Debug\EDOKA_Barcode.dll
|
||||
X:\docdemo\EDOKA_2024\DOCGEN\bin\Debug\BarcodeStandard.dll
|
||||
X:\docdemo\EDOKA_2024\DOCGEN\bin\Debug\EDOKA_Barcode.pdb
|
||||
X:\docdemo\EDOKA_2024\DOCGEN\bin\Debug\EDOKA_Barcode.dll.config
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\obj\Debug\DocGen.csproj.AssemblyReference.cache
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\obj\Debug\DocGen.csproj.CoreCompileInputs.cache
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\libSkiaSharp.dylib
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\x86\libSkiaSharp.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\x64\libSkiaSharp.dll
|
||||
@@ -91,8 +89,8 @@ E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\SkiaSharp.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.Chart.Base.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.Compression.Base.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.DocIO.Base.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.DocToPdfConverter.Base.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.ExcelToPdfConverter.Base.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.DocToPDFConverter.Base.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.ExcelToPDFConverter.Base.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.Licensing.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.OfficeChart.Base.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.Pdf.Base.dll
|
||||
@@ -115,6 +113,7 @@ E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\FastReport.Bars.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\FastReport.DataVisualization.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\FastReport.Editor.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Database.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Database.dll.config
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Helper.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Model.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\OnDocOffice.pdb
|
||||
@@ -123,6 +122,7 @@ E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\BarcodeLibVBDatamatrix.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\BarcodeLibVBDatamatrix.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\BitMiracle.LibTiff.NET.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Logging.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Logging.dll.config
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Newtonsoft.Json.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\NLog.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\NLog.Database.xml
|
||||
@@ -132,8 +132,8 @@ E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\SkiaSharp.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.Chart.Base.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.Compression.Base.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.DocIO.Base.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.DocToPdfConverter.Base.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.ExcelToPdfConverter.Base.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.DocToPDFConverter.Base.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.ExcelToPDFConverter.Base.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.OfficeChart.Base.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.Pdf.Base.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.Presentation.Base.xml
|
||||
@@ -151,8 +151,8 @@ E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\vbBarcodes.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\vbBarcodes.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\FastReport.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.Shared.Base.xml
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\obj\Debug\DocGen.csproj.AssemblyReference.cache
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\obj\Debug\DocGen.csproj.CoreCompileInputs.cache
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\obj\Debug\DocGen.csproj.Up2Date
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\obj\Debug\DOCGEN.dll
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\obj\Debug\DOCGEN.pdb
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Logging.dll.config
|
||||
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Database.dll.config
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user