web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

How to print a row only on the last page?

(0) ShareShare
ReportReport
Posted on by

Hey guys,

I have created a rdl layout for my report and now I would like to print two rows of a table only on the last page.

How can I achive this?

I want to do this in the body, not in the footer.

That is why I cannot use the global variables...

How can I get the total number of pages and the current number of the page?

Later I want to use the hidden-property to find out, if the current page is at the same time the last page and then I would like to print the rows.

Thank you ;)

  • Suggested answer
    Olister Rumao Profile Picture
    4,009 on at
  • Community Member Profile Picture
    on at

    That does not help me...

    I have the page number, when I run my report, but I do not know, how I get the value of the current page to the layout...

  • Community Member Profile Picture
    on at

    Sub PrintWorksheet()

       Dim lPages As Long

       Dim sTemp As String

       lPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")

       With ActiveSheet.PageSetup

           ActiveSheet.PrintOut From:=1, To:=lPages - 1

           sTemp = .PrintTitleRows

           .PrintTitleRows = ""

           ActiveSheet.PrintOut From:=lPages, To:=lPages

           .PrintTitleRows = sTemp

       End With

    End Sub

    I hope this code helps!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 677 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 430 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 280 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans