On my report I have text box - Age(). How I can to run below function:
public
string CalculateAge()
{
DateTime BirthDate = DateTime.Now;
int years = DateTime.Now.Year - BirthDate.Year;
// subtract another year if we're before the
// birth day in the current year
if ((DateTime.Now.Month < BirthDate.Month && (BirthDate.Month - DateTime.Now.Month) >= 6))
years--;
return years.ToString();
}
as User functions for value the text box