Crystal Reports 9 The Complete Reference PHẦN 5 doc

89 256 0
Crystal Reports 9 The Complete Reference PHẦN 5 doc

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Chapter 12: Creating Charts 327 CRYSTAL REPORTS 9 INTRODUCED choices, shown as thumbnails on the right. To use the specific type of chart, click the thumbnail that best represents what you want to use. You’ll see a description of the layout and uses of the chart in the scroll box below. Certain chart types give you a choice of horizontal or vertical direction. If you choose vertical with a bar chart, for example, the bars will grow out of the bottom of the chart. If you choose horizontal, they will spread from the left of the chart toward the right. If you check Automatically Set Chart Options, the Axes and Options tabs (discussed later in the chapter) will disappear from the Chart Expert and default settings for items on those tabs will be chosen. If you don’t like the default settings or need to customize some settings on the Axes or Options tabs, uncheck this option. The tabs will return to the Chart Expert, where you may choose your custom settings. The Data Tab The Data tab is where you choose the layout for the chart—whether it will be an Advanced, Group, Cross-Tab, or OLAP chart. You also use the Data tab to select the actual database or formula fields you want Crystal Reports to use when creating your chart, to choose where you want the chart placed, and to specify when you want the chart to “change” graphically (when you want a new bar or pie slice to be created, when you want a new point plotted on the line, and so on). Begin by choosing the chart layout you want to use. The following four buttons on the left side of the Data tab may or may not be enabled, depending on other elements in your report: ■ Group Available only if at least one group has been created on your report. ■ Advanced Always available, although it is the default button only if nothing else is available. ■ Cross-Tab Available only if one or more cross-tab objects already are on the report. If you have more than one cross-tab but haven’t selected the cross-tab you want to chart first, this button will be disabled. ■ OLAP Available only if one or more OLAP grids already are on the report. If you have more than one OLAP grid but haven’t selected the grid you want to chart first, this button will be disabled. The only parts of the Data tab that remain constant regardless of the button you choose are the Place Chart drop-down list and the Header and Footer radio buttons. The Place Chart drop-down list lets you choose where on the report you want Crystal Reports to initially place your chart. Again, depending on the chart type you use, the choices here will be different. Group charts can be placed in a higher-level group or in the report header and footer. Advanced, Cross-Tab, and OLAP charts can be placed in a group or report header or footer. Choose Once per Report or For Each group from the drop-down list. Then click the radio button that corresponds to where in the report you want the chart placed—the header or footer. The rest of the Data tab will change based on the chart layout button you click. Group A Group chart will graph data from fields in an existing report group. You have to have at least one group defined, with at least one subtotal or summary field, before you can use this button. Figure 12-2 shows the Data tab when the Group button is clicked. The On Change Of drop-down list lets you choose when you want the graph to start a new element. If, for example, you choose Customer.Country, a new bar will show up in a bar chart for every country. Or for another example, if you choose Employee.Last Name, a new slice in a pie chart will appear for every employee. The On Change Of drop-down list’s contents change in correlation with what you choose in the Place Chart drop-down list. In essence, the On Change Of drop-down list shows you one or two levels lower than where you’re placing your chart. For example, if you choose to place the chart Once per Report, the On Change Of drop-down list will 328 Crystal Reports 9: The Complete Reference Figure 12-2. Data tab for Group button Choose whether to place the chart in the report header/footer or a higher-level group header/footer Choose the group you want to use to create the chart Choose the summary field in the group you want to base the chart on Chapter 12: Creating Charts 329 CRYSTAL REPORTS 9 INTRODUCED show the highest-level group on the report. If there is more than one group, it will also show an additional option of showing the highest-level group and the next-highest-level group. If you choose to place the report in a group, On Change Of will show the next two lower-level groups, and so on. Here’s an example of what shows up in the On Change Of drop-down list when the chart is placed Once per Report and there are country and region groups on the report: If you choose a single group, your chart will just summarize the values in that group, as shown here: If you choose the two-group option, Crystal Reports actually creates multiple sections of the chart—the first section based on the first group, each containing individual chart elements based on the second group, like this: The Show drop-down list lets you choose what makes up the chart element. If, for example, you create a bar chart with On Change Of set to Customer.Country, and Show set to Sum of Orders Detail.Order Amount, you’ll see a new bar for every country. The bar’s height or width (depending on whether you chose a horizontal or vertical bar chart) will be based on the subtotal of Order Amount for the group. The Show drop-down list is populated according to what subtotal and summary fields you place in the group header or footer of the group chosen in On Change Of. For a group graph to work, you must have at least one summary or subtotal for the group—if you don’t, the Group layout button won’t even be available. Advanced An Advanced chart graphs data from the details section of your report. Although you can create an Advanced chart even if you have groups defined, it won’t be affected by the groups at all. Figure 12-3 shows the Data tab when the Advanced button is clicked. This rather busy dialog box lets you choose data from the report or database to create a chart (fields don’t have to be used on the report to be used to create the chart). Because several different fields in the database can affect the chart’s appearance, a little more forethought is required when using this dialog box. 330 Crystal Reports 9: The Complete Reference The Available Fields list shows report, formula, subtotal/summary, running total, and database fields in the report. You can select any of these fields that you need for creating your chart (except summary/subtotal fields, which can be used only in the Show Value(s) list). If you’re unsure what kind of data is in a field, select it and click the Browse button to see a sample of database data. Once you’re ready to use a field as either an On Change Of or Show Value(s) field, select the field and click the right arrow next to the box where you want the field placed. It will be copied to the box on the right. Chapter 12: Creating Charts 331 CRYSTAL REPORTS 9 INTRODUCED Figure 12-3. Data tab for the Advanced button Choose whether to have a new chart element appear for every record, or just when one or more fields change List of fields chosen from Available Fields list (available only when On Change Of is chosen from the drop-down list above it) Field(s) and summary function each chart element will represent TEAMFLY Team-Fly ® The drop-down list in the upper right gives you three choices: On Change Of, For Each Record, and For All Records. The choice you make here determines how often a new chart element (bar, pie slice, and so on) will appear in the chart. If you choose For Each Record, a new element appears in the chart for every record in your details section. This may be useful for very small tables that have only a few records in them. However, if your database has more than a few records, making this choice will probably render a chart that’s too crowded to be of any real value. If you choose For All Records, you essentially create a grand total chart, showing just one element that displays a total of all records on the report. If you choose the For All Records choice, the box below the drop-down list remains empty—you won’t be able to add any fields to it from the Available Fields list. An improvement in version 9 lets you add one field from the Available Fields list if you choose For Each Record—this field will label each chart element. By choosing On Change Of in the drop-down list and choosing one or more fields from the Available Fields list (except group summary or subtotal fields), you can create a chart that summarizes values for each record. This option basically creates an invisible group on your report and creates a new chart element every time the chosen field changes. For example, if your report contains no groups but you choose On Change Of Customer.Country, your chart will have a new element appear for each unique country that appears in the database. Whatever field you add to the Show Value(s) list will be summarized or subtotaled by country, and the result will be used as the value for the chart. You can choose one or two fields to add to the On Change Of list. This works like the Group chart option, described previously, in which you can choose to show the highest-level group and the next-highest-level group. If you choose one field, the chart will contain only one section with all the elements located in it. If you choose two fields, the chart will be broken into side-by-side sections, with the first-chosen field making up the first section. Then, individual elements for the second field will appear within each of the sections based on the first field. Although there isn’t an actual group on the report, Crystal Reports is creating an “invisible” group to base your chart on. You have control over the way the Chart Expert uses these groups. The TopN and Order buttons control this. If you click the TopN button, you’ll see the Group Sort Expert dialog box, in which you can choose to include only the top N, bottom N, Top N Percentage, or Bottom N percentage groups in your chart, and choose which number to use for N. 332 Crystal Reports 9: The Complete Reference If you click the Order button, you’ll see the Chart Sort Order dialog box with a drop-down list containing Ascending, Descending, Specified Order, and Original Order options. You may choose to show the chart elements in A to Z order, Z to A order, or using specified grouping (and, if you recall from Chapter 3, although Original Order is an option, it’s probably of little use). If the chosen field is a date, time, or date/time field, you can choose how often you want a new chart element to appear (monthly, weekly, every minute, hourly, and so on). Refer to Chapter 3 for information on Top N, Specified Order grouping, and grouping on date/time fields. Chapter 12: Creating Charts 333 CRYSTAL REPORTS 9 INTRODUCED 334 Crystal Reports 9: The Complete Reference Once you’ve chosen a field in the On Change Of box to determine when a new chart element will appear, you can add a field or fields to the Show Value(s) list to indicate which values Crystal Reports will use to size the chart element. If you add multiple fields to this list, the chart will contain multiple bars, lines, and so forth— one for each field you add to the list. If you add a number or currency field to this list (and you haven’t chosen For Each Record in the top drop-down list), Crystal Reports automatically uses the Sum function to subtotal the field for each invisible group. If you choose another type of field, Crystal Reports automatically uses the Count function. If you wish to change the summary function (for example, to graph the average sales amount instead of the total), you can select the field you want to change in the Show Value(s) list and click the Set Summary Operation button. A dialog box will appear with a drop-down list containing the available summary functions for that type of field. Choose the summary function you want used to size the chart element. The Percentage Summary Field option for group summaries, discussed in Chapter 3, is also available here. By checking the Show As a Percentage Of check box, you can choose a higher-level group total or grand total, and chart elements will display the percentage of the higher totals that each of the invisible group totals represents. If you choose For Each Record in the top drop-down list, Crystal Reports will display a new chart element for every record on the report—no invisible group will be created. In this case, any fields you add to the Show Value(s) list won’t be summarized— whatever value the fields return for each record will be charted. In previous versions of Crystal Reports, if you chose On Change Of in the top drop-down list and the invisible groups were created, you could specify that one or more values in the Show Value(s) list not be summarized, by selecting the field and checking Don’t Summarize Values. While this check box still appears in the Advanced chart options for version 9, it’s always grayed out and can’t be used. Cross-Tab The Cross-Tab button is available only if you have one or more cross-tab objects on your report. If you have only one cross-tab object, this button will be enabled even if you haven’t selected the cross-tab first. However, if you have more than one cross-tab, you must select the cross-tab that you want to chart before you start the Chart Expert (Chapter 11 discusses cross-tab objects). Figure 12-4 shows the Data tab when the Cross-Tab button is clicked. The On Change Of drop-down list includes the two outer fields you chose for your cross-tab row and column; if you used multiple row and column fields, only the first row or field can be used. Crystal Reports will create one chart element (bar, pie slice, and so on) for each occurrence of this field in the cross-tab. Chapter 12: Creating Charts 335 CRYSTAL REPORTS 9 INTRODUCED Figure 12-4. Data tab for the Cross-Tab button Choose row or column field to determine chart element Optionally choose other row/column for multipart chart Choose summary field for chart 336 Crystal Reports 9: The Complete Reference The Subdivided By drop-down list is initially set to None. If you leave it this way, the chart will create only one series of chart elements, based on the field in the On Change Of drop-down list. If, however, you want to create two series of elements for side-by-side comparison, or if you’re using a 3-D riser or 3-D area chart and want to see multiple elements three-dimensionally, choose the other row/column field in the Subdivided By drop-down list. The Show drop-down list shows the summary field or fields you placed in your cross-tab. Choose the field that you want to use in your chart. This field determines the size of the chart elements (height of a bar, size of a pie slice, and so forth). The following illustration shows the resulting 3-D riser chart for the Data tab shown in Figure 12-4: OLAP The OLAP button is available only if you have one or more OLAP grid objects on your report. If you have only one OLAP grid, this button will be enabled even if you haven’t selected the OLAP grid first. However, if you have more than one OLAP grid, you must select the grid that you want to chart before you start the Chart Expert (Chapter 18 discusses OLAP reporting). Figure 12-5 shows the Data tab when the OLAP button is clicked. Creating a chart based on an OLAP grid is very similar to creating a chart based on a cross-tab. There are just a couple of differences between the two. There is no summary field to choose (OLAP grids display only one value, so there is no choice to make). Also, the dimension hierarchy of your OLAP grid may be a little different than the multiple row/column fields you added to a cross-tab object. [...]... on the chart in the associated text boxes on the Text tab If you leave a text box blank, that title won’t appear on the chart To change the appearance of the different items, select the item you want to change in the list on the lower right of the Text tab Then, click the Font button to choose the 343 CRYSTAL REPORTS 9 INTRODUCED Show chart in color or black and white Creating Charts 344 Crystal Reports. .. your OLAP grid CRYSTAL REPORTS 9 INTRODUCED Optionally choose another dimension for multipart chart 337 338 Crystal Reports 9: The Complete Reference Depending on how many dimensions your OLAP grid contains, and how the fields that make up the dimension relate to each other (their hierarchy), you may need to filter the chart to just certain field values in a dimension To do this, click the Other Dimensions... menu in previous versions of Crystal Reports The Analyzer view and its related toolbars and menus have been eliminated from Crystal Reports 9 You may make all the previous Analyzer choices on either Chart pop-up menus or the Chart pull-down menu in version 9 348 Crystal Reports 9: The Complete Reference Drilling Down on Charts If you create a Group chart, you’ll notice the mouse cursor change to a... sections, thereby printing the chart alongside the other items For this to work effectively, you need to size and move the details section objects so that they won’t be overprinted by the chart Then, move and size the chart so that it will appear to the side of the details section objects Using the Section Expert, choose the Underlay Following Sections option for the section containing the chart If there... make manual changes to the viewing angle with options on the tab, rather than choosing one of the built-in presets or named angles, 356 Crystal Reports 9: The Complete Reference Choose from one of the preset viewing angles Choose from one of the saved viewing angles Manually rotate the chart by clicking the arrows Figure 12-13 Save, delete, and rename saved viewing angles for the drop-down list Choose... you can save the settings in a chart template You can then apply the template to another chart that you create or edit To save a template, make any desired changes to your chart, such as changing label positions, element colors, perhaps the legend position, and any other settings you want 358 Crystal Reports 9: The Complete Reference to make Then, either choose Chart | Save as Template from the pull-down... print the main report, the subreports will be processed and printed at the same time, appearing inside the main report The following are the two main types of subreports: I Unlinked subreports Have no tie-in to the main report at all—they exist completely on their own and don’t typically communicate with the main report The Company Condition report mentioned previously falls into this category Each of the. .. to Automatic, Crystal Reports will create a predefined number of labels and gridlines for the data axes Clicking the Manual radio button and specifying a number in the text box will create your specified number of divisions, along with labels and gridlines, for the data axes 342 Crystal Reports 9: The Complete Reference Not all of the options on the Axes tab will necessarily apply to the style of chart... to fill the chart element with a picture, choose one of the corresponding buttons on the right side of the Formatting dialog box For example, clicking the gradient button displays a dialog box showing preset color gradients If you click the Advanced Options button, the gradient dialog box displays an extra section that lets you design your own gradients 353 354 Crystal Reports 9: The Complete Reference. .. Tab The Axes tab will appear if you leave the Automatically Set Chart Options check box unchecked on the Data tab The Axes tab gives you complete control over how Crystal Reports displays the X, Y, and Z (if you’re using a 3-D chart) axes of the chart Figure 12-6 shows the Axes tab By making choices in the Axes tab, you can control how Crystal Reports displays axes on your charts The axes are the areas . with the dimension hierarchy displayed in an Explorer-like fashion. 338 Crystal Reports 9: The Complete Reference Chapter 12: Creating Charts 3 39 CRYSTAL REPORTS 9 INTRODUCED Navigate through the. using a 3-D chart, the data axis is the Z axis, and a new axis called the series axis is the Y axis, like this: 340 Crystal Reports 9: The Complete Reference Figure 12-6. The Axes tab Displays. date/time fields. Chapter 12: Creating Charts 333 CRYSTAL REPORTS 9 INTRODUCED 334 Crystal Reports 9: The Complete Reference Once you’ve chosen a field in the On Change Of box to determine when a new chart

Ngày đăng: 12/08/2014, 16:20

Tài liệu cùng người dùng

Tài liệu liên quan