Hello,
I have a program which fills with your template syntax some values contained in C# object. For example :
public class Dossier
{
public string Libelle { get; set; }
public int Id { get; set; }
public DateTime DateLivraison { get; set; }
public decimal? Amount { get; set; }
public decimal? getAmount()
{
return Amount;
}
public string AmountString { get; set; }
}
So my users can build themselves their word with your template synthaxe which is amazing. With the following example : <<[dossier.Id]>> for the Id property.
However, they need to perform some calculation formula and the only way I found for the moment is to set a variable like your example in : Appendix C. Typical Templates in C#|Aspose.Words for .NET
But I haven’t found how to add properties in the variable yet. Indeed, I must create a getAmount() method in order to set my variable with a property value. It is there any way to set a variable with a property name?
Best regards.
Edit: I need to display my Amount value as Currency so the expression <<var [total = Amount *1.2]:“c”>><<[total]>> doesn’t work.