public object Evaluate(Report rpt, Row row)
{
try
{
// Check to see if we're evaluating an expression in a page header or footer;
// If that is the case the rows are cached by page.
if (row == null && this.UniqueName != null)
{
Rows rows = rpt.GetPageExpressionRows(UniqueName);
if (rows != null && rows.Data != null && rows.Data.Count > 0)
{
row = rows.Data[0];
}
}
return(_Expr.Evaluate(rpt, row));
}
catch (Exception e)
{
string err;
if (e.InnerException != null)
{
err = String.Format("Exception evaluating {0}. {1}. {2}", _Source, e.Message, e.InnerException.Message);
}
else
{
err = String.Format("Exception evaluating {0}. {1}", _Source, e.Message);
}
ReportError(rpt, 4, err);
return(null);
}
}