RSS

Dynamics NAV Reports: Find Getdata Function With Report Builder

21 Dec

I have previously written a blog post (Dynamics NAV Reports (RDLC): SetData, GetData And Line Numbers) that explains how to easier see which number a certain data has in the setdata/getdata functions by using Visual Studio and line numbers. Unfortunately the most guides on the net that deals with getdata/setdata functions takes for granted that you are using Visual Studio with document outline but sometimes that choice isn’t available. Hopefully after this blog post you will find it easier to find the setdata/getdata functions in the report, know where to add a new field. If you only want to see which number a certain field has. Scroll to the bottom and you will find a list of the fields and numbers.

I have divided this post into parts

  1. Find the SetData function call.
  2. Add a field to the SetData function call.
  3. Make the SetData expression more readable.
  4. A numbered list of all the fields in the SetData function call.

The example report that is used is report 206 Sales Invoice. The SetData function is the same in version 2013 R2 and 2015. Haven’t checked 2016 yet but I’m very sure it is still the same.

Find The SetData Function Call

Open the report layout with the report builder. Zoom on the marked part by using the slider or using CTRL +
Report_Builder_SetData_1

Once you have zoomed you should look for this rectangle.

Report_Builder_SetData_2

Left click on it to mark it and then right click to get the menu. Then choose the Text Box Properties.

Report_Builder_SetData_3

Choose the Visibility setting and then look at the code for the expression.
Report_Builder_SetData_4

Here you have the code for the setdata function call with all the fields as parameters.
Report_Builder_SetData_5

Add A New Field With SetData

If you would like to add a field to the function call you have to add it at the end so you won’t displace the other fields from the correct order. Add it with the same syntax as the previous fields.
Report_Builder_SetData_13

Make the SetData Expression More Readable

Unfortunately it isn’t very readable if you wan’t know which number CompanyInfoVATRegNo has.
Report_Builder_SetData_6
To get a more readable list copy all the code in the expression from the Visibility settings to notepad. Now it is a little bit easier to read but the goal is to get a numbered list and we would like to accomplish this with the Import Text Wizard function in Excel. The idea is to convert the text into a CSV text. Start with search & replace according to the pictures (sorry for the Swedish captions).
Report_Builder_SetData_7.JPG
Add the following to the last rows to make the CSV transformation complete.
Report_Builder_SetData_9

After that we will cleanup the text a bit by deleting unnecessary text
Report_Builder_SetData_8

After you have cleaned up the text. Copy all of it and open excel. Choose Paste/Use Text Import Wizard.
Report_Builder_SetData_10.JPG

Format it as follows (again, sorry for the Swedish captions).
Report_Builder_SetData_11.JPG
Now you have the data nicely in excel and you can format it so it becomes a nice list for future purposes.
Report_Builder_SetData_12

The Final list

This is the final list to the SetData function call in invoice report 206. The version of the report is NAVW17.10,NAVSE7.10, from a Swedish 2013 R2 database. However I have compared this with a W1 2015 and they are identical except the last highlighted fields that are localized.

Code.SetData(CustAddr1
CustAddr2
CustAddr3
CustAddr4
CustAddr5
CustAddr6
CustAddr7
CustAddr8
BilltoCustNo_SalesInvHdr
VATRegNo_SalesInvHdr
YourReference_SalesInvHdr
No_SalesInvHdr
HdrOrderNo_SalesInvHdr
PostingDate_SalesInvHdr
DueDate_SalesInvHdr
Cstr(PricesInclVATYesNo_SalesInvHdr)
Cstr(First(Fields!DocDate_SalesInvHdr)
SalesPurchPersonName
DocumentCaptionCopyText
PaymentTermsDesc
ShipmentMethodDesc
CompanyAddr1
CompanyAddr2
CompanyAddr3
CompanyAddr4
CompanyAddr5
CompanyAddr6
CompanyInfoPhoneNo
OrderNoText
EMail
HomePage
CompanyInfoVATRegNo
CompanyInfoGiroNo
CompanyInfoBankName
CompanyInfoBankAccNo
PricesInclVAT_SalesInvHdrCaption
InvNoCaption
SalesInvPostingDateCptn
BilltoCustNo_SalesInvHdrCaption
CompanyInfoBankAccNoCptn
CompanyInfoBankNameCptn
CompanyInfoGiroNoCaption
CompanyInfoVATRegNoCptn
CompanyInfoPhoneNoCaption
PageCaption
ReferenceText
SalesPersonText
VATNoText
SalesInvDueDateCaption
DocumentDateCaption
PaymentTermsDescCaption
ShptMethodDescCaption
EMailCaption
HomePageCaption
PlusGiroNoCaption
CompHasTaxAssessCaption
CompanyInfoRegisteredOffice
CompanyInfoPlusGiroNo
BoardOfDirectorsLocCaption
, 1)

 

Advertisements
 
2 Comments

Posted by on 2015-12-21 in Okategoriserade

 

Tags: , , ,

2 responses to “Dynamics NAV Reports: Find Getdata Function With Report Builder

  1. Damogran

    2016-01-04 at 10:39

    Thank you for your post!
    Easier solution for seeing the setdata/getdata number reference for a field would be setting Visual Studio editor to show line numbers:
    Visual Studio Tools/Options, expand “Text Editor”, expand “All Languages”, and select checkmark to Display section for option “Line Numbers”.

    Like

     
    • Capone

      2016-01-04 at 01:38

      You’re welcome! ☺
      Yeah I know, hence the link to a post that describes that in the beginning. But this time I wanted to show how to access the setdata function if you don’t have access to visual studio.

      Like

       

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Mark Brummel Blog | Microsoft Dynamics NAV

Master Classes Design Patterns and more...

Vjeko.com

ideas in the cloud

Goprowe AB

Reflections from the ERP field

ArcherPoint Developer Blog

Reflections from the ERP field

The NAV Viking´s Blog

- Sharing my experience in the Dynamics NAV world

Comments for waldo's blog

Reflections from the ERP field

Nav Can Be Fun

Its Really Fun to Work with Microsoft Dynamics Nav

Navision-Girl.Com

Reflections from the ERP field

LET'S TALK NAV

Tips, Tricks, How-To's & News about Microsoft Dynamics NAV & Dynamics 365 for Financials

Kine's Info

Reflections from the ERP field

blog.wibeck.org/

Just another WordPress.com site

NAV/SQL Performance - My Two Cents

Reflections from the ERP field

Hougaard.com – Applied Hacking

Reflections from the ERP field

Kauffmann @ Dynamics NAV

Reflections from the ERP field

Kriki’s Dynamics NAV blog

Reflections from the ERP field

Rashed Amini

Reflections from the ERP field

Olof Simren - Microsoft Dynamics NAV Blog

My blog about Microsoft Dynamic NAV tips and tricks. Remember to Subscribe!

Van Vugt's dynamiXs

Reflections from the ERP field

Navisionary – Dynamics NAV

Reflections from the ERP field

%d bloggers like this: