Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Building Report on C/al code Navision 5.0

(0) ShareShare
ReportReport
Posted on by 952

Hi

We need to generate a report from Navision 5.0 (Incadea) from the table Service Ledger Entry.

The date from the table is as follows:

Type                      Resource No            Order No      Closed       Entry-Type     Quantity

(Option)            (Data Type: Code)          (Code)           (Boolean)   (Option)         (Decimal)

Resource                 1001                          SO-001         Yes              Usage              2.0

Labour                     T1                             SO-001          Yes              Sale                 1.5

Labour                     T2                             SO-001          Yes              Sale                  1.0

Resource                 1002                          SO-002          Yes              Usage               2.5

Labour                    T1                              SO-002          Yes              Sale                  1.5

Resource                  1003                         SO-004          No              Usage               1.0

1) If all unique Resource No, where Closed is Yes, are needed in a excel report, then can anyone confirm whether the below code is correct:

IF "Service Ledger Entry".Closed THEN BEGIN

   IF "Service Ledger Entry".FINDSET THEN

REPEAT

Variable : = "Service Ledger Entry".Resource No

UNTIL "Service Ledger Entry".NEXT = 0

END;

2) how to write the code so that we can get the sum of Quantity by Resource No where:

     Entry-Type = Sale, Closed= Yes 

*This post is locked for comments

  • Rajasekhar@MS Profile Picture
    Rajasekhar@MS 5,567 on at
    RE: Building Report on C/al code Navision 5.0

    Hi

    Create a Key with Type and Closed, in the data item table view select the key, refer the below link to create gropuheaders and group footers and place your code in the group header / footer section

    https://msdn.microsoft.com/en-us/library/dd355280.aspx

    specify Type - in the GroupTotalFields property of the dataitem

    Regards

    Rajasekhar.Y

  • Verified answer
    Mosaheb Profile Picture
    Mosaheb 952 on at
    RE: Building Report on C/al code Navision 5.0

    Hi Mahesh,

    Thanks for your input.  However, when I run the code as you mentioned above the following is being displayed on excel:

    Untitled_5F00_RESOUCE.png

    Instead I should have:

    Resource No

    1001

    1002

    etc

     

    Do you have any idea what I'm missing.  Thanks

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 44,656 on at
    RE: Building Report on C/al code Navision 5.0

    To accomplish you need a Key and set SumIndexFields for your key, you have to use SETCURRENTKEY and CALCSUMS to achieve this.  To group on a field check the following

    www.navision-girl.com/.../report-grouping-and-totalling.html

    How to get sum check this.

    msdn.microsoft.com/.../dd301396.aspx

  • mmv Profile Picture
    mmv 11,467 on at
    RE: Building Report on C/al code Navision 5.0

    Hi,

    At first the above code is to be written as :-

    IF "Service Ledger Entry".FINDSET THEN

     REPEAT

       IF "Service Ledger Entry".Closed THEN

           Variable : = "Service Ledger Entry".Resource No

      UNTIL "Service Ledger Entry".NEXT = 0

    END;

    2. For getting the Quantity grouped by Resource No, your report is to be grouped by "No." and Type. (the type could be Resource) and you may print the data on the group section.

    Please refer the below link for grouping:

    http://dynamicsuser.net/forums/p/38092/196174.aspx

    https://msdn.microsoft.com/en-us/library/dd355280.aspx

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans