Linq Reporting Engine error: Cannot create boxed ByRef-like values

Hi, We are calling ReportingEngine.BuildReport() and passing in a DataSet as the data source. We have this line of code in our doc template:

<<if [!string.IsNullOrEmpty(permitPermitteeAddr2)]>>

<<[permitPermitteeAddr2]>><</if>>

The merge of data was working fine in v21.10 of Aspose.Words for .NET, but now throws an exception in v21.11 as:

“An error has been encountered while evaluating the expression or statement ‘!string.IsNullOrEmpty(permitPermitteeAddr2)]>’. Cannot create boxed ByRef-like values.”

Can you please fix this bug introduced in v21.11 or suggest a workaround. We are hosting in a .NET 5 console app which calls a .NET Standard 2.0 DLL, which then calls into Aspose.Words.

@ted-1,
We have tested the scenario and managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET - 22979. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

You can use the line <<if [permitPermitteeAddr2.ToString() != “”]>> in your document as a workaround.

@ted-1,
Please note that, as a temporary workaround, you also can keep your template document as is and disable reflection optimization in your code as follows:

ReportingEngine.UseReflectionOptimization = false;

Sergey,

Do you know how much of an overall performance impact that will have? For now, we have reverted back to the v21.10 of Aspose.Words and are hoping for a fix for this issue and another recent issue we reported in the next version release of Aspose.Words.

Ted

@ted-1 Setting the following option will not have performance impact if compared with previous version of Aspose.Words:

ReportingEngine.UseReflectionOptimization = false;

In the previous versions this option was always disabled in .NET Standard version of Aspose.Words.

The issues you have found earlier (filed as WORDSNET-22979) have been fixed in this Aspose.Words for .NET 21.12 update also available on NuGet.