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