UNIT6-open / TemplateEngine.Docx

Smart docx template engine for .NET
Other
406 stars 137 forks source link

How to use if and for loop while filling data #71

Open Yes-IT opened 3 years ago

Yes-IT commented 3 years ago
  1. I am trying to bind a template where I need to put conditions before putting some values ? I am not getting how to do this ?
  2. I need to populate data in table control based on for loop so how we can use for loop while assigning values in fieldContent inside Table.

var valuesToFill = new Content( //new ChartContent("Chart"),

               // Add field.
               new FieldContent("LessonName", lessonname),
             new FieldContent("Source", Source),
                 new FieldContent("AuthorName", Author)
                 // Add image in header.
                 //new ImageContent("Logo", System.IO.File.ReadAllBytes(LogoPath))
                 );