Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Page no reset on change of group

Posted on by 2,576

Hello,

I need to reset page no on report when the group changes. I tried using page reset property but it doesn't work. So I'm doing to through code.

REM Reset Page Number:

Shared offset As Integer
Shared newPage As Object
Shared currentgroup1 As Object
Shared currentgroup2 As Object


Public Function GetGroupPageNumber(ByVal NewPage As Boolean, ByVal pagenumber As Integer) As Object
If NewPage Then
offset = pagenumber - 1

End If
Return pagenumber - offset
End Function

Public Function IsNewPage(ByVal group1 As Object, ByVal group2 As Object) As Boolean
newPage = False
If Not (group1 = currentgroup1) Then
newPage = True
currentgroup1 = group1
currentgroup2 = group2
Else
If Not (group2 = currentgroup2) Then
newPage = True
currentgroup2 = group2
End If
End If
Return newPage
End Function

Kindly suggest. This is not giving correct page nos.

Then in hidden textbox, my expression is

=Code.IsNewPage(Fields!Sales_Invoice_Header__Sales_Invoice_Header___No__.Value,Fields!OutputNo.Value)

In footer, it is

 Code.GetGroupPageNumber(ReportItems!NewPage.Value,Globals!PageNumber)

  • Suggested answer
    Andy Sather Profile Picture
    Andy Sather on at
    RE: Page no reset on change of group

    Hello  - We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans