diff --git a/BerichtGen/Bericht.cs b/BerichtGen/Bericht.cs index 2be8e89..3af7b14 100644 --- a/BerichtGen/Bericht.cs +++ b/BerichtGen/Bericht.cs @@ -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); diff --git a/BerichtGen/makeGraphic.cs b/BerichtGen/makeGraphic.cs index c8a2b77..f52eacb 100644 --- a/BerichtGen/makeGraphic.cs +++ b/BerichtGen/makeGraphic.cs @@ -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; diff --git a/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs b/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs index bb0fbb6..72b3499 100644 --- a/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs +++ b/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs @@ -29,7 +29,7 @@ namespace KlassenBIB string linerTyp; double harzbedarf = 1.8; uint rueckholgeschwindigkeit; - bool geschlosseneEnde = false; + bool geschlosseneEnde = false; // Todo Rausschmeißen bool preliner = false; DateTime anfangAushaertung; DateTime endeAushaertung; @@ -191,7 +191,7 @@ namespace KlassenBIB grunddaten["time_start"] = this.AnfangAushaertung; grunddaten["time_ende"] = this.EndeAushaertung; grunddaten["preliner_verwendet"] = this.Preliner ? "ja" : "nein"; - grunddaten["geschlossene_ende"] = this.GeschlosseneEnde ? "Geschlossenes" : "Offenes"; + grunddaten["geschlossene_ende"] = Inspektionsobjekt.GeschlossenesEnde ? "Geschlossenes" : "Offenes"; grunddaten["UVImageTemp"] = Path.Combine(destinationPath, "linerGraph_temp.jpg"); grunddaten["UVImageDruck"] = Path.Combine(destinationPath, "linerGraph_druck.jpg"); diff --git a/SanSystem/UCInliner.cs b/SanSystem/UCInliner.cs index f02bd0a..95c03ff 100644 --- a/SanSystem/UCInliner.cs +++ b/SanSystem/UCInliner.cs @@ -302,7 +302,27 @@ namespace SanSystem Hashtable hashtable = inliner.MakeProtokoll(destinationPath, Database.Datenbank.Instance.loadedProjekt,inliner.Offset); DirectoryInfo directory = Directory.GetParent(destinationPath); string speicherpfad = directory.FullName; - BerichtGen.FrmOptions options = new BerichtGen.FrmOptions("JUME", "liner_einbauBlueLight.docx", speicherpfad, inliner.Inspektionsobjekt.Objektbezeichnung, hashtable, new List()); + List bilderObjects = new List(); + foreach(Sanierung xsan in inliner.Inspektionsobjekt.Sanierung ) + { + // Debugger.Break(); + if (xsan is SchachtAnbindung) + { + SchachtAnbindung schacht = (xsan as SchachtAnbindung); + + foreach(SavedBilder bild in schacht.SavedBilders) + { + bilderObjects.Add(new BilderObject() + { + Path = bild.Speicherpfad, + Kommentar = string.Format("{0} von Schacht: {1}", bild.Bildname, schacht.SchachtNummer) + }); + } + + + } + } + BerichtGen.FrmOptions options = new BerichtGen.FrmOptions("JUME", "liner_einbauBlueLight.docx", speicherpfad, inliner.Inspektionsobjekt.Objektbezeichnung, hashtable, bilderObjects); options.ShowDialog(); } } diff --git a/SanSystem/documents/JUME/liner_einbauBlueLight.docx b/SanSystem/documents/JUME/liner_einbauBlueLight.docx index 6c7163a..8a12228 100644 Binary files a/SanSystem/documents/JUME/liner_einbauBlueLight.docx and b/SanSystem/documents/JUME/liner_einbauBlueLight.docx differ