Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CRW_REF.PDF
Скачиваний:
5
Добавлен:
13.02.2015
Размер:
13.99 Mб
Скачать

" Click OK.

#Close Seagate Crystal Reports and then reopen. The program will now allow you to access any database, regardless of size.

NOTE: Any reports that are open when the Optimize for Large Database check box is toggled on will not be affected by this

option. Seagate Crystal Reports will continue to work with this report with the database outline stored in memory.

HANDS-ON (Reporting on OLAP data)

The following tutorial demonstrates basic techniques for creating a cross-tab report based on the Arbor Essbase Sample Basic database. If you do not have access to this database, contact you Network Administrator. In addition to this tutorial, Seagate Crystal Reports online Help file contains several more tutorials for reporting on Essbase data. Search for Working with Essbase in Seagate Crystal Reports online Help.

How to create a cross-tab with Essbase data

A cross-tab report illustrates how one set of data relates to another set of data. Often, each set of data comes from a different dimension in the Essbase database, and the report can be viewed as a true dimensional report based on dimensional data.

Cross-tabs are the most natural types of reports to create with OLAP data, and you may find yourself using the Cross-Tab Report Expert for most of your reporting tasks. Because cross-tab data is laid out similar to a spreadsheet, you may already be familiar with many of the concepts illustrated here, and you will start building expert cross-tabs with very little training.

Cross-tab reports can actually be designed using any of three different methods in Seagate Crystal Reports:

1.Using generational data in the Cross-Tab Report Expert,

2.Using dimensional data or a combination of dimensional and generational data in the Cross-Tab Report Expert, or

202

Seagate Crystal Reports User’s Guide

Adding data

with the Members Tab

3.Using dimensional data in a columnar report and manually constructing the cross-tab by moving and formatting data fields in the application window.

Each method has advantages and disadvantages. For a complete description of each method for creating cross-tabs, search for Cross-Tab Options in Seagate Crystal Reports online Help.

This tutorial takes you through the steps of creating a cross-tab report using generational data in the Cross-Tab Report Expert.

Start Seagate Crystal Reports, click the NEW button on the standard toolbar, then click the Cross-Tab button in the Report Gallery. The Create Report Expert appears.

On the Data Tab of the Create Report Expert, scroll down, and click the Essbase button. The Essbase Server Login dialog box appears. Log on to Essbase using your standard Essbase user name and password.

NOTE: If you have already logged on to Essbase while creating a previous report, and have not yet exited Crystal Reports, you will not need to log on again.

!Click OK on the Essbase Server Login dialog box, and the Essbase Application & Database dialog box appears.

Select the Basic database from the Sample application, and click OK. The Basic database will appear in the database list of the Data Tab.

In this tutorial, you will design a cross-tab report that displays Profit data over time. You will need to select members from the Measures dimension and the Year dimension in the Sample Basic database.

" Click the Members Tab in the Create Report Expert.

On the left side of the tab is the Database Fields list box displaying all available dimensions in the database, and on the right side of the tab is the OLAP Members list box.

#First, select members from the Year dimension. This cross-tab will display Profit related data for each quarter, with a final column displaying data for the entire year. Select the Year dimension in the Database Fields list box, and click Add. Year appears in the OLAP Members list box.

Reporting on OLAP data

203

Using the

Cross-Tab Tab

$Select Year in the OLAP Members list box, and click the Properties button below the list box. The Member Properties dialog box appears.

%Select This member's children, and click OK. Do not select This member and children. Although final Year totals for Profit data will appear in the cross-tab, this report will not get that data from the Essbase derived aggregate for Year. Instead, the program will calculate the result using smart aggregation.

&After you click OK in the Member Properties dialog box, (children ONLY) appears next to the Year member in the OLAP Members list box.

You also need to add data from the Measures dimension, the dimension that contains Profit related data.

'Click the node next to the Measures dimension in the Database Fields list box. The Profit, Inventory, and Ratios members are displayed.

Select the Profit member, and click Add. Profit is added to the

OLAP Members list box.

Select Profit in the OLAP Members list box, and click the Properties button. The Member Properties dialog box appears.

This time, select the This member and descendants option, and click OK.

Profit data is much more complex than the Year dimension, and it will be easiest if the report obtains all aggregates in the Measures dimension directly from Essbase. This time, the program will use smart aggregation to recognize that Profit is an aggregate derived from its descendants and will not calculate a Total for the members of the Measures dimension.

