Reset method and re-defining GroupTotalFields?

Hello. This is my third week with MBS Navision Attain. I am now dealing with a report. My question is about the RESET method of Record Object. If I Reset a Record, I lose all of the filters. If I reset an indented DataItem, is link between the Dataitem and its parent lost? If It is Yes, how can i re-establish the link again. And I know how to define the currentkey, total fields and filter a table. But how can I re-define GroupTotalFields (or do i need to redefine)at Runtime from triggers or my own methods? Is there any method to define grouptotal fields? Thank you very much.

Hi Serdar, Could you please explain what kind of report you are trying to build? For most of the reports in Navision, you do not have to change the keys and filters (RESET) of a dataitem (= record = representation of a table) at runtime. Most of the time, you set the KEYS and filters once (DataItemTableView) and it never changes. However, sometimes in more complex reports, you’ll need for example to different “views” of a table. In this case, a good idea might be to create a new record with the different view of your dataitem (ex: JobLedgEntry and JobLedgEntry2). So if you change the keys and filters of JobLedgEntry2, it won’t affect your main dataitem. In the same way, GroupTotal fields used to be set once for the dataitem (in properties). Another way to create totals is the function CREATETOTALS (see documentation). Finally, if you are working on your first reports, I strongly recommend that you do all the exercices in the Programming Manual. The reports in Navision are not always intuitive and it takes a little time to figure out how to use it.

Hi Serdar, I am guessing that you are new to Navision. Its important to understand the Navision way of doing things, since they are somewhat different to Access, VB, or where ever it is you are coming from. Spend the time as David G mentions and learn Navision. You will spend less time beating your head against the wall, and more time delivering product to the client.

Hi. I exercised all the examples in the documents. But my report is quietly hard. Let me explain my report detailed. It will show purchases and tax for each vendor. Tax Transaction table is indented under Vendor table. I have no problem with this. The problem is that I have to group these records according to financial years. Financial Years for Example. 01/07/00 … 30/06/01 01/07/01 … 30/06/02 01/07/02 … 30/06/03 and so on… I have a two dimensional date array which stores these values. If user inputs Startdate as 01/04/00 and Enddate as 01/08/00, then two reports should be generated. The first one must be filtered from 01/04/00 to 30/06/00. The second one must be filtered from 01/07/00 to 01/08/00. So the range can change according to the user input. I think I should reset each Tax Transaction Dataitem at its onpostdataitem trigger and then redefine the filters (new dates), total fields and others in onpredataitem trigger of this dataitem. I don’t know. Do you have any suggestions?

You need to use the DATE table as one of the data items.

Hello, I’ve solved this problem by using processing forms. Date interval is taken through a request form. I also wrote a method that extracts financial years from the input dates and stores them into a two-dimensional date array. After that, report is invoked several times (depending on the size of array) with a new recordset which is filtered with new dates. Meanly If user enters a date interval that contains two financial years, then report is invoked twice. I know it’s a work-around of work-around but it works. Best Regards Serdar Ulutas

Upps. Let me correct myself. I’ve used a processing report. Not processing form which is not available in Navision. Sorry Regards Serdar Ulutas

As I have experienced more in Navision, I solve problems with less work-around of work-around. When I asked this question, I had had no idea about using INTEGER as dataitem. As I’ve said before I can pick seperate financial years from user input and save them in a two-dimensional array. After this categorisation what I should do is filtering INTEGER data item from 1 to the size of my array such Integer.SETFILTER(Number,’>0 & <=’+Format(ArraySize)) where ArraySize is an Integer. After setting NewPagePerRecord property of Integer DataItem to YES, my report has worked fine.