Creating a field in a report (Nav. 4.0 sp2)

Dear All,

I would like to ask you about how to create a field, let say field r in a report but field r is from a record for example record xx . There is no xx in DataItem of the report. I write the record name in the name on tab variable and write xx in the subtype after selected record as datatype.

When I create a field let say field w in one of DataItem, for example aa, I directly create textbox and in the textbox properties sourceexpr xx.“r”. So now field aa actually contains data from field r of record xx, but when I print preview, I can’t see the data, how to make the data appear…? How to solve this…?

Rgds,

Mark

Looks correct to me, did you do a xx.FIND or xx.GET to get to the Record entry you want to show in your Report Section?

There are at least four ways to solve this.

1/ Create a Flow field
2/ Create New Report Element
3/ Create a variable ( I think this is what you tried).
4/ Create a function int he Sales Header table (I am not going to describe that here, its beyond the scope of this thread).

1/ Flow field:
In this case lets say you have a report based on the Sales Header (36) and you want to print the Sell-to customer ont he report.

2/ Create New Report Element
In this case we add the second table directly onto the report

3/ Create a variable
Here we craete a new variable for the new tabel, and do a “GET” to retreive the information in the report.

Why do we use each of these options.
1/ Create a Flow field
This really is “the Navision Way” though ne mght say its not “the Microsoft Way” and its frowned upon by the tough C developers that don’t like things that are easy enough that “normal” people can do them without 15 compilers 13 text editors, 7 servers, and a ream of development software installed. So I think we are going to see this method die unfortunately.
Advantages:
Simple : you just add the field int he table, and the rest is simple.
Fast: Since Flow Fields are generated on the server, there is minimal network over head (i.e. transfering just the Text 30 field,instead of the entire Customer record)
Upgrades: The best feature of flow field, is that they are simple to merge, so wont bump up the cost of yoru next upgrade.
Consistancy: Because its done at the table level, the field is now automatically available everywhere, you can ad dthe field to any report or form, so if the client wishes they can now add telephone number to their sales order list very easily. Also its now available in dataports etc.

When to use it:
Although this is generally the prefered method, you would not do it if the field was only going to be used once in one report. Lookup Flow Fields are good where you want consistancy in a number of places, but if its just one report, then use method 3.

2/ Create New Report Element
Advantage:
This method is only really usefull where you need to print a lot of fields formthe altrernate record in the report. Mainly because you can drag drop the fields.
Disadvantage:
By default the field are now printed AFTER the main element, and most often this is not usefull.

3/ Create a variable
This is the method used where its just one or two fields, and its just for one report. Keep n mind that in this case (and 2 abve) you are transmitting the whole record across the network when you do this, not just one field.

Oh and Mark in your case I would recommend creating a flow field, its the simplest solution.

Dear David and Denster,

Tku for your answer, I appreciate it, but I will try first.

Rgds,

Give it a try, and don’t forget to let us know what works for you. [:D]

Dear all,

I’ve changed my mind, instead of creating new field, I add dataitem from a table and then set dataitemtableview to be no. and then ReqFilterFields is no. this is done because they want to select and assign the data from table for report they will give to their customer. This topic is closed now. tku for all helps.

Rgds,

Mark

Excelent, its great that you have a good solution, and I hope you were able to see that in Dynamics NAV, there are always more than one solution to each problem.

Please don’t forget to give the Thread a Star rating, and to mark the topic as Resolved.