Now that you have selected the data that will appear on your report, you need to design the cross-tab report itself.

! Click the Cross-Tab Tab to begin designing your cross-tab report.

The list box at the lower left corner of the Cross-Tab Tab shows Essbase dimensions. If you selected members from a specific dimension on the Members Tab, that dimension appears here with a separate listing for each generation in that dimension.

204

Seagate Crystal Reports User’s Guide

However, only generations up to the highest generation you selected appear here.

For example, when you selected the Profit member and its descendants, each generation from the Measures dimension was added to the OLAP Generation Fields list. When you selected the children of Year, only generations 1 and 2 from the Year dimension were included in this list because you did not indicate any members from generation 3 of the Year dimension.

When you add a generation from a dimension to the Rows or Columns sections of a cross-tab, a band is created in the crosstab report for that generation, and only members that you specified on the Members Tab are included in the band. If you add Basic.Measures, Generation 2 to the Rows section, for instance, only the Profit member will appear in the cross-tab. Even though Inventory and Ratios are also generation 2 members of Measures, you only included the Profit member from generation 2 when you selected members on the Members Tab.

Smart aggregates are created for any dimension generations appearing here that you did not specifically select. For example, you selected only the children (generation 2) of Year on the Members Tab, but generation 1 (Year itself) also appears in the OLAP fields list. If you include Basic.Year, Generation 1 in your cross-tab, the program will create a Year band and calculate the aggregate based on generation 2 members.

This relationship between members selected on the Members Tab and generations added to the cross-tab on the Cross-Tab Tab is important to understand. Pay close attention to your database, the members you select, and the generations that are added to the cross-tab. Without careful consideration, you may have inaccurate results in your report.

Below the Report Fields list is the Database Fields list. This section of the list box allows you to select entire dimensions to place in the cross-tab. Like the generation list items, though, only members you actually selected on the Members Tab will appear for each dimension. Unlike the generation list items, members from different generations within the same dimension appear together in the same band of the cross-tab.

Reporting on OLAP data

205

For more information on selecting dimensional data for crosstabs, search for Cross-Tab Options and the tutorial Dimensional Cross-Tabs in Seagate Crystal Reports online Help.

If you scroll to the bottom of the list box, you will notice that the last item in the list box is DATA. This field represents actual numeric data in your database (rather than members of a dimension).

The largest feature of the Cross-Tab Tab is the cross-tab layout section that fills the upper left corner of the tab. Use this section of the tab to design the actual layout of your report.

A cross-tab report consists of three features: rows, columns, and summary data. The rows and columns indicate how you are examining and comparing the summary data. Summary data is evaluated based on the comparisons between rows and columns. The cross-tab report you create in this tutorial will examine Profit data from the Measures dimension over a period of time represented by the members of the Year dimension.

" Scroll to the bottom of the list box on the Cross-Tab Tab, and select the DATA field. In any cross-tab report you create with OLAP data, the cross-tab must summarize actual numeric values, not OLAP database members. These values can come directly from the DATA field of the OLAP database or can be generated by a formula or summary field.

# Drag the DATA field to the Summarized Field list box in the cross-tab layout section. Basic.DATA appears in the

Summarized Field list box.

$ Scroll back up in the list box, and select Basic.Year, Gen 2 from the list. Drag this generation field to the Columns list box of the cross-tab layout section.

% Select Basic.Year, Gen 1 from the list box, and drag it to the Columns list box.

A message box appears, indicating that you have not selected members from the Year dimension in the correct order.

When you add members to a cross-tab, you will naturally want to group generations in the same order that they are organized in the original database. For example, quarters from the Year

206

Seagate Crystal Reports User’s Guide

Previewing the

report and smart aggregation

dimension should be grouped under the year. It would not make sense to group the year under individual quarters. The Cross-Tab Tab helps you organize generations correctly by making sure generation 2 data is grouped under generation 1 data, generation 3 data is grouped under generation 2 and generation 1 data, etc.

& Click Yes in the message box to have generations correctly organized in the cross-tab. If you click No, the program will not allow you to add Generation 1 data beneath Generation 2.

Remember, though, you did not actually select a generation 1 member of the Year dimension on the Members Tab. Since you asked for generation 1 to appear in the columns section of the cross-tab, the program will use smart aggregation to recognize the missing member and calculate an aggregate value.

' Drag the following generations from the list box to the Rows list box of the cross-tab layout section in order:

