Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Error adding logo picture to RTC report

(0) ShareShare
ReportReport
Posted on by 243

Hello,

I'm getting this error when trying to add logo to RTC report in Visual Studio: 'Error while validating RDL content: The Value expression for the image 'image1' contains an error: [BC30456] 'GetPicture" is not a member of 'ReportExprHostImpl.CustomCodeProxy'. Can you please advise? Thank you!!

*This post is locked for comments

  • Verified answer
    RE: Error adding logo picture to RTC report

    As Roberto indicated, you are missing function GetPicture the report layout code section.

    Obviously you copied an image placeholder from another report. If your picture needs to be printed in the report header, it is best to copy the missing function plus necessary variables from the same report you copied the image box from.

    You can find code also in standard report 205:

    Shared PictureData1 as Object

    Shared PictureData2 as Object

    Shared PictureData3 as Object

    Public Function GetPicture(Group as integer) as Object

    if Group = 1 then

      Return PictureData1

    End If

    if Group = 2 then

      Return PictureData2

    End If

    if Group = 3 then

      Return PictureData3

    End If

    End Function

    Public Function SetPicture(NewData as Object,Group as integer)

     If Group = 1 and NewData > "" Then

         PictureData1 = NewData

     End If

     If Group = 2 and NewData > "" Then

         PictureData2 = NewData

     End If

     If Group = 3 and NewData > "" Then

         PictureData3 = NewData

     End If

    End Function

    Please note that you will also need a text box in the header with SetPicture and an additional box in the body, upper left corner, holding the dataset field that needs to be connected to the image box ....

    If your picture needs to be printed in the report body instead, leave out the code stuff and just replace the image box value GetPicture with =Fields!YourPictureDatasetFieldName.Value.

  • Verified answer
    Roberto Stefanetti Profile Picture
    Roberto Stefanetti 12,998 on at
    RE: Error adding logo picture to RTC report

    hi,

    In the Report Properties window (RDLC Layout), click the "Code" to see what functions are defined

    "GetPicture" is not present i think, search for others functions ex: GetData, SetData etc.

    ...

    ex. of Publc Functions

    Public Function GetData(Num as Integer, Group as integer) as Object

    if Group = 1 then

      Return Cstr(Choose(Num, Split(Cstr(Data1),Chr(177))))

    End If

    ...

    msdn.microsoft.com/.../dd301162(v=nav.70).aspx

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,403 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans