NAV 2016 - Code on PostDataItem and RDLC report

rnjbngrnjbng Member Posts: 82
Hi Folks -

I have a RDLC report in Nav 2016 which has 2 dataitems
Location
Item ledger entry

Based on certain condition I doing calculation in Item ledger entry OnAfterGetRecord and and storing in a array and OnPostDataItem of Location dataitem I am arriving at the final values and putting them in variables.

I am trying to print those OnPostDataItem variables of Location dataitem in the RDLC visual studio on footer at the end of the report and it just does not print. When I run the debugger it calculates the values correctly.

Can't I print the variables used on OnPostDataitem of a dataitem or is there any other way this can be done.

Any help is highly appreciated.

Regards
RJ.

Answers

  • JuhlJuhl Member Posts: 724
    Calculate it in OnAfterGetRecord, and then take the last row in the rdlc.
    Follow me on my blog juhl.blog
  • elwahid@hotmail.comelwahid@hotmail.com Member Posts: 2
    edited 2020-02-05
    What You want to do a grouping per location? You only need to do grouping per location in the Report Designer. create 2 groups, the first group is the group header with grouping per location. and other groups are details. You only need to sum variable needed. you cannot show value from event OnPostDataitem on layout. OnPostDataitem events are commonly used for updating after looping data items such as changing the number of printed.
  • edoderooedoderoo Member Posts: 89
    Probably they will print if you do not print them in the *footer* but in the *body* of the report. You have to do some "dirty tricks" to move data from the body to the footer/header of the report, like is done in the invoice/order confirm/etc reports in standard NAV. You can find some good examples of how to create an invoice report on YouTube, the trick is explained there too.
    IF User.Loves('Edo') THEN ok() ELSE currReport.genSkip;
Sign In or Register to comment.