简体   繁体   中英

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. For example, I have two tables "A" and "B". In the "link" tab of the Database Expert I've drug a line so that A.FK goes to 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. So instead of my chart having two slices called 1 and 2, I want the slices to read Gizmos and 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.

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).
  4. Select A.FK from the list of grouping fields and click on the first < button to remove it from the list. Your chart should now be grouped on change of B.FK.
  5. Click OK at the bottom of the dialog.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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