LINQ Reporting Engine (C#) - how to Show/Hide a part of a document with an enum?

Hello,
I need to show/hide some parts of a word document. I am using the LINQ Reporting Engine.
How can I do that ? I tried with a “if” tag like this:

<<if [ShowSections.Contains(ReportSectionType.Personal)]>> … <</if>>

But I got an error:
An error has been encountered at the end of expression ‘ShowSections.Contains(ReportResumeSectionType.Training)]’. Can not get the value of member ‘ReportSectionType’ on type ‘MyApplication.Services.Data.Model.Profile’.

Code:
(ReportSectionType is an enum)

var profile = new Profile();
var showSections = new[] { ReportSectionType.Personal, ReportSectionType.Picture };
// …
var dataSource = new Dictionary<string, object>()
{
{ “Profile”, profile},
{ “ShowSections”, showSections }
}
engine.BuildReport(builder.Document, dataSource.Values.ToArray(), dataSource.Keys.ToArray());

Word:

image.png (15.7 KB)

Thank you

@Romain602

ReportSectionType should be made known by LINQ Reporting Engine as follows:

ReportingEngine engine = new ReportingEngine();
engine.KnownTypes.Add(typeof(ReportSectionType));
engine.BuildReport(...);

For more information, please check Setting up Known External Types.