Creating a new report

LittleboboLittlebobo Member Posts: 15
Hello there,

I am fairly new to Navision development and am currently trying to create a report using table 110 and 111 sales shipment header and lines.

I am using the sales shipment line table to pull through a majority of the information and grouping it by document no, the only problem i have is when i try and link the tables together (using the Dataitem link reference property) is that the order date field seems to not populate correctly for example if i enter a search in looking for shipments with an order date of 010909 it will just assign this date to all lines on the report regardless of whether the actual order date is 010909, I have also noticed that it takes a very long time to run.

as soon as i remove the link it runs fine and the information is correct but I have no idea what i need to do to resolve the problem.

If anyone can offer any advice I would be most grateful.

Thanks, ](*,) ](*,) ](*,)

LittleBoBo
When your going through hell just keep on going ;)

Comments

  • DaveTDaveT Member Posts: 1,039
    Hi,

    The link between the tables (110 & 111) is simply the document no.

    Can you describe the backgorund of the report as I suspect that you don't need a dataitem for the shipment header and need to use a record variable to lookup values instead.
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • LittleboboLittlebobo Member Posts: 15
    Hello Dave,

    The idea of the report is very simple so perhaps you are right.

    All i need to do is show shipments by line to show the shipment date, posting date, Qty shipped, qty base, order no, and order date which is then grouped by document no. is there a simpler way to do this ?

    I have changed the link to show document no and it worked a treat however i seem to get a blank order date at the very start of the report all other lines seem fine, I also seem to get occasional blank lines i suspect this is where they enter additonal comments on a sales shipment line and the report is picking these up ?

    Also is there an easy way to work out what fields are linked fields ????
    When your going through hell just keep on going ;)
  • DaveTDaveT Member Posts: 1,039
    Hi,

    You probably don't need the Sales Shipment Header dataitem and a variable will do. Declare a variable (ShipmentHeader) of Datatype record and Subtype Sales Shipment Header. In the OnAfterGetRecord of the Sales Shipment Line dataitem add the code:

    ShipmentHeader.GET( "Document No." );

    You can then print the ShipmentHeader variable values.

    To ignore comment filter on the Type of the line - either not equal to blank or equal Item only.
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • DenSterDenSter Member Posts: 8,304
    Nah I would keep the header dataitem, indent and link the line dataitem to it, and put the grouping in a line footer section. Automatic grouping by document number, no code, and the field values in the header record are readily available without any code. There's no rule that says you must have a section for every dataitem.
  • LittleboboLittlebobo Member Posts: 15
    Okay i am keeping the data item, I have managed to get it running and looking okay although it is pulling through blank lines ](*,) ](*,) ...these lines are sales shipment text lines that have been entered on the shipment ..any ideas for getting rid of them ???
    When your going through hell just keep on going ;)
  • DenSterDenSter Member Posts: 8,304
    Two ways to get rid of those:
    1 - write some code to skip certain types of lines (hint: CurrReport.SKIP)
    2 - put a filter on the line dataitem on the Type field (the preferred method, as DaveT has already eloquently alluded to)
  • LittleboboLittlebobo Member Posts: 15
    Thanks Denster yes i realised i could add a filter in in the end !!!

    Thanks so much every one !
    When your going through hell just keep on going ;)
  • DenSterDenSter Member Posts: 8,304
    You're welcome, and good to hear you got that to work.
Sign In or Register to comment.