How to use Report embedded code??? RRS feed

  • Question

  • A post similar to this was apparently deleted by the mods (that's what the site is reporting to me.)


    If a mod could contact me and let me know why, I'd appreciate it.




    We want to embed code in a report.


    We wrote a VB function to remove \r\n combinations from strings, as it plays havoc with formatting.


    Various samples and the docs say to embed the code in the Report (Properties dlg, Code tab) something like this:

    Function MyFunc(...) as ...
        Some VB code goes here...
    End Function


    The code should be accessible in Field expressions using the


    We've tried that and it doesn't work. The Field expression editor tags the function name as an unknown identifier.


    If we ignore that the Report will build, but the Fields act as though the Field is referencing a value straight out of the dataset.


    We found some more obscure samples on the web that say to use the Public and/or the Shared keyword.


    We tried all possible permutations of Public and/or Shared or neither, that didn't work either.


    Are we missing something? How can this be made to work? Is this a localmode restriction?


    Saturday, October 6, 2007 12:12 AM

All replies

  • It's not a localmode restriction at all, and the expression editor doesn't know much about custom code, don't freak out when it complains <g>.  See your other thread for more...




    Sunday, October 7, 2007 3:24 PM