简体   繁体   English

如何在加入的Crystal Reports中制作饼图?

[英]How do I make a Pie Chart in Crystal Reports that is JOINed?

I'm pretty new to Crystal Reports and I can create Pie Charts just fine, but I can't figure out how to chart a JOIN. 我对Crystal Reports还是很陌生,可以很好地创建饼图,但是我不知道如何绘制JOIN。 For example, I have two tables "A" and "B". 例如,我有两个表“ A”和“ B”。 In the "link" tab of the Database Expert I've drug a line so that A.FK goes to B.PK. 在数据库专家的“链接”选项卡中,我在一行中加了药,以便A.FK转到B.PK。

Table A      Table B
--------    --------
PK | FK      PK | FK
0  | 1       1  | Gizmos
1  | 1       2  | Gadgets 
2  | 2

The pie chart for A.FK would come out looking correct but the value in A.FK would be used in the legend, when I'm expecting the JOINed value of B.FK. 当我期望B.FK的JOINed值时,A.FK的饼图看起来会正确,但是A.FK的值将在图例中使用。 So instead of my chart having two slices called 1 and 2, I want the slices to read Gizmos and Gadgets. 因此,不是让我的图表有两个分别称为1和2的切片,而是希望这些切片读取Gizmos和Gadgets。

Can anyone please assist? 谁能帮忙吗? Thanks 谢谢

This is because you are grouping the report by A.FK - you need to change it to group by B.FK. 这是因为您要按A.FK分组报告-您需要将其更改为按B.FK分组。

To do this: 去做这个:

  1. Right-click on your chart and select Chart Expert. 右键单击图表,然后选择“图表专家”。
  2. In the Chart Expert dialog, click on the Data tab. 在“图表专家”对话框中,单击“数据”选项卡。
  3. Select B.FK from the Available fields, and click on the first > button to add it to the list of grouping fields (to the right). 从“可用”字段中选择“ B.FK”,然后单击第一个>按钮将其添加到分组字段的列表中(右侧)。
  4. Select A.FK from the list of grouping fields and click on the first < button to remove it from the list. 从分组字段列表中选择A.FK,然后单击第一个<按钮将其从列表中删除。 Your chart should now be grouped on change of B.FK. 现在,您的图表应根据B.FK的变化进行分组。
  5. Click OK at the bottom of the dialog. 单击对话框底部的确定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM