or
UPDATE [HR_Employees]SET EmployeeSignature = (SELECT BulkColumn FROM OPENROWSET( Bulk 'C:\Signatures\Justin.bmp', SINGLE_BLOB)AS BLOB) WHERE EmployeeNumber = '99999'public ActionResult PrintPoReport(string id) { var irs = new InstanceReportSource(); irs.ReportDocument = new LogisticsReports.PoHeader(); irs.Parameters.Add(new Parameter("PoID", id)); Telerik.Reporting.Processing.ReportProcessor rp = new Telerik.Reporting.Processing.ReportProcessor(); Telerik.Reporting.Processing.RenderingResult result = rp.RenderReport("PDF", irs, null); byte[] contents = result.DocumentBytes; return File(contents, "application/pdf", "P0 #" + id + ".pdf"); }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>