Can we call static helper methods in LINQ Reporting templates without class prefix?

Question:

I’m using Aspose.Words LINQ Reporting Engine and have registered a static helper class:

public static class dt
{
    public static string DayOf(object date) => DateTime.Parse(date.ToString()).DayOfWeek.ToString();
    public static DateTime GetDate(int y, int m, int d) => new DateTime(y, m, d);
}

In the template, I can call: <<[dt.DayOf("2025-06-12")]>>

Question: Is there any way to simplify this to call without the dt. prefix,
like: <<[DayOf("2025-06-12")]>>

I’ve already tried:

  • engine.KnownTypes.Add(typeof(dt));
  • engine.KnownTypes.Add(typeof(dt), "d");
  • Wrapping dt inside the data model

All of these still require a prefix (dt. or d. ).

Is there a supported way to call helper methods directly in the expression without qualifying with the class name?

Thanks in advance!

@abhishekouta No, unfortunately, there is no way to call helper methods directly in the expression without qualifying with the class name

Thank you for this confirmation!

1 Like