From 846171aaacb3df18a38aeb8a4a71266468e823c7 Mon Sep 17 00:00:00 2001 From: Manuel Amstutz Date: Tue, 24 Sep 2024 14:59:15 +0200 Subject: [PATCH 1/3] Removed outdated Todo.txt --- Todo.txt | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 Todo.txt diff --git a/Todo.txt b/Todo.txt deleted file mode 100644 index a66ea7e..0000000 --- a/Todo.txt +++ /dev/null @@ -1,5 +0,0 @@ -- else blocks -- expression caching -- multiple process runs for a single template with different data -- Optimize IsolateAndMergeTextTemplateMarkers -- Refactor ExtractLoopContent - Simpler more generic solultion \ No newline at end of file From aacd98e7ae00a24829d5752946172a36ca2cacf0 Mon Sep 17 00:00:00 2001 From: Manuel Amstutz Date: Tue, 24 Sep 2024 15:01:47 +0200 Subject: [PATCH 2/3] Update-Nuget dependencies --- .../DocxTemplater.Images.csproj | 28 +++++++++---------- DocxTemplater.Test/DocxTemplater.Test.csproj | 8 +++--- DocxTemplater/DocxTemplater.csproj | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/DocxTemplater.Images/DocxTemplater.Images.csproj b/DocxTemplater.Images/DocxTemplater.Images.csproj index bec9516..f5a7671 100644 --- a/DocxTemplater.Images/DocxTemplater.Images.csproj +++ b/DocxTemplater.Images/DocxTemplater.Images.csproj @@ -1,15 +1,15 @@ - - - True - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + + True + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + \ No newline at end of file diff --git a/DocxTemplater.Test/DocxTemplater.Test.csproj b/DocxTemplater.Test/DocxTemplater.Test.csproj index 5142af6..9db41ff 100644 --- a/DocxTemplater.Test/DocxTemplater.Test.csproj +++ b/DocxTemplater.Test/DocxTemplater.Test.csproj @@ -11,10 +11,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/DocxTemplater/DocxTemplater.csproj b/DocxTemplater/DocxTemplater.csproj index 7f7e52f..5b99be4 100644 --- a/DocxTemplater/DocxTemplater.csproj +++ b/DocxTemplater/DocxTemplater.csproj @@ -4,7 +4,7 @@ True - + all From 1714ee19378b4ca14bfc464188cbf025c3124fe7 Mon Sep 17 00:00:00 2001 From: Manuel Amstutz Date: Thu, 3 Oct 2024 16:22:09 +0200 Subject: [PATCH 3/3] Fix bug in Nested CollectionSeparatorBlock --- DocxTemplater.Test/CollectionInTableTest.cs | 49 ++++++++++++++++++ DocxTemplater.Test/DocxTemplater.Test.csproj | 3 ++ .../Resources/CollectionInTableCell.docx | Bin 0 -> 19731 bytes .../Blocks/CollectionSeparatorBlock.cs | 4 +- 4 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 DocxTemplater.Test/CollectionInTableTest.cs create mode 100644 DocxTemplater.Test/Resources/CollectionInTableCell.docx diff --git a/DocxTemplater.Test/CollectionInTableTest.cs b/DocxTemplater.Test/CollectionInTableTest.cs new file mode 100644 index 0000000..329b6f5 --- /dev/null +++ b/DocxTemplater.Test/CollectionInTableTest.cs @@ -0,0 +1,49 @@ +namespace DocxTemplater.Test +{ + internal class CollectionInTableTest + { + [Test] + public void CollectionInTableTestRender() + { + + using var fileStream = File.OpenRead("Resources/CollectionInTableCell.docx"); + var docTemplate = new DocxTemplate(fileStream); + var data = new MyLessonsReportModel(); + var lesson1 = new LessonReportModel + { + Date = DateTime.Now, + CourseDisplayName = "Course 1", + ParticipantsCount = 10, + Resources = new List { "Resource 1", "Resource 2" } + }; + var lesson2 = new LessonReportModel + { + Date = DateTime.Now.AddDays(1), + CourseDisplayName = "Course 2", + ParticipantsCount = 20, + Resources = new List { "Resource 3", "Resource 4" } + }; + data.Lessons = new List { lesson1 }; + docTemplate.BindModel("ds", data); + var result = docTemplate.Process(); + docTemplate.Validate(); + result.SaveAsFileAndOpenInWord(); + } + + public class MyLessonsReportModel + { + public IReadOnlyCollection Lessons { get; set; } = new List(); + } + + public class LessonReportModel + { + public DateTime Date { get; set; } + + public string CourseDisplayName { get; set; } + + public ICollection Resources { get; set; } = new List(); + + public int ParticipantsCount { get; set; } + } + } +} \ No newline at end of file diff --git a/DocxTemplater.Test/DocxTemplater.Test.csproj b/DocxTemplater.Test/DocxTemplater.Test.csproj index 9db41ff..1fb93c9 100644 --- a/DocxTemplater.Test/DocxTemplater.Test.csproj +++ b/DocxTemplater.Test/DocxTemplater.Test.csproj @@ -35,6 +35,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/DocxTemplater.Test/Resources/CollectionInTableCell.docx b/DocxTemplater.Test/Resources/CollectionInTableCell.docx new file mode 100644 index 0000000000000000000000000000000000000000..214aeebb1a9334f71e0aa13d2c83c22fb2920b67 GIT binary patch literal 19731 zcmeIaWprFQ@;BUOW~P`iW{R1aVuqM8W@e0;V`gS%X6Bfgnc0q+UeD~#&P;aBbI$wu zzxSN0?!MBmuB5J#s-!B(N`io*0>A-~004jx5F#VZp8x~^ltKUiC;&)cbwMjjdqYcm zZABMrLpx1cXA5(JY*1i|OaSnE`Tt%2hkKwlZbYVs9#QyC>{)P!##BRZT!Hp;F&#k-T*ftTwN!_0 zI{Pyss@HndB^pgN$`-$KQsOWNO{~JE-#7AH z5Byn=t#xOL6EqN{6w92e*;oDtoY9@+;|fWz4)Ta)O7~KU4iRWh9^aRJd>IcrEOT62 z`EoP)JVA~e;C?5LnU7C!tj*-6(lgN2!9n*F)Jm8B5g{Mx_Tyt8&J*$2J=9F0%G&e& z4@h%`xEsiF9iYQ;O&HE|70;AOP9F$@7OO?1uAqCY5>5g?X1}ZCgWgJ389m(*Mcv|6$?% zOVdlEyG(oNVfoH|UwkLqTVFl+`{bvc+F#2 zp3p|TRS8TqkrCZ%)tbGEM=_0z;ii-~)Y#_qbfl?KdZp0V7p;>=t~nhAeZl_JP+3sH zbWiR^8pvN>_e1uucv;U0)oQgjt#DE``LEw+wf~lnJuPl^;`ga&k`tGTokceD$mrBIc?Fyu}gdbD9pS7 zL+Rz*%ohrA3U;U#udLpKqU-iy?6S$7XYaISnHo=%SO6vUG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%^4?7vy7$bg7<4b4*Qw_pDsEVJAD literal 0 HcmV?d00001 diff --git a/DocxTemplater/Blocks/CollectionSeparatorBlock.cs b/DocxTemplater/Blocks/CollectionSeparatorBlock.cs index f0635cd..a5d0872 100644 --- a/DocxTemplater/Blocks/CollectionSeparatorBlock.cs +++ b/DocxTemplater/Blocks/CollectionSeparatorBlock.cs @@ -15,8 +15,8 @@ public CollectionSeparatorBlock(IVariableReplacer variableReplacer, PatternType public override void Expand(IModelLookup models, OpenXmlElement parentNode) { - int count = (int)models.GetValue($"{ParentBlock.StartMatch.Variable}._Idx"); - int length = (int)models.GetValue($"{ParentBlock.StartMatch.Variable}._Length"); + int count = (int)models.GetValue($"{ParentBlock.StartMatch.Variable.TrimStart('.')}._Idx"); + int length = (int)models.GetValue($"{ParentBlock.StartMatch.Variable.TrimStart('.')}._Length"); // last element is rendered first - get length and count ot to not render the last separator if (length - count == 0) {