This is a migrated thread and some comments may be shown as answers.

The expression contains undefined function...

2 Answers 292 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dave Bierbaum
Top achievements
Rank 1
Dave Bierbaum asked on 19 Mar 2010, 10:18 PM
I reviewed the article about the three possible causes for this error but none seem to apply for my situation. My function is very simple with no parameters, so #2 and #3 can't apply, plus I've rebuilt the project many times so I don't think it is #1. The error goes away when i set Visible=false for the parameters' UI. I was able to choose the function from within the ReportParameter Collection Editor under "User Functions", and the Editor then automatically set the Value of the parameter to "= GetDefaultFromDate()" (without the quotes)

GetDefaultFromDate() is defined in the same class as the report as the following:

  public static DateTime GetDefaultFromDate() 
  { 
    return DateTime.Now.AddMonths(-1); 
  } 


This is for an ASP.NET 3.5 website written in C#. I was first using Telerik Reporting Q3 2009, but upgrading to Q1 2010 did not resolve the issue.  Please let me know if you need any other information to understand my problem.

Thanks,
David

The expression contains undefined function call GetDefaultFromDate(). 
   at Telerik.Reporting.Expressions.FunctionNode.Eval(Object row, Object context) 
   at Telerik.Reporting.Processing.ParametersManager`1.CalculateValue(T parameter, Object definitionValue, IDictionary`2 newValues) 
   at Telerik.Reporting.Processing.ParametersManager`1.Calculate(T parameter, IDictionary`2 parameterValues) 
   at Telerik.Reporting.Processing.ParametersManager`1.GetParameters(IDictionary`2 parameterValues) 
   at Telerik.ReportViewer.WebForms.ParametersPage.OnPreLoad(EventArgs e) 
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 23 Mar 2010, 05:51 PM
Hi Dave Bierbaum,

We are unable to reproduce the described behavior using the User Function you've provided.

I have attached a sample project. Please check it out and if needed modify it to reproduce the erroneous behavior you are experiencing.

Sincerely yours,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Dave Bierbaum
Top achievements
Rank 1
answered on 23 Mar 2010, 06:35 PM
Thanks for the reply! Simply adding that sample report project to a ReportBookControl and ReportViewer on a blank page in a new website causes the issue for me. I have submitted a support ticket (293244) with my solution attached. 
Tags
General Discussions
Asked by
Dave Bierbaum
Top achievements
Rank 1
Answers by
Peter
Telerik team
Dave Bierbaum
Top achievements
Rank 1
Share this question
or