Pass Report Object to User Function

5 posts, 1 answers
  1. James
    James avatar
    10 posts
    Member since:
    Apr 2015

    Posted 02 Jun 2017 Link to this post

    Hi,

    I'm trying to implement the Reset Page Number by Group functionality for a standalone report. I found an example class within the forums. I can see the assembly I've created from the sample code, as well as the function, in the Report Designer(R1 2017) application Edit Expression dialog.

     

    The problem I'm having is that I can't seem to pass the Report object from the report into the user function. I've tried both of the following function signatures but with no luck:

     

    Public Shared Function MyPageNumber(ByVal lastGroupOnPage As String, ByVal reportPageNumber As Integer, ByRef report As Object) As Integer     

     

  2. James
    James avatar
    10 posts
    Member since:
    Apr 2015

    Posted 02 Jun 2017 in reply to James Link to this post

    Accidentally hit Post. Guess I can't edit posts. Here's the continuation:

     

    Public Shared Function MyPageNumber(ByVal lastGroupOnPage As String, ByVal reportPageNumber As Integer, ByRef report As Processing.Report) As Integer

     

    In both cases, I get the same error:

    Type mismatch in function arguments. Cannot find an overload of the function MyPageNumber() that accepts arguments of type (String, Int32, Report).

     

    Is it possible to pass the Report object to a User Function when using the standalone report designer? I need to be able to reference some parameters in the report.

     

    Thanks!

     

  3. James
    James avatar
    10 posts
    Member since:
    Apr 2015

    Posted 02 Jun 2017 in reply to James Link to this post

    Ugh. One last piece of important information. The expression I'm using to call the user function is the following:

    = TelerikRuntimeReportingFunctions.MyPageNumber(IsNull(PageExec("detail", CStr(Last(Fields.WorkOrderNo) ) ),""), PageNumber, ReportItem.Report)

     

    If I change the function to accept only the first two arguments, everything works. So it seems as though the mismatch is on the ReportItem.Report type.

  4. Answer
    Stef
    Admin
    Stef avatar
    3610 posts

    Posted 05 Jun 2017 Link to this post

    Hello James,

    ReportItem.Report is the value of the processing report and the signature of the method should be like:
    Public Shared Function MyPageNumber(ByVal lastGroupOnPage As String, ByVal reportPageNumber As Integer, ByVal report As Telerik.Reporting.Processing.Report) As Integer

    Please note that as of R1 2017 there are built-in Page functions accomplishing the same task.


    I hope this information helps.

    Regards,
    Stef
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. James
    James avatar
    10 posts
    Member since:
    Apr 2015

    Posted 23 Oct 2017 Link to this post

    Yes, thank you Stef. I was using a 2016 version and realized that functionality had been added for R1 2017 shortly after I posted the question. Thanks.
Back to Top