Options

Items By Location Report

watungwatung Member Posts: 29
What is the easiest way to create a report using some format like in the Item Card -> Item by Location, where items are in the row and locations in the columns?

Comments

  • Options
    kinekine Member Posts: 12,562
    No easy way... may be looking into download section helps you... (navision crosstab - http://www.mibuso.com/dlinfo.asp?FileID=404)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    TirtaTirta Member Posts: 53
    How many locations in your database do you have?
    Because if you have more than hundred locations than you must have troubles to print it all :roll:

    Ok.. the easiest way to create it: use array.. for an example, look at form 151.

    or just see my code:
    Variable
    Item - Record 27
    Location - Record 14
    Loc - code 10, array 10
    Inv - Decimal, array 10
    i - Integer

    Onpredataitem
    i := 1;
    Location.FIND('-');
    REPEAT
    Loc := Location.Code;
    i += 1;
    UNTIL Location.NEXT = 0;

    OnAfterGetRecord()
    FOR i := 1 TO Location.count DO BEGIN
    Item.SETRANGE("Location Filter",Loc);
    Item.CALCFIELDS(Inventory);
    Inv := Item.Inventory;
    END;

    Section
    Item Header: No. / Loc[1] / Loc[2] .....
    Item Body: =<"No."> / =<"Inv[1]"> / =<"Inv[2]"> .....

    Selamat mencoba...
  • Options
    giulio.cipogiulio.cipo Member Posts: 77
    HI,

    when a user ask me this kind of report i use to make an export into excel instead of a print bicause in navision is not possible define a dinamic array so if you add some location the report don't work well :(
  • Options
    TirtaTirta Member Posts: 53
    Hi Cipo,
    I don't know what kind of problem do you have.
    I have just tried my code in Cronus with 7 Locations and it works fine.
  • Options
    giulio.cipogiulio.cipo Member Posts: 77
    I had a customer with a lot of location and it was impossible print all in a page ( landscape orientation) so the only solution i suggest was export in excel.
    the other problem is that you define a array with dimension 10 ( example) and after the location are 11 you colud have an error.
    anyway it was only a suggestion for company with a lot of location .
  • Options
    TirtaTirta Member Posts: 53
    That's right. I am agree with you.. it isn't a good idea to show this statistics in Report with a lot of location.
    About the error, which error message do you have?
  • Options
    giulio.cipogiulio.cipo Member Posts: 77
    the error is about the dimension of array when you try to write in array[11] and dimension was 10, sometimes happen when user add location and you don't know. :cry:
  • Options
    watungwatung Member Posts: 29
    Got it, Tirta, thanks a lot! Crosstab tool from the download requires additional table (while I don't have one) :roll: Thanks guys!
Sign In or Register to comment.