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

The expression contains undefined function call

8 Answers 383 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Carla Harker
Top achievements
Rank 1
Carla Harker asked on 16 Jul 2008, 08:29 PM
I'm trying to set a Report Parameter to the current date minus 7 days. I created a user function:

public static DateTime GetPreviousWeek()
{  return DateTime.Now.AddDays(-7);   }

In the ReportParameter Collection Editor, I created a new member, WeeklyDate. Its type is DateTime. The Value is =GetPreviousWeek()

When I try to Preview, I get "The expression contains undefined function call GetPreviousWeek()."  What am I missing?

ETA: I do build the project before I add the user function to the field. I'm selecting it out of the list when I get the error.

8 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 17 Jul 2008, 12:53 PM
Hello Carla,

Unfortunately we must admit that this is a bug. This happens only when you have the UI=Visible. We've logged it in our bug tracking system and forwarded it to our developers for investigation.

Your Telerik points have been updated for bringing this to our attention. Do let us know if you have other questions/problems.

Greetings,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Carla Harker
Top achievements
Rank 1
answered on 17 Jul 2008, 01:22 PM
Thank you for your response.

This might be another bug, or the same bug manifesting in a different way: I tried setting Visible=false to get around this issue and got "Failed to convert parameter value from a String to a DateTime. String was not recognized as a valid DateTime." So I reset the Value to the function, =Now(). Same error. I had to set Visible=true to get the report to show up with the =Now() function.
0
Steve
Telerik team
answered on 17 Jul 2008, 02:29 PM
Hi Carla,

This is different issue - this time a known one. It has already been addressed and will be part of the Q2 release scheduled to be released next week. Make sure that you always have "=" sign before the value for the parameter (see attached screenshot).

All the best,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Dan White
Top achievements
Rank 1
answered on 14 Oct 2009, 09:39 PM
Is this bug still outstanding? It has been over a year since this post so I am hoping it's been fixed, but I'm having a very similar issue. I'm using Telerik Reporting Q2 2009. My preview works fine in VS, but when I view the report in a web page with the report viewer I get the error "The expression contains undefined function call DaysAgo()" Based on this post, I removed the function and hard coded a date. That works fine on the web server. I also tried the built-in function =Now() and that works as well. Are custom functions still not working for report parameter default values?
0
Steve
Telerik team
answered on 15 Oct 2009, 08:47 AM
Hello Dan,

I've just made a test with the initially reported user function and it works as expected (see attached report). Can you verify that the error you receive is not because of other issues described in the following KB article: The expression contains undefined function call MyUserFunction() error.

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Dave Bierbaum
Top achievements
Rank 1
answered on 19 Feb 2010, 06:02 PM
It seems like there is still something going on here. I am having this exact same issue with Telerik Reporting Q3 2009. I even downloaded the report attached to this thread (report1.zip) and added it to my project and it didn't work for me either. There must be something else with my configuration that is causing this to occur?
0
ISS Help
Top achievements
Rank 1
answered on 20 May 2010, 11:33 PM
I think it's fixed for the Web Report Viewer, but I'm getting it when I try to wire up a report viewer to a ReportBookControl.  I'm using a similar function that returns the current fiscal year to a report parameter.
0
Steve
Telerik team
answered on 21 May 2010, 04:49 PM
Hi guys,

@Dave: I've just tested the example from my previous post and it works correctly with Q1 version as well.

@IISHelp: this is not relevant to the viewer used to show the report, but to the report itself and namely whether the user function is correct.

Kind regards,
Steve
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.
Tags
General Discussions
Asked by
Carla Harker
Top achievements
Rank 1
Answers by
Steve
Telerik team
Carla Harker
Top achievements
Rank 1
Dan White
Top achievements
Rank 1
Dave Bierbaum
Top achievements
Rank 1
ISS Help
Top achievements
Rank 1
Share this question
or