This is a migrated thread and some comments may be shown as answers.

Pass Report Object to User Function

4 Answers 297 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 02 Jun 2017, 06:58 PM

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     

 

4 Answers, 1 is accepted

Sort by
0
James
Top achievements
Rank 1
answered on 02 Jun 2017, 07:03 PM

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!

 

0
James
Top achievements
Rank 1
answered on 02 Jun 2017, 07:08 PM

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.

0
Accepted
Stef
Telerik team
answered on 05 Jun 2017, 04:19 PM
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
0
James
Top achievements
Rank 1
answered on 23 Oct 2017, 07:52 PM
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.
Tags
Report Designer (standalone)
Asked by
James
Top achievements
Rank 1
Answers by
James
Top achievements
Rank 1
Stef
Telerik team
Share this question
or