使用table_2显示crystal report中table_1中每行的详细信息

时间:2015-03-16 06:23:56

标签: vb.net crystal-reports

我有两张桌子

    +----------------+                +---------------+
    |   Fruit_list   |                | Price_history |
    +----------------+                +---------------+
    |   fruit_id     | ----\          |  price_id     |
    |   fruit_name   |      \-------> |  fruit_id     |
    |   *others      |                |  date         |
    +----------------+                |  price        |

    +-------------+---------------+
    |  fruit_id   |  fruit_name   |
    +-------------+---------------+
    |      1      |     Apple     |
    |      2      |     Guava     |
    |      3      |     Starapple |
    |      4      |     Pear      |
    |      5      |     Banana    |
    +-------------+---------------+

    +-------------+---------------+----------+----------+
    |  price_id   |  fruit_id     |   date   |   price  |
    +-------------+---------------+----------+----------+
    |      1      |     2         |  1/25/08 |    1.2   |
    |      2      |     3         |  2/25/09 |    1.8   |
    |      3      |     4         |  9/17/09 |    2.1   |
    |      4      |     2         | 10/16/09 |    0.9   |
    |      5      |     4         |  1/03/10 |    2.5   |
    |      6      |     4         |  1/05/10 |    2.3   |

我的问题是
如何使用外键或链接在详细信息部分中将这两个表连接到水晶报表中。

报告应该像这样结束

    +-------------+-----------+----------+
    |  fruit_name |  date     |   price  |
    +-------------+-----------+----------+
    |   Apple     |    N/A    |    N/A   |
    +------------------------------------+
    |   Guava     |   1/25/08 |    1.2   |
    |             |  10/16/09 |    0.9   |
    +------------------------------------+
    |   Starapple |   2/25/09 |    1.8   |
    +------------------------------------+
    |   Pear      |  9/17/09  |    2.1   |
    |             |  1/03/10  |    2.5   |
    |             |  1/05/10  |    2.3   |
    +------------------------------------+
    |   Banana    |   N/A     |    N/A   |

我不想使用子报告 请帮忙

我希望现在会更清楚

1 个答案:

答案 0 :(得分:0)

实现此类要求..您需要链接数据库专家中的表,然后按fruit name分组,然后在详细信息部分中放置必填字段