Hi all!
I have a Master report containing a sub report. In the sub report i'm trying to use a userdefined function called returnThis(). Below are the two versions of the function.
public static double returnThis()
{
return 22.6;
}
//public static double returnThis(double avgMark)
//{
// //SqlConnection conn = null;
// //conn = new SqlConnection("Data Source=AGAHIMBARE-PC;Initial Catalog=VTLARIMS;Integrated Security=True");
// //conn.Open();
// //string strSQLCommand = "SELECT Top(1) GradePoint FROM GradeMarks WHERE avgMark BETWEEN LowerPercentage AND UpperPercentage";
// //SqlCommand command = new SqlCommand(strSQLCommand, conn);
// //string xx = command.ExecuteScalar().ToString();
// // double returnvalue = System.Convert.ToDouble(xx);
// //conn.Close();
// // return returnvalue;
// return avgMark;
//}
when i use the one without any argument, it works fine ie. returns 22.6
However when i use the one which is passed a parameter (the disabled one) i get "An error occured while trying to process text box. The expression contains undefined function call returnThis()"
I call the function using =returnThis(52.1) as the value for a textbox on the subreport.
Can anyone help me here plz. Thnx so much.