display in the same line data from different tables?

gumwitka
gumwitka Member Posts: 34
Hi,

in the report based on Purchase Line I need to display info from Vendor table (Vendor Name). I need to do that in section "Purchase Line Body" because I want to have it for every purchase line. Is it possible to display that in the same line? #-o

Answers

  • andhilda
    andhilda Member Posts: 26
    It is rather easy. Just create a var=Vendor and then get the vendor for each line you are printing. Create a textbox on the section you want the info printed and set the source exp. equal the vendor.name.

    Best regards,

    Torben
  • gumwitka
    gumwitka Member Posts: 34
    yes, but first you have to link those two tables.

    I have already solved it this way:

    RecVendor.SETCURRENTKEY("No.");
    RecVendor.SETRANGE(RecVendor."No.","Purchase Line"."Buy-from Vendor No.");
    IF RecVendor.FIND('-') THEN
    VendorName := RecVendor.Name;

    Thanks for your help

    Kasia
  • ara3n
    ara3n Member Posts: 9,258
    make sure you clear the VendorName
    VendorName := '';
    RecVendor.SETCURRENTKEY("No.");
    RecVendor.SETRANGE(RecVendor."No.","Purchase Line"."Buy-from Vendor No.");
    IF RecVendor.FIND('-') THEN
    VendorName := RecVendor.Name;
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • davmac1
    davmac1 Member Posts: 1,283
    You could do it the easy way by adding vendor name as a flowfield to the line table
  • ara3n
    ara3n Member Posts: 9,258
    that is not a good solution. One of the goals when you make modification is to keep the modification as small and simple as possible. Also to think about it from upgrade perspective. You don't want to modify a table just for one report. Now you have two objects modified instead of one.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • gumwitka
    gumwitka Member Posts: 34
    Great thanks!
  • Waldo
    Waldo Member Posts: 3,412
    I agree with ara3n.

    You must think about performance as well. Creating flowfields just to print on reports will result in a jungle of flowfields, which is bad for performance on log terms... .

    I know it is much easier to implement (even a customer with Report designer and table designer granules can do it), but it's a bad idea ... .

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog