Results 1 to 5 of 5

Thread: Call a function into Textbox Report Viewer

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2022
    Posts
    18

    Call a function into Textbox Report Viewer

    I have a function named NoToTxt converts numbers to words into Arabic language
    I pasted it in the Code place of Report Properties then I tried to call it inside a textbox expression using this code

    Code:
    Code.NoToTxt (Fields!Number.Value)
    but it didnít work, I donít know what exactly went wrong
    any help please, I'm using Report Viewer VB 2012

  2. #2
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,181

    Re: Call a function into Textbox Report Viewer

    Can you have the function return its results to a string variable and then use that variable for whatever use you may need? Just a thought.

  3. #3
    Frenzied Member schoemr's Avatar
    Join Date
    Apr 2016
    Location
    South Africa
    Posts
    1,298

    Re: Call a function into Textbox Report Viewer

    Hi Talajeen,

    If this is what you did then I don't think it will work:

    Attachment 186763

    What you have to do is to create a Class with your function and then in you textbox expression e.g.
    Code:
    =MyFunctions.NoToTxt(Fields!Number.value)
    where MyFunctions is the name of the class and NoToTxt is the name of the function

  4. #4
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,064

    Re: Call a function into Textbox Report Viewer

    Quote Originally Posted by Tajaldeen View Post
    I have a function named NoToTxt converts numbers to words into Arabic language
    I pasted it in the Code place of Report Properties then I tried to call it inside a textbox expression using this code

    Code:
    Code.NoToTxt (Fields!Number.Value)
    but it didnít work, I donít know what exactly went wrong
    any help please, I'm using Report Viewer VB 2012
    What does "it didn't work" mean exactly? Error? Nothing? Garbage? Finger fall off?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5
    Frenzied Member schoemr's Avatar
    Join Date
    Apr 2016
    Location
    South Africa
    Posts
    1,298

    Re: Call a function into Textbox Report Viewer

    I realize that it is actually not as straightforward as my example in #3. I'm not sure if the OP will read is - it seems sometimes people post questions and they either don't come back for an answer or "tx" is too much effort.

    I'm going to make a tutorial on this and maybe it can help someone in the future. In 6 years I battled hours and days with RDLC reports it feels like I should have 20 years experience 🙂

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width