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

Report.BackgroundImage.ImageData via Binding

1 Answer 180 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Betsy
Top achievements
Rank 1
Betsy asked on 03 Dec 2012, 05:27 PM
I am trying to follow an example and set the report background image via a report parameter.  I have set the Style.BackgroundImage.ImageData to = GetPageBackgroundImage(Parameters.MangedByPartnerId.Value).

When I run the report I get the error:
An error has occurred while processing Report 'Invoice'.  The expresssion contains undefined function call GetPageBackgroundImage()

If I hard code a 1 or 0 in the binding call it works, it only breaks when I attempt to reference the report parameter.
Public Shared Function GetPageBackgroundImage(managedByPartnerId As Integer)
    If managedByPartnerId = 1 Then
      Return Bitmap.FromFile("P:\Billing Systems\BESTPASS AM\Invoice Templates\Current\DW Page Invoice.png")
    Else
      Return Bitmap.FromFile("P:\Billing Systems\BESTPASS AM\Invoice Templates\Current\Page Invoice.png")
    End If
  End Function

1 Answer, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 05 Dec 2012, 05:00 PM
Hi Heather,

The type of the argument of your user function is wrong. The following KB article lists the things to check when you receive "undefined function" error: The expression contains undefined function call MyUserFunction() error.

Generally the reporting engine utilizes the most precise expression data type. Therefore in this case you can use long. Whenever you're not sure what the type of your argument is, you can set it as object and then debug your function to see what the actual type is.

Greetings,
Peter
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

Tags
General Discussions
Asked by
Betsy
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or