Bilder werdem erstellt

This commit is contained in:
HuskyTeufel
2020-03-31 18:34:36 +02:00
parent f83ec8cfcd
commit f8a324210b
5 changed files with 98 additions and 5 deletions

View File

@@ -81,6 +81,77 @@ namespace BerichtGen
wordDocument.MailMerge.Execute(fieldnames, fieldvalues);
IWParagraph iWParagraph = null;
var x = wordDocument.Sections;
foreach(IWSection section in wordDocument.Sections)
{
IWParagraphCollection paragraphs = section.Paragraphs;
foreach(IWParagraph item2 in paragraphs)
{
if (item2.Text.StartsWith("@WeitereBilder")) {
iWParagraph = item2;
if(bilderObjects.Count > 0)
{
//section.ChildEntities.Clear();
iWParagraph.Text = "Weitere Bilder";
iWParagraph.AppendBreak(BreakType.LineBreak);
IWTable wTable = section.Body.AddTable();
wTable.ResetCells(1, 2);
wTable.TableFormat.IsAutoResized = true;
wTable.TableFormat.IsBreakAcrossPages = false;
wTable.TableFormat.Borders.BorderType = BorderStyle.Dot;
WTableRow wTableRow = wTable.Rows[0];
bool flag = false;
int num = -1;
foreach (BilderObject foto in bilderObjects)
{
if (num == -1)
num++;
if (flag)
{
wTableRow = wTable.AddRow();
flag = false;
}
int index = 1;
if (num % 2 == 0)
{
index = 0;
flag = false;
}
else
{
flag = true;
}
iWParagraph = wTableRow.Cells[index].AddParagraph();
Image image2 = _listImages[num];
if (image2 != null)
{
iWParagraph.AppendPicture(image2);
if (foto != null)
{
iWParagraph.AppendBreak(BreakType.LineBreak);
IWTextRange wTextRange = iWParagraph.AppendText(foto.Kommentar);
wTextRange.CharacterFormat.FontName = "Arial";
wTextRange.CharacterFormat.FontSize = 10f;
}
}
num++;
}
}
else
{
iWParagraph.Text = "";
}
break;
}
}
}
if(erzeugeDOC)
wordDocument.Save(Path.Combine(savepath,string.Format("{0}.doc",filename)), Syncfusion.DocIO.FormatType.Doc);

View File

@@ -22,6 +22,7 @@ namespace BerichtGen
ChartControl chartControl = new ChartControl();
chartControl.Size = size;
ChartAxis axis = chartControl.PrimaryYAxis;
@@ -30,7 +31,7 @@ namespace BerichtGen
layout1.Spacing = 12;
layout1.Axes.Add(axis);
@@ -40,6 +41,7 @@ namespace BerichtGen
int counter = 0;
foreach (UVcsvStrukture pars in input)
{
@@ -73,7 +75,7 @@ namespace BerichtGen
axis.TitleFont = new Font("Segeo UI", 14F);
chartControl.LegendsPlacement = ChartPlacement.Outside;
chartControl.LegendPosition = ChartDock.Bottom;
chartControl.LegendAlignment = ChartAlignment.Center;