Function member types with void return type

Hi there
Is there a way to access function member types from within a LINQ reporting engine template without assigning the expression to a variable? Currently, I do the following:

<<var[dev0=Util.SetDocumentProperty(Template,“Autor”, AuthorNameSurname)]>>

I would like to being able to use methods within Util that return void and that don’t have to be assigned to a variable, i.e. like this:

<<[Util.SetDocumentProperty(Template,“Autor”, AuthorNameSurname)]>>

According to the java doc, this doesn’t seem to be possible (the .NET doccumentation has a wrong page referenced for “Accessing Type Members”, by the way).

Is there another way to call a method that returns void from within a LINQ template (without assigning it to a variable)? If not: Any chance to get that added to your code?

Many thanks,
Dani

@tibitabi I think in your case you can simply return some dummy empty value from your utility method. In this case the following <<[Util.SetDocumentProperty(Template,“Autor”, AuthorNameSurname)]>> will be replaced with an empty string, just like it is supposed if method returns void.

Hi Alexey
Thanks for your prompt reply. The empty string inserted into the document is not so nice, though. Is there a way to call a utillity method without changing anything in the resulting doucment?

Cheers,
Dani

@tibitabi Could you please clarify your vision how the tag with call of utility method should behave? Should the tag to be left intact in the output document?

Hi Alexey
I would like to be able to invoke utility methods from within my templates without having to return any value whatsover from the utility methods and without getting any values into the template, i.e.:

<<@[Util.SetDocumentProperty(Template,“Autor”, AuthorNameSurname)]>>

A special character like @ might indicate that no return value is expected, so that the utility methods used in such tags are allowed to return void. Neither the tag nor any other character would be copied into the output document.

As with the example above: When setting a documentProperty, for example, I have no return value that I want to insert into the output document, I just would like to invoke a method within my utilities without return value.

Thanks a lot,
Dani

@tibitabi Thank you for additional information. But I do not see any difference in your proposal and my proposal to return an empty string or null value from the utility method. The result in the template will be the same, the tag with function call will be simply removed.

Hi Alexey
You’re right, I wasn’t precise enough ,sorry. What I would like to be able to is to add tags to my template where empty paragraphs are removed regardless of the setting of ReportBuildOptions.RemoveEmptyParagraphs. That way, I could set the RemoveEmptyParagraphs flag to false and still be able to add tags for my utility calls that do not leave any trace in the output document. I add thee pictures showing the template, the current result and the desired result.
Many thanks,
Dani

@tibitabi In this case you can simply put the tag with call of utility method into a not empty paragraph. In this case the tag will not produce an empty paragraph.


Also, you can mark the whole paragraph with call of utility method as hidden, in this case, however, the empty paragraph will be still there, but is will be hidden.

Hi Alexey
Many thanks for your reply. I see what you mean and it certainly works, but it’s just doesn’t seem to be very elegant. We do have non ICT people as well creating and modifing templates, and it would be much nicer If I could tell them that they can invoke a utiliy command by i.e. <<@[Util.Cmd(...)]]>> instead of having to explain that they have to put the tag within some text in the template or that the have to hide the entire tag → gives the impression of a makeshift solution.
BR,
Dani

@tibitabi We will consider adding such special syntax.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-26515

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Cool, thanks a lot.

1 Like

@tibitabi After further looking into the issue, it appears that the most laborious part is support of void in return values. Selective paragraph removal on its own does not require a lot of efforts to implement. So, if it is acceptable for you to continue with empty but non-void return values from utility methods, then we could start working on the selective paragraph removal sooner. By the way, void type was not supported by design and this is mentioned in our docs.

@alexey.noskov If you could start realising the selective paragraph removal, that would be great and very helpful for us. And if you could realise the void later on, that would be even better.
Many thanks,
Dani

@tibitabi Thank you for your feedback, I have forwarded it to our development team. We will keep you updated and let you know once the feature is implemented or we have more information for you.