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

Can't call user function from group footer

4 Answers 101 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 21 Aug 2008, 07:35 PM
I have a user fuction that is called in the detail lines with no problem, but when I call it from a group footer I get :
#ERROR# The expression contains undefined function call ConvertSecondsToString().

The experssion in the group footer is:
=ConvertSecondsToString(Sum(Fields.Duration))
the Expression in the Detail line is:
=ConvertSecondsToString(Fields.Duration)

Any Ideas?

4 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 22 Aug 2008, 12:31 PM
Hello Michael,

We have the following question:
  • what is the type of the field Duration
  • what is the signature of the user function (what types does it accept). You can paste its definition here.
The problem might be related to the fact that the Sum aggregate function returns a number and not a DateTime (if that is your type) etc.
Kind regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Michael
Top achievements
Rank 1
answered on 22 Aug 2008, 02:00 PM
This is the function Signature:
Public Shared Function ConvertSecondsToString(ByVal totalSeconds As Integer) As String

The duration field is an integer

It is fine when I call it from the detail section.

0
Steve
Telerik team
answered on 22 Aug 2008, 03:07 PM
Hello Michael,

Please try the following which makes sure that you have integer as function argument:

=ConvertSecondsToString(CInt(Sum(Fields.Duration)))

The Sum aggregate function returns double by default.

All the best,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Michael
Top achievements
Rank 1
answered on 22 Aug 2008, 04:05 PM
Thanks,
That was the problem.
Tags
General Discussions
Asked by
Michael
Top achievements
Rank 1
Answers by
Steve
Telerik team
Michael
Top achievements
Rank 1
Share this question
or