Basic.Measures, Gen 2

Basic.Measures, Gen 3

Basic.Measures, Gen 4

This cross-tab will not display generation 1 of the Measures dimension.

NOTE: The Cross-Tab Tab also provides the Add Row, Add Column, and Set Summarized Field buttons to move fields to the Rows, Columns, and Summarized Field list boxes of the cross-tab

layout section. Use these buttons or the drag and drop technique, whichever is more convenient for you.

Click Preview Report on the Create Report Expert. The Expert disappears, and, after a few seconds, the program generates and displays your cross-tab data.

NOTE: You may need to adjust the size of report fields so that member names are displayed correctly. To resize a field, simply select the field and drag the handle at the right side until the field is displayed correctly.

The first thing to notice in the cross-tab is that generations within the same dimension appear in separate bands of the

Reporting on OLAP data

207

cross-tab. For instance, generation 2 members of the Year dimension appear together in a band of columns, while generation 1 of the Year dimension appears in a separate band above generation 2. Now you can clearly see why the program forces you to place generations in the cross-tab layout in a certain order.

Notice also that the program added a Year band and a Total column at the right hand side of the report for generation 1 of the Year dimension. When you see a column or row that is labeled Total, the program is calculating the aggregate values. If aggregate values are not labeled Total, the values are coming directly from the Essbase database. Since you did not select any generation 1 members for this dimension, these values do not come from the original Essbase database. Instead, this Year Total column contains the aggregates calculated by Seagate Crystal Reports. These aggregates were calculated simply by adding together the values for the generation 2 members that did come from the Essbase database.

To better understand smart aggregation and cross-tab aggregation, you will change the OLAP properties selected for the Year dimension.

NOTE: To avoid accidentally losing your work, you may want to save the report as it currently stands before continuing with the tutorial.

Select one of the members from the Year dimension in the cross-tab report. You can select any one of the quarters or select Year itself.

Choose the CHANGE OLAP MEMBERS command from the Edit menu. The OLAP Members dialog box appears.

!Currently, Year (children ONLY) appears in the Current Members list box. Select this item, and click Properties. The Member Properties dialog box appears.

"Change the properties for the Year member to This member and children, and click OK. Year (and children) now appears in the Current Members list box.

#Click OK in the OLAP Members dialog box. Seagate Crystal Reports regenerates your cross-tab.

208

Seagate Crystal Reports User’s Guide

Formatting the report

Although the values in the last column of the report did not actually change, they are now being obtained directly from the Essbase database instead of being calculated by Seagate Crystal Reports. Notice that the Total label is now missing. As described before, if an aggregate value is calculated by Seagate Crystal Reports, the Total label will appear for the respective row or column. If no Total label appears, the values are being obtained directly from the Essbase database.

Although the change you just made had no effect on the actual data in your report, understanding the difference is important in situations where not all members from the child generation are present. For instance, if you had only selected the Qtr1 and Qtr2 members of generation 2 of the Year dimension, the results for the Year would appear different based on smart aggregation. If you select the Year member as well, the Year total would come directly from the Essbase database and would represent the entire year. However, if you did not select the Year member, Seagate Crystal Reports would use smart aggregation to obtain a total from available data, Qtr1 and Qtr2 values, in this case. Thus, the Year column would actually only represent the first two quarters of the year.

$Select one of the data values that appears in the cross-tab. For example, select the value that appears at the intersection of the COGS member and the Qtr1 member. Notice that the value is selected and a gray box appears behind every other data value except the aggregate values for Year, Margin, Total Expenses, and Profit. This means that the formatting changes you are about to make will affect all of the selected data values in the cross-tab.

% Click the CURRENCY button on the format bar.

A currency sign is added next to each selected value in the cross-tab.

&Add a currency sign to the values that appear in the remaining rows and columns of the cross-tab. You may need to make several selections before all values are formatted correctly.

NOTE: You can use the Shift key to select several fields at the same time.

Reporting on OLAP data

209

Highlighting bands

Pivoting the cross-tab

Breaking the

report over groups

'Select the entire cross-tab report by clicking in the upper left hand corner of the cross-tab object, outside of any data fields or members. A selection rectangle appears around the entire cross-tab object.

! Choose the FORMAT CROSS-TAB command from the Format menu. The Cross-Tab dialog box appears. This dialog box is similar to the Cross-Tab Tab in the Create Report Expert.

