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

Community site session details

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

GetData and SetData

(0) ShareShare
ReportReport
Posted on by 50

Hi All,

        

I created the code as shown below for setdata and getdata for page no. and for a Heading field for the no. of copies for my report

Shared Offset As Integer
Shared NewPage As Object

Public Function GetGroupPageNumber(NewPage As Boolean, PageNumber As Integer) As Object
If NewPage
Offset = PageNumber - 1
NewPage = False
End If
Return PageNumber - Offset
End Function

Public Function IsNewPage As Boolean
NewPage = True
Return NewPage
End Function

Shared Data1 as Object
Public Function GetData(Num as integer , Group as integer) as Object
if Group = 1 then
Return Cstr(Choose(Num, Split(Cstr(Data1),Chr(177))))
End If
End Function

Public Function SetData(NewData as Object,Group as integer)
If Group =1 and NewData >"" Then
Data1 = NewData
End If
Return True
End Function

Later inserted Textbox in the body with hidden property as shown below

= Code.SetData(Cstr(Fields!ReportTitleCopyText.Value) + Chr(177) +Cstr(Fields!PageCaption.Value),1)

Inserted textboxes in header for dispalying the Header data with each textboxes expression as '=Code.GetData(1,1)  and code.GetData(2,1)

If the Report is for one page I am getting the values of header and pageNo. correctly, but if it is for multiple pages i am getting the header and page numbers wrongly, why this is coming this like for multiple pages and for single page it is coming corretctly, i want to know and i am beginner in the setdata and getdata type of a report, can anyone help me.

Thanks And Ragards,

Satish 

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at
    RE: GetData and SetData

    Hi,

    You can open the design layout of Report ID 206 and take an idea from there.

    Hope it will help you.

    Thanks.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,901

#2
YUN ZHU Profile Picture

YUN ZHU 2,079 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 2,041

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans