Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Remove #Error from the report

Posted on by 1,835

Dear Experts.
Please help me to resolve the #Error printing in my report.
I am using the below expressions to print the report.

I am trying to resolve through expressions, but it is not working.

=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,27)=" "

8267.test01.png

My all expression to print the beneficiary name is :

=getchar(Fields!txtvendname.Value,1)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,2)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,3)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,4)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,5)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,6)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,7)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,8)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,9)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,10)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,11)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,12)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,13)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,14)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,15)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,16)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,17)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,18)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,19)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,20)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,21)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,22)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,23)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,24)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,25)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,26)
=Microsoft.VisualBasic.Strings.getchar(Fields!txtvendname.Value,27)

*This post is locked for comments

  • manish.yadav Profile Picture
    manish.yadav 1,835 on at
    RE: Remove #Error from the report

    Dear Suresh Ji,

    Now, my problem is resolved. I have rectified my all expressions. Thank you very much for your proper

    co-operation.

    2438.test01.png

  • Verified answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Remove #Error from the report

    It should be =Code.ReturnChar(Fields!txtvendname.Value,10), you are missing .Value in all the expressions. 

  • manish.yadav Profile Picture
    manish.yadav 1,835 on at
    RE: Remove #Error from the report

    Dear Experts,

    I have total 27 text boxes, as per your suggestion I have write the 27 expressions.

    =Code.ReturnChar(Fields!txtvendname,1)

    =Code.ReturnChar(Fields!txtvendname,2)

    =Code.ReturnChar(Fields!txtvendname,3)

    =Code.ReturnChar(Fields!txtvendname,4)

    =Code.ReturnChar(Fields!txtvendname,5)

    =Code.ReturnChar(Fields!txtvendname,6)

    =Code.ReturnChar(Fields!txtvendname,7)

    =Code.ReturnChar(Fields!txtvendname,8)

    =Code.ReturnChar(Fields!txtvendname,9)

    =Code.ReturnChar(Fields!txtvendname,10)

    =Code.ReturnChar(Fields!txtvendname,11)

    =Code.ReturnChar(Fields!txtvendname,12)

    =Code.ReturnChar(Fields!txtvendname,13)

    =Code.ReturnChar(Fields!txtvendname,14)

    =Code.ReturnChar(Fields!txtvendname,15)

    =Code.ReturnChar(Fields!txtvendname,16)

    =Code.ReturnChar(Fields!txtvendname,17)

    =Code.ReturnChar(Fields!txtvendname,18)

    =Code.ReturnChar(Fields!txtvendname,19)

    =Code.ReturnChar(Fields!txtvendname,20)

    =Code.ReturnChar(Fields!txtvendname,21)

    =Code.ReturnChar(Fields!txtvendname,22)

    =Code.ReturnChar(Fields!txtvendname,23)

    =Code.ReturnChar(Fields!txtvendname,24)

    =Code.ReturnChar(Fields!txtvendname,25)

    =Code.ReturnChar(Fields!txtvendname,26)

    =Code.ReturnChar(Fields!txtvendname,27)

    After applying these expressions, the error messages is coming. I am unable to save the report. that is the problems.

    my old applied expressions are below

    =IIF(Len(Fields!txtvendname.Value) >=1, GetChar(Fields!txtvendname.Value,1),"")

    =IIF(Len(Fields!txtvendname.Value) >=2, GetChar(Fields!txtvendname.Value,2),"")

    =IIF(Len(Fields!txtvendname.Value) >=3, GetChar(Fields!txtvendname.Value,3),"")

    =IIF(Len(Fields!txtvendname.Value) >=4, GetChar(Fields!txtvendname.Value,4),"")

    =IIF(Len(Fields!txtvendname.Value) >=5, GetChar(Fields!txtvendname.Value,5),"")

    =IIF(Len(Fields!txtvendname.Value) >=6, GetChar(Fields!txtvendname.Value,6),"")

    =IIF(Len(Fields!txtvendname.Value) >=7, GetChar(Fields!txtvendname.Value,7),"")

    =IIF(Len(Fields!txtvendname.Value) >=8, GetChar(Fields!txtvendname.Value,8),"")

    =IIF(Len(Fields!txtvendname.Value) >=9, GetChar(Fields!txtvendname.Value,9),"")

    =IIF(Len(Fields!txtvendname.Value) >=10, GetChar(Fields!txtvendname.Value,10),"")

    =IIF(Len(Fields!txtvendname.Value) >=11, GetChar(Fields!txtvendname.Value,11),"")

    =IIF(Len(Fields!txtvendname.Value) >=12, GetChar(Fields!txtvendname.Value,12),"")

    =IIF(Len(Fields!txtvendname.Value) >=13, GetChar(Fields!txtvendname.Value,13),"")

    =IIF(Len(Fields!txtvendname.Value) >=14, GetChar(Fields!txtvendname.Value,14),"")

    =IIF(Len(Fields!txtvendname.Value) >=15, GetChar(Fields!txtvendname.Value,15),"")

    =IIF(Len(Fields!txtvendname.Value) >=16, GetChar(Fields!txtvendname.Value,16),"")

    =IIF(Len(Fields!txtvendname.Value) >=17, GetChar(Fields!txtvendname.Value,17),"")

    =IIF(Len(Fields!txtvendname.Value) >=18, GetChar(Fields!txtvendname.Value,18),"")

    =IIF(Len(Fields!txtvendname.Value) >=19, GetChar(Fields!txtvendname.Value,19),"")

    =IIF(Len(Fields!txtvendname.Value) >=20, GetChar(Fields!txtvendname.Value,20),"")

    =IIF(Len(Fields!txtvendname.Value) >=21, GetChar(Fields!txtvendname.Value,21),"")

    =IIF(Len(Fields!txtvendname.Value) >=22, GetChar(Fields!txtvendname.Value,22),"")

    =IIF(Len(Fields!txtvendname.Value) >=23, GetChar(Fields!txtvendname.Value,23),"")

    =IIF(Len(Fields!txtvendname.Value) >=24, GetChar(Fields!txtvendname.Value,24),"")

    =IIF(Len(Fields!txtvendname.Value) >=25, GetChar(Fields!txtvendname.Value,25),"")

    =IIF(Len(Fields!txtvendname.Value) >=26, GetChar(Fields!txtvendname.Value,26),"")

    =IIF(Len(Fields!txtvendname.Value) >=27, GetChar(Fields!txtvendname.Value,27),"")

  • Verified answer
    TharangaC Profile Picture
    TharangaC 23,116 on at
    RE: Remove #Error from the report

    Check the expression on textbox67

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Remove #Error from the report

    What is the expression you have used on the textbox67 ?

  • manish.yadav Profile Picture
    manish.yadav 1,835 on at
    RE: Remove #Error from the report

    Dear Experts,

    After applying the new code on report. When I try to save the report, it is showing the below error messages.

    5808.test01.png

  • Verified answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Remove #Error from the report

    Add this function function in the Report Properties Code

    Public Function ReturnChar(ByVal s As String,ByVal pos as Integer) As String

          Dim SingleChar As Char

          Try

            SingleChar = GetChar(s,pos)

           Catch ex As Exception

               Return ""

           End Try

           Return SingleChar.ToString

    End Function  

    And then use like this

    = Code.ReturnChar(Fields!txtvendName.Value,1) and so on for others

  • manish.yadav Profile Picture
    manish.yadav 1,835 on at
    RE: Remove #Error from the report

    Hello,

    I have changed all expressions form textbox1 to textbox27. But there is no effect, still [tag:Error]  is printing. Please provide me the solutions.

    =IIF(Len(Fields!txtvendname.Value) >=1, GetChar(Fields!txtvendname.Value,1),"")

    =IIF(Len(Fields!txtvendname.Value) >=2, GetChar(Fields!txtvendname.Value,2),"")

    =IIF(Len(Fields!txtvendname.Value) >=3, GetChar(Fields!txtvendname.Value,3),"")

    =IIF(Len(Fields!txtvendname.Value) >=4, GetChar(Fields!txtvendname.Value,4),"")

    =IIF(Len(Fields!txtvendname.Value) >=5, GetChar(Fields!txtvendname.Value,5),"")

    =IIF(Len(Fields!txtvendname.Value) >=6, GetChar(Fields!txtvendname.Value,6),"")

    =IIF(Len(Fields!txtvendname.Value) >=7, GetChar(Fields!txtvendname.Value,7),"")

    =IIF(Len(Fields!txtvendname.Value) >=8, GetChar(Fields!txtvendname.Value,8),"")

    =IIF(Len(Fields!txtvendname.Value) >=9, GetChar(Fields!txtvendname.Value,9),"")

    =IIF(Len(Fields!txtvendname.Value) >=10, GetChar(Fields!txtvendname.Value,10),"")

    =IIF(Len(Fields!txtvendname.Value) >=11, GetChar(Fields!txtvendname.Value,11),"")

    =IIF(Len(Fields!txtvendname.Value) >=12, GetChar(Fields!txtvendname.Value,12),"")

    =IIF(Len(Fields!txtvendname.Value) >=13, GetChar(Fields!txtvendname.Value,13),"")

    =IIF(Len(Fields!txtvendname.Value) >=14, GetChar(Fields!txtvendname.Value,14),"")

    =IIF(Len(Fields!txtvendname.Value) >=15, GetChar(Fields!txtvendname.Value,15),"")

    =IIF(Len(Fields!txtvendname.Value) >=16, GetChar(Fields!txtvendname.Value,16),"")

    =IIF(Len(Fields!txtvendname.Value) >=17, GetChar(Fields!txtvendname.Value,17),"")

    =IIF(Len(Fields!txtvendname.Value) >=18, GetChar(Fields!txtvendname.Value,18),"")

    =IIF(Len(Fields!txtvendname.Value) >=19, GetChar(Fields!txtvendname.Value,19),"")

    =IIF(Len(Fields!txtvendname.Value) >=20, GetChar(Fields!txtvendname.Value,20),"")

    =IIF(Len(Fields!txtvendname.Value) >=21, GetChar(Fields!txtvendname.Value,21),"")

    =IIF(Len(Fields!txtvendname.Value) >=22, GetChar(Fields!txtvendname.Value,22),"")

    =IIF(Len(Fields!txtvendname.Value) >=23, GetChar(Fields!txtvendname.Value,23),"")

    =IIF(Len(Fields!txtvendname.Value) >=24, GetChar(Fields!txtvendname.Value,24),"")

    =IIF(Len(Fields!txtvendname.Value) >=25, GetChar(Fields!txtvendname.Value,25),"")

    =IIF(Len(Fields!txtvendname.Value) >=26, GetChar(Fields!txtvendname.Value,26),"")

    =IIF(Len(Fields!txtvendname.Value) >=27, GetChar(Fields!txtvendname.Value,27),"")

    8284.test01.png

  • manish.yadav Profile Picture
    manish.yadav 1,835 on at
    RE: Remove #Error from the report

    Thank you for your kind reply.

    I have changed only last expressions, where's the [tag:Error] was coming. After changing all expressions I will confirm you.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Remove #Error from the report

    Have you changed the expression for all the textboxes till 27.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans