LINQ Reporting Engine: Ignore whitespaces/linebreaks between tags

Hi everyone,

I prefere putting each each tag on a separate line, linke in the below example.

<<if [row[“Pictures”] != “”]>>
<<var [string[] pictures = row[“Pictures”].ToString().Split(“,”)]>>
<<var [string[] filenames = row[“PictureNames”] .ToString().Split(“,”)]>>
<<[pictures.Length]>> pictures have been added
<<foreach [picture in pictures]>>
<<[filenames[picture.NumberOf()-1]]>>

<</foreach>>
<<else>>
No images have been taken.
<</if>>
<</foreach>>


Is there any option /seting which would strip the line breaks between closing and opening tag? Currently the above example creates multiple empty rows in the document.
My current way of dealing with this is to use a different formatting for those lines, so they don’t take up to much space. But I doubt, that this is the correct way to deal with it.

Best regards,
Daniel

@Daniel_Krueger

Please check the ReportBuildOptions.RemoveEmptyParagraphs option. It is designed exactly for scenarios like this. You can apply the option as follows:

ReportingEngine engine = new ReportingEngine();
engine.Options |= ReportBuildOptions.RemoveEmptyParagraphs;
engine.BuildReport(...);

Please check Removing Paragraphs Containing Only Template Syntax Tags for more information.

Thanks, I will forward this in the hope it get’s implemented. :slight_smile:

1 Like