+ Reply to Thread
Results 1 to 4 of 4

Thread: Crystal Report - Linked table

  1. #1
    Arg81's Avatar
    Arg81 is offline VB.NET Forum Idol Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame
    .NET Framework
    .NET 2.0
    Join Date
    Mar 2005
    Location
    Midlands, UK
    Age
    28
    Posts
    943
    Reputation
    263

    Default Crystal Report - Linked table

    Good afternoon

    I'll try to explain this as best I can.

    Have a report that shows main table fields and then "links" to lookup tables
    I have 2 fields "Technician A" and "Technician B"
    In my DataSet, there are 2 datatables, TechA and TechB (both with EmployeeID, EmployeeName)

    Technician A is always going to have a value. B will only be selected for larger projects.

    In Database Expert, I have linked TechnicianA to EmployeeID (TechA) and TechnicianB to EmployeeID (TechB)

    On the report, I have dragged EmployeeName from both dataTables.

    ISSUE
    If the project DOES have a value set for EmployeeB, the report loads OK.
    If the project DOES'NT have a value set for EmployeeB, the report loads Blank.

    If I remove EmployeeName from the report (TechB), the report loads OK.


    There's obviously an issue with the link, any ideas? I need the report to load whether or not TechnicianB has a value or not.

  2. #2
    Arg81's Avatar
    Arg81 is offline VB.NET Forum Idol Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame
    .NET Framework
    .NET 2.0
    Join Date
    Mar 2005
    Location
    Midlands, UK
    Age
    28
    Posts
    943
    Reputation
    263

    Default

    If I set this to a LeftOuterJoin (right join is greyed out) then the report loads... but it repeats for the number of employees that are in that DataTable, in this case 7 Technicians so it will repeat 7 times....

  3. #3
    Arg81's Avatar
    Arg81 is offline VB.NET Forum Idol Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame
    .NET Framework
    .NET 2.0
    Join Date
    Mar 2005
    Location
    Midlands, UK
    Age
    28
    Posts
    943
    Reputation
    263

    Default

    Left Outer Join works perfectly if there is no TechnicianB.
    It'll load the report but leave the field blank.

    If I try it for a project that has a TechnicianB, that's when it'll repeat for the amount of users in the TechB dataTable......

  4. #4
    Arg81's Avatar
    Arg81 is offline VB.NET Forum Idol Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame Arg81 puts e.f. hutton to shame
    .NET Framework
    .NET 2.0
    Join Date
    Mar 2005
    Location
    Midlands, UK
    Age
    28
    Posts
    943
    Reputation
    263

    Default

    Now solved...

    Left outer join is correct.

    The reason for the duplication was due to me linking my CustomerID to the 2 Customer tables I had, both of which had 2x Primary Keys.
    Instead I needed to link the main table to my first customer table on CustomerID, then link this to the second customer table on CustomerID.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts