Results 1 to 9 of 9

Thread: Multiple tables in CR4.0.6.1

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2006
    Posts
    236

    Multiple tables in CR4.0.6.1

    Little by little I'm figuring Crystal Reports out.

    Now I need to place 2 sections in a single report. For instance, a table at the top would include the top 20 salespeople and their statistics. A second table a the bottom would be the names of the top 10 managers and some different statistics for them. Basically it is 2 different reports but on one page to save space. I am having no luck trying to figure this out and it may not be possible with this version of CR. If not, is it possible to put a second page in a single report with the second table info? This would be like linking 2 different reports to one printing.

    Hope this made sense ...
    Thanks,
    Ken

  2. #2
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: Multiple tables in CR4.0.6.1

    For using two different tables in a single report you have to knowledge about the proper linking (relationship) between the tables. Make a proper linking and if needed then make a group also in the report and then use it.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2006
    Posts
    236

    Re: Multiple tables in CR4.0.6.1

    That's not quite it - my mistake for using the improper terms. The data is drawn from the same table in the database. The top section uses certain fields in this table. The bottom section is separate and uses it's own headers and it's own detail section to display different fields than the top ones but all are from the same table.
    Like this:
    VB Code:
    1. [B]          Salesman[/B]
    2. [B]Employee   State   Sales[/B]
    3. Jones,Bob   OH    $34,201
    4. Smith,Hal   FL    $28,552
    5.  
    6.  
    7. [B]           Managers[/B]
    8. [B]Manager   Region   Group[/B]
    9. Horton,R     SE      15
    10. Thomas,S     NE      12

    The table then contains these fields:
    name
    job (numerical - 1 = sales, 2=manager)
    state
    region
    sales
    group

    I'm not sure this is possible ...
    Ken

  4. #4
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: Multiple tables in CR4.0.6.1

    You display the two tables here in fro using them in the crystal report, but there is no proper linking between the tables, as I mention that proper linking is necessary for using multiple tables in the crystal report.
    First define proper linking (Primary Key) and make a group then you are able to use then in the crystal report.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Sep 2006
    Posts
    236

    Re: Multiple tables in CR4.0.6.1

    I'm still confused. The primary key for the table is PlayerID although it is never displayed. Both groups of data are from the same table. How do you link one table to itself? Why would you need to?

    Thanks,
    Ken

  6. #6
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: Multiple tables in CR4.0.6.1


    Post you table structure and also post wht type of the reporting field you want in the table, If you are using one table then it is easy to make the crystal report.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Sep 2006
    Posts
    236

    Re: Multiple tables in CR4.0.6.1

    This is an abbreviated table structure:
    Table:Employees
    EmployeeID (Auto Number)(Primary Key)
    Employee (text field)
    Job (Text field S = Sales, M=Manager)
    Region (text field NE, SE, N, S, C, NW, SW)
    Sales (number)
    Team (number {Number of people in a manager's team})
    I would like the report to display like this:
    VB Code:
    1. [B]Employee     Region    Sales[/B] (Listings in this section have job of "S")
    2. Bob Smith      NE        $45,000
    3. Tom Dudly      NE        $24,563
    4. John Doe        C        $ 3,435
    5.  
    6.  
    7. [B]Manager      Region     Team[/B] Listings in this section have job of "M")
    8. Rod Smith       NE        15
    9. Bob Munro        S        12
    10. Ken Huston      SE        24
    I used the quotes and VB code to format the desired areas for clarity. The report is in two sections but all data comes from the same table. What I need is two header sections and two detail sections in the same report. I cannot figure out how to do this with CR 4.6.0.1

    Thank you,
    Ken

  8. #8
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: Multiple tables in CR4.0.6.1

    Group the report according to the job section. And make another group according to the employee name.
    Using this grouping on you database you are able to see the report as you are mentioning above.

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Sep 2006
    Posts
    236

    Re: Multiple tables in CR4.0.6.1

    Thanks for trying, but I only see 1 list ... I need 2. I guess I can only have 1 report per page. I may have to write my own printing code to get what I need.

    Thanks anyway,
    Ken

Posting Permissions

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



Click Here to Expand Forum to Full Width