! You will highlight certain rows and columns in the cross-tab report according to the generation within each dimension using the Cross-Tab dialog box. Select Basic.Year, Gen 1 in the Columns list box.

! In the Background Color drop-down box, select Silver.

!!Now select Basic.Measures, Gen 2 from the Rows list box and select Silver as its background color.

!" Click OK in the Cross-Tab dialog box. The program highlights the Year band in the cross-tab columns and the Profit band in the cross-tab rows along with their respective aggregate values. This simple band highlighting capability allows you to easily format cross-tab reports to clarify data.

After examining the cross-tab data produced in your report, you may decide that you need to make some changes.

!# Right-click in the upper left corner of the cross-tab and select the PIVOT CROSS-TAB command from the shortcut menu that appears.

The report has been completely pivoted on its axis.

!$ Click the Design Tab again. Notice that the cross-tab is a single object that appears in the Report Header section of the report. In addition, you may have recognized that this crosstab only represents two dimensions in the Sample Basic database.

The following steps demonstrate how to add a third dimension to your report, group the report based on this third dimension, and split the cross-tab into multiple cross-tabs based on the grouping.

210

Seagate Crystal Reports User’s Guide

Although it is possible to add a third dimension directly into the cross-tab object, adding the dimension as a group on the primary body of the report can often have better results, depending on the data you are presenting.

!% Choose the REPORT EXPERT command from the Report menu. A message box appears stating that the actions you are about to take can not be undone using the UNDO command on the Edit menu. Click Yes in response to the message box, and the Create Report Expert appears again.

!& Click the Members Tab to display available and selected database members.

!' Click the node next to the Scenario dimension in the Database Fields list box to view the children of Scenario.

" Select the Actual member, and click Add, then select the Budget member, and click Add. These two members are now available to your report, but you will not add them to the actual cross-tab.

" Click the Group Tab. You will create groups in the report based on the Actual and Budget members.

"In the Report Fields list box, scroll down and select the Scenario dimension. This is the dimension containing the Actual and Budget members that we want to group on.

"! Click Add, and Basic.Scenario appears in the Sort Fields list box. The report will now contain groups for each of the selected members of this dimension.

""Click Preview Report to generate the new groups in your report.

Notice that three separate cross-tabs now appear in the report.

"# Click the Design Tab to view the report in Design mode. Two new report sections now appear in your report, a Group Header and a Group Footer. In addition, a second cross-tab object now appears in the Group Header section.

When the program grouped the report based on the selected members of the Scenario dimension, it also copied the crosstab object to the Group Header section, resulting in a separate cross-tab for each group. Since the first grouping that appears

Reporting on OLAP data

211

when you preview the report is for the Actual member, the cross-tab, likewise, contains Actual data. The second cross-tab for the second group, on the other hand, contains Budget data.

Seagate Crystal Reports also left the original cross-tab object in the Report Header section. This cross-tab represents summary information based on data from all groups. It acts as a type of grand total cross-tab. This way, your reports can display crosstab information specific to each group, along with a final summary cross-tab.

Since the groups you created here are for Actual vs. Budget data, a summary cross-tab does not make sense. You will remove the cross-tab that appears at the top of the report.

"$ From the Design Tab, select the cross-tab object that appears in the Report Header section by clicking in the upper left hand corner, above the rows and to the left of the columns, and press Delete.

NOTE: You may want to resize the Report Header section to make it smaller now that it does not contain a Cross-Tab object. To do this, simply drag the boundary at the bottom of the section upward until the section is an appropriate size.

"% Click the Preview Tab to see the results of the changes you made. Two cross-tabs now appear in your report, one for the Actual group containing Actual related data, and one for the Budget group containing Budget related data.

"& Choose the SECTION command from the Format menu, and the Section Expert appears.

"' Select the Group Footer #1: Basic.Scenario in the Sections list box, and toggle the New Page After check box on.

# Click OK when finished. The report is now split among two pages, one for each group and, therefore, one for each crosstab. You can finish the report by adding a title, date, and any other formatting appropriate to the data.

As you can see, designing cross-tab reports is exceptionally easy. OLAP data, by its inherent design, naturally fits the cross-tab concept. After designing a few reports using your own Essbase data, you will quickly master this powerful report design.

212

Seagate Crystal Reports User’s Guide

9

Multiple Section Reports

What you will find in this chapter...

Using multiple sections in reports, Page 214

HANDS-ON (Multiple Section Reports), Page 215

Multiple Section Reports

213

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]