The watermark shows fine in the designer using Print Preview.
During runtime there is a crash.
<Watermarks>
<TextWatermark Text="= Elixir.App.Reports.DataSources.LoadIsPreliminary(Parameters.site.Value, Parameters.load_key.Value).ToString()" Color="Red" Orientation="Diagonal" Position="Front" Opacity="0.1" PrintOnFirstPage="True" PrintOnLastPage="True">
<Font Name="helvetica" Size="60pt" />
</TextWatermark>
</Watermarks>using Telerik.Reporting.Expressions;
namespace Elixir.App.Reports.DataSources
{
class BolFunctions: Telerik.Reporting.Report
{
/// <summary>
/// Is this load preliminary?
///
/// User function for Telerik reports
/// </summary>
/// <param name="site"></param>
/// <param name="loadKey"></param>
/// <returns></returns>
[Function(IsVisible = true, Category = "WatermarkTest", Description = "Testing", Namespace = "Elixir.App.Reports.DataSources", Name="LoadIsPreliminary")]
public static string LoadIsPreliminary(string site, string loadKey)
{
// Would actually prefer that this function return a bool
// and let the report output a non-blank watermark if true, otherwise no watermark.
// Would like to have another boolean function as well, LoadIsSpecialCase2, etc.
return "This is another test";
}
}
}
preferred watermark:<Watermarks>
<TextWatermark Text="= IIf(Elixir.App.Reports.DataSources.BolReportInfo.LoadIsPreliminary(Parameters.site.Value, Parameters.load_key.Value), "PRELIMINARY", 
 IIf(Elixir.App.Reports.DataSources.BolReportInfo.LoadIsCancelled(Parameters.site.Value, Parameters.load_key.Value), "CANCELLED", ""))" Orientation="Diagonal" Position="Front" Opacity="0.1" PrintOnFirstPage="True" PrintOnLastPage="True">
<Font Name="helvetica" Size="60pt" />
</TextWatermark>
</Watermarks>