User Defined Function support in Standalone designer

8 posts, 0 answers
  1. Peter
    Peter avatar
    71 posts
    Member since:
    Mar 2012

    Posted 20 Aug 2013 Link to this post

    When I try to reference a user defined function from TRDX file, and load it into my application, I get this error.

    The expression contains object 'TSDFunctions' that is not defined in the current context.


    This is the code that loads the TRDX file:


    Dim settings As New XmlReaderSettings()
    settings.IgnoreWhitespace = True
     
    Dim reportBytes As Byte() = Nothing
     
    ' TODO - Need to change this code to use the input parameter reportTRDX once Telerik Report Designer allows more options for the dataset.
    ' ie: reportTRDX - "C:\Temp\TelerikReportingTest\Report1.trdx"
    Using xmlReader As System.Xml.XmlReader = System.Xml.XmlReader.Create(reportTRDX, settings)
        Dim xmlSerializer As New Telerik.Reporting.XmlSerialization.ReportXmlSerializer()
     
        Dim report As Telerik.Reporting.Report = DirectCast(xmlSerializer.Deserialize(xmlReader), Telerik.Reporting.Report)
     
        reportBytes = GeneratePDF(report, dtData)
    End Using
     
    Return reportBytes

  2. Hadib Ahmabi
    Hadib Ahmabi avatar
    181 posts
    Member since:
    Nov 2011

    Posted 23 Aug 2013 Link to this post

    Hi!

    Try this: http://www.telerik.com/help/reporting/configuring-telerik-reporting-assemblyreferences.html

    I believe you will need to add assembly reference to the configuration. 
  3. DevCraft banner
  4. Peter
    Peter avatar
    71 posts
    Member since:
    Mar 2012

    Posted 23 Aug 2013 Link to this post

    Support referred me to this URL:

    http://www.telerik.com/support/kb/reporting/customization-tip/how-to-use-external-assemblies-with-custom-user-functions-in-the-report-designer.aspx

    In particular: Use the created XML report definition in a custom application

    I had added the reference to the .config file for the standalone designer, but not to the web application where the TRDX files were being used.

  5. ANTOINE
    ANTOINE avatar
    2 posts
    Member since:
    Oct 2013

    Posted 17 Jan 2014 Link to this post

    Hi,

    Sorry to digup this post, but have you succeded in referencing your user functions assembly? I followed these instruction and all I've got when launching the report viewer is what seems to be a broken interface with no report in it and no explicit error...
  6. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 21 Jan 2014 Link to this post

    Hi Antoine,

    Please take a look at the Extending Report Designer help article and its related resources about custom user functions and external assemblies. Make sure the external assembly is built with the same Telerik Reporting version and is placed within the folder of the Standalone Designer executable.

    If the issue still appears, enable the listener in the configuration file and post the error message here.

    Regards,
    Stef
    Telerik

    New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

  7. Vittorio
    Vittorio avatar
    2 posts
    Member since:
    Feb 2014

    Posted 12 Feb 2014 in reply to Stef Link to this post

    Hi, 

    I have added a custom assembly in the folder of the Standalone Designer executable and I can use my custom function on designer, but when I run the preview I get "The expression contains undefined function call GetDateTime()" where GetDateTime is my custom function.

    Regards,
    Vittorio
  8. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 13 Feb 2014 Link to this post

    Hello Vittorio,

    Please check if the passed parameters corresponds to the custom function signature - number, type and order. For more details, check our The expression contains undefined function call MyUserFunction() error KB article.

    Regards,
    Stef
    Telerik

    New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

  9. Vittorio
    Vittorio avatar
    2 posts
    Member since:
    Feb 2014

    Posted 13 Feb 2014 in reply to Stef Link to this post

    Thank you, now it work 

    Best regarts
    Vittorio
Back to Top
DevCraft banner