More Information.................................................................................................................337Appendix A
2010-11-1610
Introduction to SAP Crystal Reports for Enterprise
Introduction to SAP Crystal Reports for Enterprise
1.1 About Crystal Reports
Crystal Reports is designed to work with your database to help you analyze and interpret important
information. Crystal Reports makes it easy to create simple reports, and, it also has the comprehensive
tools you need to produce complex or specialized reports.
Create any report you can imagine
Crystal Reports is designed to produce the report you want from virtually any data source. Formulas,
cross-tabs, subreports, and conditional formatting help make sense of data and uncover important
relationships that might otherwise be hidden. Geographic maps and graphs communicate information
visually when words and numbers are simply not enough.
Extend reporting to the Web
The flexibility of Crystal Reports doesn't end with creating reports — your reports can be published in
a variety of formats including Microsoft Word and Excel, E-mail, and even over the Web. Advanced
Web reporting lets other members of your workgroup view and update shared reports inside their web
browser.
Incorporate reports into applications
Application and web developers can save time and meet their users needs by integrating the report
processing power of Crystal Reports into their database applications. Support for most popular
development languages makes it easy to add reporting to any application.
Whether it's the web master in IT, the promotion manager in marketing, the database administrator in
finance or the CEO, Crystal Reports is a powerful tool designed to help everyone analyze and interpret
the information that's important to them.
1.2 About the online help
The online help includes procedures for typical reporting tasks such as placing objects, formatting
reports, and sorting records. It also contains information on more specific areas of interest such as
2010-11-1611
Introduction to SAP Crystal Reports for Enterprise
advanced formula creation and accessing different types of data. Use the online help as a reference
for your basic reporting needs as well as an introduction to new concepts in report creation.
1.3 Understanding examples in the documentation
The Crystal Reports documentation describes how to connect to a variety of data sources and how to
add information to the report designer from those data sources. It also provides example code for the
functions. Although the terminology may refer to databases and fields, the instructions also apply to
data sources such as universes and queries that contain result objects.
For the sake of simplicity, sample folder and object names are used in the instructions and in the function
code examples. The following code sample shows how the folder and object names may be used:
Average ({orders.ORDER AMOUNT}, {customer.CUSTOMER ID})
Many examples use objects from a Customer folder and numeric values from an Internet Sales folder.
There may be other objects in the documentation, but the following table shows the most commonly
used objects.
Customer
These objects will usually be displayed as follows:
•Customer
•Internet Sales Quantity
•Country
Data typeObject
stringCustomer
stringCity
stringState-Province
stringCountry
numericInternet Sales Amount
numericInternet Order Quantity
2010-11-1612
Introduction to Reporting
Introduction to Reporting
This section shows you the basics of creating a report in SAP Crystal Reports for Enterprise. First you
will learn about the report design environment, and then about how to select result folders, place
elements on a report, and how to sort, group, and total your report data.
2.1 About the report design environment
This section introduces you to some of the important areas of Crystal Reports that you will use most
when creating reports.
2.1.1 Report design canvas
The report design canvas is the area where you design the structure of your report. You can place
various elements on the canvas including data objects, charts, and text elements.
Two views are available for laying out the information and previewing it. One view shows the structure
only ("Structure" mode) and the other view is a page that includes data ("Page" mode).
2.1.1.1 Structure mode
"Structure" mode is where you do most of the initial work when creating a report. It is where you do the
initial formatting and place objects in the sections where you want them to appear.
"Structure" mode provides an efficient environment for designing a report because you work with data
representations, not with data itself. When an object is placed on the report, the program identifies the
object but does not retrieve the data. The object is represented by a frame.You can add and delete
objects and other elements, move them around, set up complex formulas, and more, without using the
computer or network resources needed to gather the data.
The report created in "Structure" mode contains only the structure and instructions for creating the final
report. To see how the report looks as a report with data, view it in "Page" mode.
2010-11-1613
Introduction to Reporting
2.1.1.1.1 Structure mode areas
When you create a new report, Crystal Reports automatically creates five essential report areas in
"Structure" mode:
•"Report Header"
This area is generally used for the report title and other information you want to appear at the
beginning of the report. It can also be used for charts and cross-tabs that include data for the entire
report.
•"Page Header"
This area is generally used for information that you want to appear at the top of each page, such as
chapter names, the name of the document, and other similar information. This area can also be
used to display object titles above the objects on a report.
•"Body"
This area is used for the body of the report, and is printed once per record. The bulk of the report
data generally appears in this section.
•"Report Footer"
This area is used for information you want to appear only once at the end of the report (such as
grand totals) and for charts and cross-tabs that include data for the entire report.
•"Page Footer"
This area usually contains the page number and any other information you want to appear on the
bottom of each page.
If a group is added to the report, the program creates two additional areas:
•"Group Header"
This area typically holds the group name object, and can be used to display charts or cross-tabs
that include data specific to the group. It is printed once at the beginning of a group.
•"Group Footer"
This area generally holds the summary value, if any, and can be used to display charts or cross-tabs.
It is printed once at the end of a group.
When a group is added, the "Group Header" area appears directly above the "Body" area and the
"Group Footer" area appears directly below the "Body" area.
If you set up additional groups, the program creates new group areas between the "Body" area and the
existing "Group Header" and "Group Footer" areas.
2010-11-1614
Introduction to Reporting
2.1.1.2 Page mode
"Page" mode shows the report structure and its data. In this mode you can see how your report will
look when it is printed or published.
"Page" mode allows you to edit the formatting of your report using the actual data. You can see the
direct results of your changes on the report, allowing you to fine-tune the formatting until the report
looks exactly as you want it to.
2.1.2 Side panels
Use the side panels to add connections, manage objects, insert folders, and so on.
The side panel area is located to the left of the report canvas. You can navigate between the side panels
by clicking the vertical row of icons on the side panel sidebar.
2.1.2.1 Data Explorer
Use the "Data Explorer" side panel to insert, modify, or delete objects in your report. When you
create a new report or open an existing report, the "Data Explorer" side panel opens adjacent to the
report canvas. Objects that you add in the Query Panel are stored in the "Data Explorer" where they
can be added to the report.
The "Data Explorer" side panel is separated into five areas. Expand the area by clicking the area name.
Result Objects
This area shows the universe elements that have been selected for use in the report. Drag elements
to the report canvas to add them to the report.
Click Edit Query to add a new universe element to the report.
Formulas
This area shows the formulas that have been created for the report. Drag formulas to the report canvas
to add them to the report. Right-click the side panel, and then click New Formula to add a new formula.
2010-11-1615
Introduction to Reporting
Parameters
This area shows the parameters that have been created for the report. Right-click the side panel and
click New to add a new parameter or a new cascading parameter group.
Running Totals
This area shows the running totals that have been created for the report. Right-click the side panel and
click New Running Total to add a new running total.
Predefined Objects
This area shows the predefined objects you can add to your report. Drag objects to the report canvas
to add them to the report.
2.1.2.2 Outline
The "Outline" panel shows the content of the report in a tree view. The root node is the report
itself, while the first-level nodes represent the sections of the report. Within each section, the report's
objects and elements are listed.
You can modify report objects and elements by right-clicking them in the "Outline" panel and clicking
Format <Object>. The Format dialog box shows the actions you can take on the object.
2.1.2.3 Group Tree
The "Group Tree" panel shows a tree view of groups and subgroups in the report. Any item you
select in the "Group Tree" is selected on the report canvas.
2.1.2.4 Search
2010-11-1616
Introduction to Reporting
Use the "Search" side panel to search the report for any specific value. Type a word or phrase
into the text box and press Enter. The search results appear in the side panel.
2.1.3 Format dialog box
The "Format" dialog box displays the formatting options for the selected element. The "Format" dialog
box appears when you right-click an element and click "Format"<Object>.
Use the "Format" dialog box to make formatting changes to the different areas of your report. For
example, when you right-click the "Report Header" section on the report canvas and click
"Format"<Section>, the "Format" dialog box displays the changes you can apply to that section.
2.1.4 Show Problems
The "Problems" panel displays a list of errors found in your report. It includes a description, the context,
and the category of the error.
When you click the Show Problemsicon at the bottom of the report canvas, the "Problems" panel
appears.
2.1.5 Keyboard shortcuts
You can navigate the report structure using the keyboard instead of the mouse.
2.1.5.1 Structure, page, and side panel access
Side Panels
The following shortcut keys allow access to the side panels:
•Data Explorer: CTRL + 1.
•Outline: CTRL + 2.
•Group Tree: CTRL + 3.
2010-11-1617
Introduction to Reporting
•Search Panel: CTRL + 6.
Report Modes
The following shortcut keys allow access to the Structure and Page modes:
•Structure mode: CTRL + ALT + L.
•Page mode: CTRL + ALT + P.
2.1.5.2 Navigating the report canvas
Use the following options to navigate the main window.
•Press F6 to move the keyboard focus around to the main areas of the screen.
•Press Shift + F6 to cycle back in the reverse direction.
•Pressing F6 and Shift + F6 jumps between blocks: Side Panel, Report Editor Area, Tab Toolbar,
and Top Left Toolbar.
Top Left Toolbar
•Access the Top Left Toolbar by cycling through F6.
•To access the second row of buttons, use Tab.
•To switch between buttons, use the arrow keys.
•To select buttons, use Space.
Tab Toolbar
•Access the Tab Toolbar by cycling through F6. The initial focus is set on selected tab.
•To switch between tabs use the right and left arrow keys.
•To go to the buttons, use Tab.
•To switch between buttons use the right and left arrow keys.
•To select buttons, use Space.
Editing Keys
•To close a current document: CTRL + W.
•Copy: CTRL + C.
•Paste: CTRL + V.
•Cut: CTRL + X.
2010-11-1618
Introduction to Reporting
2.1.5.3 Navigating objects
Common navigation
Use the following keys to navigate objects:
•To move forward and back: Alt + Left and Alt + Right.
•To go to the Previous and Next page: Page Up and Page Down.
•To go to the First and Last page: Home and End.
•To go to Page selection box: CTRL + Shift + N.
•To refresh report: F5.
Activating hyperlinks in report content
With the report canvas focused, select a report element with a hyperlink so that the element is the
primary selection and press the Space bar.
Copying and Pasting elements
Items can be copied and pasted onto the canvas using the keyboard.
Copy a result object from the "Data Explorer" using Ctrl + C and set the keyboard focus back to the
report canvas using F6. Select a section or a result object on the report where you want to paste the
object. Once selected, paste the object by using Ctrl + V and using Enter.
2.1.5.3.1 To insert an element using keyboard commands
1.
Press Tab to move the focus to the "Insert" tab.
2.
Use the arrows to navigate to the required element.
3.
Press Ctrl + C to copy the element.
4.
Press Tab to return to the "Structure" mode.
Use the arrows to move to the section where you want to place the element.
5.
Press Ctrl + V to paste the element.
2.1.5.3.2 To insert an object from a list
1.
Press Tab to move the focus to the "Insert" tab.
2.
Use the arrows to navigate to an object list.
3.
Press Space to activate the drop list.
4.
Use Tab to navigate between controls.
5.
Press Enter to select the controls and buttons.
2010-11-1619
Introduction to Reporting
2.1.5.4 Navigating charts
You can use keyboard shortcuts to modify a chart:
•To select elements within a chart, use Alt + Down.
•To select other regions within the chart, use the arrow keys.
•To modify chart data, activate the context menu and choose "Edit Chart Data". Press the arrow keys
to select the drop zones. You may have to press Down, Up, Right, or Left to move to all the drop
zones. Once a drop zone is selected, press Alt + Down to select an element within the drop zone.
Note:
Though it is not currently possible to access the check boxes in the data mode page using only the
keyboard, there is an equivalent function inside the Format chart dialog box.
•Press Tab to move the focus to the data mode overlay.
•To switch back to the "Show" chart mode, with a chart element selected, activate the context menu
and select Show Chart.
2.1.5.5 Navigating the Groups and Sorts dialog box
The "Groups and Sorts" dialog box can be activated from the "Data" toolbar or directly from the context
menus of various elements on the report canvas such as group areas, sections, result objects, total
elements within groups, etc.
In the "Groups and Sorts" dialog box, use the standard keys (Tab, Enter, Space, Alt + Down, and the
arrow keys) to navigate through the dialog box.
To select a group or sort, press Space when the group or sort area is focused.
2.1.5.6 Navigating miscellaneous objects
Combo drop list
When a combo drop list is selected anywhere in Crystal Reports, use Alt + Down to cause the list to
drop.
Using Esc will cancel the dropdown or using Enter will select the current drop list selection and close
the drop list.
2010-11-1620
Introduction to Reporting
2.1.5.7 Navigating statement editors
The following options allow you to edit statement editors, interactive filters, and conditional formatting:
•To select the previous or next statement in a group, use the Up and Down arrow keys.
•To cycle through all keyboard-navigable parts in the editor, use Tab and Shift + Tab.
•To apply the relevant delete action for the selected part, use Delete.
•To go into edit mode for the selected part, use F2.
•To toggle a join part between "OR" and "AND" operators, use F2.
•To cancel an option in the editor dialog box, use Esc.
•To activate an option in the editor dialog box, use Enter.
2.2 Logging on to SAP BusinessObjects Enterprise
Before you can create a report with SAP Crystal Reports for Enterprise, you must be connected to an
SAP BusinessObjects Enterprise server.
Check with your system administrator for the proper server name to use for the connection.
2.2.1 To log on to SAP BusinessObjects Enterprise for the first time
Get the correct Web Services server name from your SAP BusinessObjects Enterprise administrator.
If you have not connected to SAP BusinessObjects Enterprise before, you will need to add the server
connection before you can log on.
1.
Click File > Log on to SAP BusinessObjects Enterprise.
The "Log on to SAP BusinessObjects Enterprise" dialog box appears.
2.
Type your User Name and Password.
3.
Click Options.
4.
Click Specify new server below and save.
5.
In Connection Name, type a descriptive name for the connection.
For example, type “Test server” or “Human Resources server”.
6.
Select the correct Authentication Type.
2010-11-1621
Introduction to Reporting
Note:
Your system administrator can tell you which authentication type to use.
7.
Type the server name.
Note:
You do not need to type the complete URL here, only the server name. If you need to change the
web port number or server context information, click Advanced to display the "Advanced Server
Settings" dialog box. Ask your system administrator for the values to use for the web port number
or server context information.
8.
Click OK.
You are now logged on to the SAP BusinessObjects Enterprise server. You can create new reports or
edit existing ones.
Note:
If you cannot connect to the SAP BuisnessObjects Enterprise server, refer to your Web Services
administrator to ensure the connection to the Web Services server is configured properly.
2.2.2 To log on to SAP BusinessObjects Enterprise
Follow these steps if you have already set up server connections to SAP BusinessObjects Enterprise.
1.
Click File > Log on to SAP BusinessObjects Enterprise.
The "Log on to SAP BusinessObjects Enterprise" dialog box appears.
2.
From the "Server Connections" list, click the server name for the server that you want to connect
to.
3.
Type in your User Name and Password and then click OK.
You are now logged on to the SAP BusinessObjects Enterprise server. You can create new reports or
edit existing ones.
Note:
If you cannot connect to the SAP BuisnessObjects Enterprise server, refer to your Web Services
administrator to ensure the connection to the Web Services server is configured properly.
2.3 Creating a new report
This section provides you with information on the report creation process, including the following options:
•logging on to SAP BusinessObjects Enterprise
•selecting the data source
•adding elements
2010-11-1622
Introduction to Reporting
•formatting data
•selecting records
•grouping, sorting, and totaling data
2.3.1 To create a new report
If the Start Page is not already visible, click Help > Show Start Page.
The following section describes how to create a new report. You can insert text elements or predefined
objects on a blank report, or you can connect to a data source and select result objects to display data
on your report.
1.
Click File > New Report.
•If you are not already logged on to SAP BusinessObjects Enterprise, you will be prompted to do
so.
•If you are logged on to SAP BusinessObjects Enterprise, the "New Data Source Connection"
dialog box appears.
Note:
It is not necessary to log on to SAP BusinessObjects Enterprise or connect to a data source to create
a blank report.
2.
Close the "New Data Source Connection" dialog box.
You have created a new report.
Related Topics
• Logging on to SAP BusinessObjects Enterprise
• Selecting a data source
• Selecting folders and result objects
• Placing data on the report
2.3.2 Selecting a data source
Crystal Reports supports connecting to the following data sources:
•Universe
•SAP BEx Query
•Analysis view
2010-11-1623
Introduction to Reporting
Note:
Before you can connect to a data source you must first be connected to an SAP BusinessObjects
Enterprise server.
Related Topics
• Logging on to SAP BusinessObjects Enterprise
2.3.2.1 To select a data source
Connect to an SAP BusinessObjects Enterprise server.
1.
You can select a data source when creating a new report, or add a data source later.
•To add a data source to a new report, click Blank Report.
•To add a data source to an existing report, click Data > Choose Data Source.
The "New Data Source Connection" dialog box appears.
2.
Select a data source type and click Next.
The following are valid data source types:
•Universe
•SAP BEx Query
•Analysis View
3.
If you are not already logged on, log on to your SAP BusinessObjects Enterprise server and click
Next.
Note:
If you are already logged on, the login screen is not displayed.
4.
Select the data source that you want to connect to, and then click Next.
The "Edit Query" panel appears. You can now select elements to include in your query.
Note:
If you connect to an Analysis View, the query panel will not appear because Analysis Views contain
pre-designed queries. The report canvas will appear.
2.3.3 Selecting folders and result objects
After selecting a data source, you can select one or more folders or result objects within the folders to
include in your report.
2010-11-1624
Introduction to Reporting
2.3.3.1 To select folders and result objects
1.
You can select folders when creating a new connection to a data source, or when a connection is
already set up.
•When creating a new connection in a blank report, select the data source in the "New Data Source
Connection" dialog box and click Next.
•If a connection is already set up, click Edit Query in the "Result Objects" area of the "Data
Explorer" side panel.
The "Query Panel" dialog box appears.
2.
Select a folder or an object from the "Universe" pane and double-click it or drag it to the "Result
Objects for Query #1" pane.
3.
Repeat the previous step for each object that you want to include in the query.
Note:
It is recommended to avoid including both a hierarchy object and associated level objects in the
same report. A hierarchy object contains all the hierarchy nodes in a hierarchy form, whereas a level
object contains only the hierarchy nodes that match the level index in a flattened form. If both kinds
of objects are included in a report, the hierarchical data and flattened data will both be included in
the query.
4.
Click OK.
The folders and objects appear in the "Result Objects" area of the "Data Explorer" side panel.
Related Topics
• Quick reference to objects
2.3.4 Placing data on the report
Placing data on a report is a very important task. To produce reports that are clear and effective, you
need to know what type of data to place on the report and where on the report to place it.
Note:
A report (.rpt) file might contain sensitive business data. You are advised to protect access to the file
by using one of these methods:
•Manage the file with SAP BusinessObjects Enterprise server.
•Apply file security.
•Apply operating system-level encryption.
2010-11-1625
Introduction to Reporting
2.3.4.1 Result objects
Result objects are objects that display data from the data source. Much of the data displayed on a report
is from result objects. Normally, result objects will be placed in the "Body" area, but under certain
circumstances, they will be placed in other sections of the report.
Note:
If you are using a relational universe, OLAP universe, or SAP BEx query, delegated measures may be
available. If you place a delegated measure in the "Body" area, it will appear as a result object. However,
if you place a delegated measure in the "Report Header", "Report Footer", "Group Header", "Group
Footer", a Cross-tab, or a chart, it will be displayed as a total.
2.3.4.1.1 To insert result objects
1.
In the "Result Objects" area of the "Data Explorer" side panel, click the folders to expand the objects.
2.
Drag objects to the desired location on the report canvas.
Note:
You can also insert an object by right-clicking the object in the "Data Explorer" and clicking Insert.
2.3.4.2 Formulas
To display data that is a calculated value, you need to create a formula and place that formula on the
report. For example, if the data source stores only the order dates and ship dates for orders, but you
need to display the number of days it takes to ship the order, you must create a formula that will calculate
the number of days between ordering and shipping.
Related Topics
• Formulas
2.3.4.3 Parameters
Parameters allow you to filter report data for specific users. For example, in a report used by salespeople,
you might create a parameter that prompts the user to choose a region. When the user chooses a
region, the report returns the results for the specific region instead of returning the results for all regions.
2010-11-1626
Introduction to Reporting
Related Topics
• Parameters and Prompts
2.3.4.4 Running total elements
To display a total that evaluates each record and provides a running sum of all the values in an object
(or all the values in a certain set of values), a running total element needs to be created and placed in
the report. If the first three values in an object were 2, 4, and 6, a running total would print 2, and then
6 (the sum of 2 + 4), and then 12 (the sum of 2 + 4 + 6).
Related Topics
• Running Totals
2.3.4.5 Predefined objects
Predefined objects include "Page Number", "Record Number", "Group Number", "Print Date", and "Total
Page Count" objects. Use the commands in the "Predefined Objects" area of the "Data Explorer" side
panel to add predefined objects to your report.
2.3.4.5.1 To insert a predefined object
1.
In the "Data Explorer" side panel, expand Predefined Objects.
2.
Drag a predefined object to the desired location on the report canvas.
Each predefined object is inserted into the report as an element. An element frame appears. You can
now move it on the report.
Tip:
You can also right-click a predefined object, and then click Insert.
2.3.4.6 Text elements
Text elements are mostly used to hold text, but they can also hold result objects to create custom form
letters and more. You can use text elements to combine result objects, insert titles, label totals, and
other data on your report.
2010-11-1627
Introduction to Reporting
2.3.4.6.1 To insert a text element
1.
Click Insert > Text, and then click on the report canvas to place the text box.
An empty text box appears.
2.
Type your text into the text box.
A text element is added to the report.
Tip:
Click once on the border of the text element to select it for resizing and moving.
2.3.4.6.2 To insert a result object in a text element
1.
Insert a text element into the report.
2.
Type the text that you want to appear before the first result object, if any.
3.
In the "Data Explorer" side panel, click the result object you want to insert, and drag it towards the
text element.
As you move the cursor over the text element, you will see a movable insertion point.
4.
Drag the object so the insertion point is where you want the result object to appear, and place the
object.
Tip:
The result object can also be moved by selecting and moving it in the text element.
2.3.4.7 Picture elements
When designing reports, there will be times when you want to include a picture. For example, you may
want to insert a company logo in the "Report Header".
2.3.4.7.1 To insert a picture
1.
Click Insert > Picture.
The "Open" dialog box appears.
2.
Select the desired picture file from the file list and click Open.
An element frame appears with the picture inside, ready to be positioned.
3.
Position the picture element where you want it to appear on the report and click to place it.
2010-11-1628
Introduction to Reporting
2.3.4.8 Hyperlink elements
You can add a hyperlink to any report element on the report canvas.
The hyperlink is saved with your report and is available to other users as a way of viewing additional
information.
Note:
Crystal Reports also lets you create hyperlinks with Relative URLs, so your web reports retain
independence from their location on any particular server.
2.3.4.8.1 To create a hyperlink element
1.
Right-click the report element on the report canvas, and click Format <Element>.
The Format dialog box opens.
2.
Click the Advanced option.
Note:
Not all hyperlink types are available at all times. The element you select and its location on the report
determine which types are available.
3.
From the "Type" list, select one of the following:
DescriptionOption
No Hyperlink
This is the default option. There is no hyperlink associated with the selected
report element.
A Website on the Internet
An E-mail Address
Select this option if you want your report element to be linked to a static
web address.
Select this option if you want to create a "mailto" address from the object
you selected. Use the Conditional Formula button to create an address
based on a object value.
A File
Select this option if you want to create a hyperlink to a file on a specific
computer or networked computer.
Another Report Element
Select this option if you want to create a hyperlink to another element on
the report.
A text box will appear below the "Type" menu.
4.
Enter the website address, email address, or the file name of the hyperlink, depending on the type
you selected.
5.
Close the "Format" dialog box.
A hyperlink is inserted on the report.
2010-11-1629
Introduction to Reporting
2.3.4.9 Alerts
Alerts are custom messages created in Crystal Reports that appear when certain conditions are met
by the data in a report. Alerts indicate action to be taken by the user, or information about report data.
Alerts are created from formulas that evaluate conditions that you specify. If the condition is true, the
alert is run and its message is displayed. Messages can be text strings or formulas that combine text
and report objects. Once an alert is run, it's not evaluated again until you refresh your report's data.
Because alerts are specific to each report, you decide when to use them and when not to. They can
be useful to point out important information such as sales that are above or below a limit. The message
is created by you, so it can be specific to your data.
2.3.4.9.1 To add a new alert
1.
On the standard toolbar, click Data > Alerts.
The "Alerts" dialog box opens.
2.
Click New.
3.
Enter a name for your alert in the "Name" text box.
4.
Click the Condition Formula icon next to "Condition".
The "Formula Workshop" appears.
5.
Enter your alert condition formula.
If an alert formula is based on a total element, any recurring elements used must be constant over
the total element. For example, if you are grouping on Country and Region, you might create the
following alert:
Sum ({Customer.Last Year's Sales}, {Customer.Region}) > 10000
In this case, your formula can refer to either Country or Region, but not City or Customer Name
since these are not constant.
Note:
Alert formulas can be based on recurring records or on total elements, but cannot be based on
print-time elements, such as running totals or print time formulas. Alert formulas cannot have shared
variables.
6.
Click Save and Close to exit the "Formula Workshop".
7.
You can add a message to appear with your alert.
There are two options for adding an alert message.
•If you want the same message to appear every time your alert is run, type the message in the
"Message" box.
•If you want the message to appear customized with data elements, create a message formula.
a.
2010-11-1630
Introduction to Reporting
b.
c.
Note:
The result of an alert message formula must be a string.
The DefaultAtribute function can be used to refer to a message added in the "Message"
box. For example, if the message in your message box is "is a star performer", your alert message
formula might be:
({Customer.Country}) + DefaultAttribute
Click the Conditional Formula icon next to "Message".
The "Formula Workshop" appears.
Enter your alert message formula.
For example, if you want to see the message "<Country> is a star performer" (where
<Country> is the name of a specific country), you might create the following formula:
({Customer.Country}) + "is a star performer".
Click Save and Close to exit the "Formula Workshop".
This formula relies on the text you type in the "Message" box; that text becomes the default
attribute.
8.
Click OK.
A new alert is added to the report.
2.3.5 Formatting data
At this point in creating a report, you may want to do some basic formatting. Perhaps you would like to
change the font size and style of a text element used as a title. Or, if you have a number element, such
as a sales figure, you might want to place a dollar sign before the number or change the number of
decimal places displayed.
2.3.5.1 To format elements using the Format dialog box
The Format dialog box shows the options for editing report elements. You will use the Format dialog
box to make detailed formatting changes to almost all the elements in your report.
Tip:
You can also format elements through the "Format" tab in the tab bar, or by clicking Format on the
standard toolbar.
2010-11-1631
Introduction to Reporting
1.
Right-click the element you want to reformat, and click Format <Element>.
The Format dialog box appears.
2.
The Format dialog box displays a quick view of commonly used formatting options for the element.
Click Advanced to view more options.
3.
Click the options on the panel to view the different sections of the dialog box.
4.
Make the desired changes.
Related Topics
• Report layout and formatting
2.3.5.2 Inserting page headers and footers
You can use page headers and footers by placing the information in the "Page Header" or "Page Footer"
sections of the "Structure" mode.
•Information to appear only on the first page of the report goes in the "Report Header".
•Information to appear only on the last page of the report goes in the "Report Footer".
•Information to appear at the top of every page goes in the "Page Header".
•Information to appear at the bottom of every page goes in the "Page Footer".
Text, objects, or formulas can be used in these sections just as in the "Body" section.
2.3.6 Grouping, sorting, and totaling data
Once a basic report is created, you will want to organize the data by grouping related information,
sorting individual records, totaling, subtotaling, and grand totaling.
2.3.6.1 Grouping records
To organize the data, you may want to group related data together. For example, after grouping a
customer list by region, you might divide the list into regional groups. That way, a sales manager for
one region could quickly locate the appropriate region group and focus exclusively on the customers
within that region.
2010-11-1632
Introduction to Reporting
Related Topics
• Grouping data
2.3.6.2 Sorting records
Crystal Reports allows you to specify the order in which you want the records on your report displayed.
For example, after grouping by region, you might sort the records within each region in alphabetic order
by Customer Name. Many of your reports will use some type of sorting. Depending on the report, you
will sort the records in a list or sort in conjunction with grouping.
Note:
Crystal Reports will automatically sort the first column in a report alphabetically.
Related Topics
• Sorting records within groups
• Totaling grouped data
2.3.6.3 Totals, subtotals, and grand totals
Many reports use some sort of totaling. For example, in a North American sales report grouped by
state, you might want to calculate the total dollar amount sold in each state. You do this by creating a
subtotal on the sales object. Totals are also used at the group level, allowing you to calculate averages,
counts, and other group (aggregate) values. For example, in a sales report you may want to calculate
an average of sales per state (average total on the sales object) and calculate the number of products
sold in the state (distinct count of the product name object).
2.3.6.4 Using the isolate feature on grouped data
Crystal Reports allows you to isolate grouped or totaled information. While in the "Page" mode, right-click
on the group title or total element in the "Group Header" area that you want to isolate, and click IsolateInformation.
The report now shows only the group or total you isolated. To return to your main report, click the title
above the report canvas.
2010-11-1633
Introduction to Reporting
Tip:
You can also isolate information on the "Group Tree" side panel, right-click the desired group and click
Isolate Information.
Related Topics
• Sorting, Grouping, and Totaling
2.3.7 Adding a title page to the report
You can add a title page to a report by inserting "Report Title" from the "Predefined Objects" area of
the "Data Explorer" side panel.
In order to use this object, you must have a title entered in the Title text box for the report. You can add
a report title using the "Summary Info" dialog box.
2.3.7.1 To add a title page to the report
1.
Click File > Summary Info.
2.
In the "Summary Info" dialog box, enter a report title in the Title text box, if you have not done so
already.
3.
Close the "Summary Info" dialog box.
4.
In the "Predefined Objects" area of the "Data Explorer" side panel, drag the Report Title object to
the "Report Header" section of the report canvas.
5.
Click the "Report Title" element to select it.
6.
Format the font of the "Report Title" element from the "Format" tab.
7.
Set the "Report Title" values, such as font size, font type, and position.
8.
In the "Outline" side panel, right-click "Report Header" and click Format Report Header.
The Format dialog box shows the formatting options for the "Report Header" section.
9.
Select the Page Break After check box.
10.
Click Close.
The title appears on the first page and the report begins on the second page.
2010-11-1634
Introduction to Reporting
2.3.8 Adding comments to the report
There may be times when you want to include non-printing comments with a report (a personal note to
the report recipient, a note to explain more thoroughly the data on which the report is based, a report
title, a comment about some particular data on the report, and so on).
You can use the "Comments" text box in the "Summary Info" dialog box to add comments. The comments
do not print with the report; however, you can add comments to the report output if you want to.
2.3.8.1 To add comments to the report
1.
Click File > Summary Options.
2.
In the "Summary Info" dialog box, enter your comments in the "Comments" box.
Note:
The "Comments" box does not allow for paragraph breaks.
3.
Close the "Summary Info" dialog box.
Your comments are added to the report.
2.3.8.2 To add comments to the report output
1.
In the "Predefined Objects" area of the "Data Explorer" side panel, click "Report Comments" and
drag it onto the "Report Header" section of the report canvas.
2.
Right-click the "Report Comments" object on the report canvas and click Format object.
3.
In the Format dialog box, set the report comment values, such as font size, font type, and position.
4.
Close the Format dialog box.
The report comments now appear in the "Report Header" section of the report output.
2.3.9 Using the zoom feature
You can easily zoom in on a report. You can choose any magnification from 20% to 400%.
2010-11-1635
Introduction to Reporting
The zoom feature is located on the bottom right corner of the screen. Slide the bar to the left to zoom
out, and to the right to zoom in. You can also edit the zoom percentage manually by entering a
percentage into the text box. For example: 65%.
It is helpful to view reports at low magnifications in order to get an overall picture of the structure of your
report. Views at higher magnifications focus attention on the details of the report.
2010-11-1636
Report Design Concepts
Report Design Concepts
This section describes the basic concepts of report design and helps you decide what information you
want to include in your report.
3.1 Basic report design
The purpose of this section is to suggest a structured approach to preparing a Crystal Reports report.
This approach includes the following:
•Deciding on the content of the report.
•Developing a prototype on paper.
This section has been designed to provide a conceptual understanding of the reporting process.
3.2 Deciding on the content of the report
Before you do anything else, you should outline the information you want the report to provide. The
following sections provide a guide to making that outline.
Note:
A report (.rpt) file might contain sensitive business data. You are advised to protect access to the file
by using one of these methods:
•Manage the file with SAP BusinessObjects Enterprise server.
•Apply file security.
•Apply operating system-level encryption.
3.2.1 Stating the purpose
2010-11-1637
Report Design Concepts
What is the overall purpose of the report?
Reports are management tools. Their purpose is to help you quickly grasp the essential elements and
relationships found in raw data, to help you make effective decisions. For a report to be effective, it has
to present the correct data in a logical way. If it presents the wrong data, or if it presents the right data
in a haphazard manner, the report may slow the decision-making process or may even encourage
incorrect decisions.
A good starting place in the development of a report is to write out the purpose of the report in a sentence
or two. The purpose statement helps you focus on your primary needs, and it gives the report both a
starting point and a goal.
Here are some examples of purpose statements:
•The purpose of this report is to show monthly and year-to-date sales by sales representatives,
compare this year's numbers to last year's, and flag representatives whose sales figures do not
meet company standards.
•The purpose of this report is to show sales activity for each item in inventory, and to suggest reorder
quantities based on that activity.
•The purpose of this report is to calculate bowling averages and handicaps for each member of the
bowling league.
Defining the purpose of the report before you start is a critical step in the overall process.
Who is going to read the report?
A single report is often used by many individuals. A detailed, company-wide sales report, for example,
may be used by sales representatives, the regional sales manager, the national sales manager, and
the Chief Operating Officer (COO).
These individuals will be interested in different aspects of the report:
•A sales representative will use the report to evaluate individual sales performance and compare this
performance to that of other representatives in the region.
•The regional sales manager will use the report to evaluate regional representatives and compare
the region's performance to that of other regions.
•The national sales manager will use the report to evaluate the performance of regional managers
and compare overall sales to the current sales forecasts.
•The COO will use the report to evaluate the performance of the Vice-President of Marketing and
the sales department as a whole, and to project such things as manufacturing needs and warehouse
locations.
Since each user of the report has different interests, it is important to plan the report so it includes the
information each user is looking for.
3.2.2 Determining the structure of the report
2010-11-1638
Report Design Concepts
What is the report title going to be?
Write out a working title for the report. You may decide to change it later, but at least you will have a
title to use when creating the prototype report.
What identifying information is needed in the header and footer?
You may wish to include the print date, information on who prepared the report, a block of text to describe
the purpose of the report, the range of data covered, or something similar. If you are going to include
such information, write it down so you can use it in preparing your prototype.
The information can come from a variety of sources, depending on the kind of information you plan to
use.
•Information on who prepared the report might be drawn from individual result objects in the result
folder(s) used. If it is to be drawn from a result folder, what folder? Or, what combination of folders?
•A block of text can be created as a text element and placed anywhere on the report.
•Crystal Reports can generate information such as the print date or page numbers.
3.2.3 Finding the data
What data do you want to use in the report?
Do you know the type of data source you are reporting from? If you do not know, ask the data source
administrator in your organization for help in setting up the data source type and location of the data.
Are you familiar enough with the data to find the necessary information? When looking for a Customer
Contact name, can the object be found in a result folder?
If not, your MIS professional, data source administrator, or co-workers will have to help you become
familiar with the data.
What specific data should appear in the body of the report?
The body should contain all the data needed to fulfill the statement of purpose you wrote for the report.
It should also contain all of the data needed by the various users that you have identified.
This step requires you to look at the available result folder(s). Crystal Reports allows you to combine
data from different data sources when you create reports, so you have a great deal of flexibility in your
work.
•Much of the data in a typical report is taken directly from result objects. Which result objects will be
used, and where are they located?
•Other data will be calculated based on result objects. Which result objects will be used in the
calculations?
•Still other data will be placed directly into the report using text elements (headings, notes, labels,
and so on).
2010-11-1639
Report Design Concepts
Does the data exist or does it need to be calculated?
Some report information can be drawn directly from result objects (sales information, for example);
other information will have to be calculated based on result object values (for example, sales commission,
based on the relationship of sales to quota). In your planning, it can be helpful to segregate or flag data
that needs to be calculated from that which can be used directly.
What types of objects contain data?
You should take the time to get to know the data type for result objects that will be used in your
calculations. Since formula functions and operators work with specific kinds of data, it is important to
recognize the data type you are working with, before you start any calculations. For example, some
functions require numeric data, while others work with only string objects.
3.2.4 Manipulating the data
Do you want the data organized into groups?
How? By customer? By date? By hierarchy? Or by other criteria? Crystal Reports provides several
options for grouping data in a report.
Do you want the data sorted based on record or group values?
Crystal Reports gives you both alternatives.
Do you want the report to contain only specific records or groups?
Crystal Reports gives you the opportunity to base a report on all of the records in a given data source,
or on a limited set of records from the data source. Crystal Reports can be used to filter records based
on simple date ranges or comparisons, or to create complex formulas to identify the records to be
included. Filtering data can be done in the Query Panel, or on your report with parameters and interactive
filters. Take a few minutes to determine the records needed for the report and list the criteria to be used
for filtering those records.
Do you want to total the data?
Do you want to total, average, count, or determine the maximum or minimum value included in all the
values in any column on the report?
Crystal Reports allows you to do this, and it also allows the grand total (or the grand total average,
grand total count, and so on) to be placed at the bottom of the selected column.
What information should be flagged on the report?
You may want to call attention to some data by flagging it on the report. For example, non-moving
inventory items are often flagged on inventory reports so they can be given special attention. You might
want to flag each item that has shown no activity during the last month, during the last three months,
or during some other defined period. To flag information, identify it and any conditions that will trigger
the flagging.
2010-11-1640
Report Design Concepts
How do you want information flagged?
You may want to flag items with an asterisk or some other symbol, or you may want a word to appear
as a flag. In any case, you should write out flagging instructions so they are handy.
Crystal Reports gives you the opportunity to underline report elements, and change the font type, size,
or color used for specific report elements. It allows you to put borders around elements and to draw
lines and boxes (to break the report into sections), set off headings, and so on. All of these formatting
tools can be used to highlight key data on a report.
3.2.5 Determining printing area characteristics
Each report area has its own printing characteristics. It is important to understand these characteristics
because they affect when and how often different report elements get printed.
In what order will the areas print on the report?
Areas print in the order they appear in "Structure" mode (top to bottom). If there is more than one section
in an area, the sections print in the order they appear. For example, if you have three "Report Header"
sections, all three of those sections will print, in order, before the section(s) in the "Page Header" area
begin to print.
How often do report elements print?
The way elements print will determine how you design your report. This will help you decide where to
place charts, Cross-Tabs, and formulas to get specific results.
Report Header
Elements placed in the "Report Header" area print once, at the beginning of the report.
•Charts and Cross-Tabs placed in this area contain data for the entire report.
Note:
Both charts and Cross-Tabs can filter report data by using a Group Sort; in such cases, the data
shown in the chart or Cross-Tab is a subset of the data for the entire report.
•Formulas placed in this area are evaluated once, at the beginning of the report.
Page Header
Elements placed in the "Page Header" area print at the beginning of each new page.
•Charts or Cross-Tabs cannot be placed in this section.
•Formulas placed in this area are evaluated once per page, at the beginning of each new page.
Group Header
Elements placed in the "Group Header" area print at the beginning of each new group.
•Charts and Cross-Tabs placed in this area contain data just for the group.
2010-11-1641
Report Design Concepts
•Formulas placed in this area are evaluated once for each group, at the beginning of the group.
Body
Elements placed in the "Body" area print with each new record.
•Charts or Cross-Tabs cannot be placed in this area.
•Formulas placed in this area are evaluated once for each record.
Group Footer
Elements placed in the "Group Footer" area print at the end of each group.
•Charts and Cross-Tabs placed in this area contain data just for the group.
•Formulas placed in this area are evaluated once for each group, at the end of the group.
Report Footer
Elements placed in the "Report Footer" area print once at the end of the report.
•Charts and Cross-Tabs placed in this area contain data for the entire report.
Note:
Both charts and Cross-Tabs can filter report data by using a Group Sort; in such cases, the data
shown in the chart or Cross-Tab is a subset of the data for the entire report.
•Formulas placed in this area are evaluated once, at the end of the report.
Page Footer
Elements placed in the "Page Footer" area print at the bottom of each page.
•Charts and Cross-Tabs cannot be placed in this area.
•Formulas placed in this area are evaluated once per page, at the end of each new page.
3.3 Developing a prototype on paper
While a paper prototype is useful regardless of your level of expertise with Crystal Reports, it is particularly
valuable when you are first learning the program. With the paper prototype in hand, you can put your
full effort into learning and using the commands, rather than into trying to design and learn at the same
time.
3.3.1 To design a paper prototype
1.
Use the same size paper you will be using for the finished report.
2010-11-1642
Report Design Concepts
2.
Position the title and other descriptive header information, using boxes or lines to represent report
elements.
3.
Position the footer information.
4.
Review the page structure for balance.
5.
Look at the information you intend to include in the body of the report:
•Count the number of objects being used and estimate the appropriate spacing between objects.
•Use rectangles to pencil in the objects within the estimated spacing.
•Change the spacing if you need to.
•Decide on a logical sequence for presenting the data in the body of the report.
•Label the objects to indicate that sequence.
6.
Use small boxes to indicate group values and totals.
7.
Place random flags in the column where you want flags to appear.
8.
Darken any elements you want highlighted to make them stand out from the rest of the prototype.
9.
Review the finished product for structure and balance, and make changes as needed.
2010-11-1643
Report Design Concepts
2010-11-1644
Data Source Connections
Data Source Connections
4.1 Connecting to a universe
Universes include data from one or more relational data sources or OLAP cubes.
You can base new documents and queries only on universes for which you have been granted the
right.
4.1.1 To connect to a universe
Before you connect to a universe, log on to an SAP BusinessObjects Enterprise server.
1.
Click File > New Report.
The "New Data Source Connection" dialog box appears.
2.
From the "Data Source Type" list, click Universe.
3.
On the "Name" panel, select a universe and select Next.
The "Query Panel" appears. You can now select objects from the universe to include in your query.
4.2 Connecting to an SAP BEx query
Each SAP BEx query contains a group of pre-designed result objects that you can run reports on.
Though the queries are pre-designed, you can use the "Query Panel" to sort and filter the query before
you run the report.
SAP BEx queries are hierarchy-based and can have multiple hierarchies. For example, a query on
expenses by region will create a different report than a query on expenses by employee. After you
insert the result objects in your query, if your SAP BEx query includes a variable hierarchy, you must
specify a hierarchy in order to run the report.
2010-11-1645
Data Source Connections
4.2.1 To connect to an SAP BEx query
Before you connect to an SAP BEx query, log on to an SAP BusinessObjects Enterprise server.
1.
Click File > New Report.
The "New Data Source Connection" dialog box appears.
2.
From the "Data Source Type" list, click SAP BEx Query Data Access.
3.
On the "Name" panel, select an OLAP Connection and select Next.
The "Query Panel" appears. You can now select objects from the data source to include in your
query.
4.
Click Finish.
5.
(Optional) If the SAP BEx query you connected to is designed to include an SAP server-side variable,
a dialog box appears prompting you to enter the variable option for your query.
4.3 Connecting to an Analysis View
Each Analysis View contains a pre-designed query containing pre-designed result objects. Unlike
universes or BEx queries, queries in an Analysis View cannot be edited in Crystal Reports. You can
manipulate the data from an Analysis View by using the various Crystal Reports filtering and grouping
features. To change the query itself, you need to open the Analysis View in SAP BusinessObjects
Advanced Analysis.
4.3.1 To connect to an Analysis View
Before you connect to an Analysis View, log on to an SAP BusinessObjects Enterprise server.
1.
Click File > New Report.
The "New Data Source Connection" dialog box appears.
2.
From the "Data Source Type" list, click Analysis View.
3.
On the "Name" panel, select a pre-defined analysis view and select Next.
The report canvas appears. You can now add result objects from the "Data Explorer" side panel to
your report.
2010-11-1646
Designing a query
Designing a query
Universe and SAP BEx data source connections allow you to design the query to run reports on in
Crystal Reports.
5.1 Universe query design
Universe query designs include data from both relational and OLAP data sources.
To design a query using a universe, you need to first define the data selection using the Query Panel.
You then use the Member Selector to choose which members and hierarchies to include in the query.
Finally, you can refine your query further by adding sorts, filters and prompts to your query.
The following notes include CSL best practices when designing your universe query:
•It is recommended to avoid including both a hierarchy object and associated level objects in the
same report. A hierarchy object contains all the hierarchy nodes in a hierarchy form, whereas a level
object contains only the hierarchy nodes that match the level index in a flattened form. If both kinds
of objects are included in a report, the hierarchical data and flattened data will both be included in
the query.
•It is recommented to use delegated measure as much as possible (in group headers, charting,
cross-tab, etc) because delegated measures push down data from within the data souce. This will
improve performance and data correctness.
•It is recommended to define your filters and sorts in the Query Panel to achieve better performance.
Filtering and sorting defined in the Query Panel will push down data from within the data source.
Filtering and sorting defined in the Crystal Reports designer will be calculated locally.
•It is recommened for report designers to set the filter in the Query Panel before previewing the report
for optimized performance. When migrating a report from C++ stack to Java stack through a set
data source location, all filter information is kept in selection formula, which is calculated locally.
CSL will bring back all the data to be filtered on the designer side.
5.1.1 Defining the data selection for a universe query
2010-11-1647
Designing a query
You build queries in the "Query Panel" by using objects in a universe. The objects in the universe are
a graphical representation of the information available in a data source.
The "Query Panel" is divided into several panes:
•The "Universe" pane shows a tree view of the objects that your universe contains. You cannot add
•The "Result Objects" pane is where you place the objects that you want as part of your query.
•The "Query Filters" pane is where you place the objects that you want to use to filter the data that
new objects or edit existing objects in the universe from the "Query Panel".
Note:
You can see all available objects in this pane by clicking Expand all. If you want to see how objects
relate to each other, click Collapse all. This option provides you with a visual representation of the
hierarchical structure of objects if such a structure is present in the universe.
is returned from your universe. You can add predefined filters from your Universe, or create custom
filters by adding objects and using the list boxes to define your filter.
5.1.1.1 Quick reference to objects
An object is a named component that maps to data or a derivation of data in the data source. For
example, an object may represent a column in a result folder, or it may be the summary of the values
in a column.
You use objects in a query to retrieve data for your reports. For example, some of the objects in a
human resources universe might be Names, Addresses, and Salaries.
Objects can represent different types of information.
Note:
•Object properties are defined in the SAP BusinessObjects Designer, but are not taken into account
by the "Query Panel" in Crystal Reports.
•Objects cannot be defined directly in the "Query Panel". Use the SAP BusinessObjects Designer to
define objects in a universe.
DescriptionExamplesObject
This object is a logical grouping
Analysis Dimension
of columns from one or more
dimension tables that describes
a similar set of characteristics.
2010-11-1648
Designing a query
Time Dimension
Attribute
DescriptionExamplesObject
This object retrieves the data
that provides the time basis for
analysis in a report. Time Dimension objects typically retrieve
date-type data.
This object provides descriptive
data about a dimension. A detail
is always attached to the dimension for which it provides additional information. For example,
Address, Birth Date and Commute Distance are detail objects
that are associated with the
Customer dimension.
Measure
Default Hierarchy
Level based Hierarchy
Self-referenced and Value
based Hierarchy
Named Set
This object retrieves numeric
data that is the result of calculations on data in the data source.
Measure objects are often located in a Measures class.
This object provides a specific
default sorting order of the dimension data.
This object provides a sorting
order of the dimension data
based upon a specific level.
This object provides a sorting
order of the dimension data
based upon a value.
This object is a group of members that you select and save as
a personalized set of members.
They would not normally appear
together in a hierarchy, but correspond to queries or parts of
queries that you frequently use.
2010-11-1649
Designing a query
Filters
DescriptionExamplesObject
An object that allows you to select a subset of objects based
on query criteria provided.
This object represents an axis
of analysis in a query. It can
map to one or more columns or
calculations that are used as a
key element for analysis in a
query. Dimensions based on a
data foundation or an OLAP
cube differ as follows:
Dimension
Level
Folder
•A dimension based on an
OLAP cube contains hierarchies organized by levels.
Each level can contain an
attribute.
•A dimension based on a data
foundation contains attributes. Hierarchies are
constructed across related
tables as flat hierarchies.
This object retrieves a subset of
the data from the parent hierarchy object where all of the returned values come from the
same depth in the hierarchy.
This object is a container that
holds a group of related objects.
This is equivalent to the Class
in Universe Designer.
5.1.1.2 Universe member selection
2010-11-1650
Designing a query
Use the "Member Selector" to select members of OLAP universe hierarchies to:
•Create named sets of members when creating a universe.
•Create queries based on hierarchies or members of hierarchies.
•Define members that will be excluded from queries.
The "Member Selector" consists of the following panes:
DescriptionPane
"Member Selector"
pane
This is the top pane of the "Member Selector", there are three tabs:
•"Members" tab: Select or exclude members according to specific relationships
in the hierarchy.
•"Metadata" tab: Select or exclude by metadata criteria. This tab displays objects
by hierarchy levels, named sets, and calculated members.
•"Prompt" tab: Create prompts so that the user selects members or metadata
at run-time.
"Summary "pane
This shows the selected members, prompts, and excluded members of the query
that you are building. The information you see in the "Summary" pane appears
in the "Result Objects" pane of the "Query Panel".
5.1.1.2.1 About hierarchies
A hierarchy is an ordered series of related objects (dimensions). An example of a hierarchy is Geography,
which may group dimensions such as Country, Region, and City. Users can observe data related to
the hierarchy from various viewpoints (All cities for a selected region, all cities for a selected country,
the country and region for a selected city, and so on).
To select a member by a hierarchal relationship
Use the member relations functions of the "Member Selector" to choose members by their relationship
or position within a hierarchy. The different relationships you can select are available when you select
a member in the "Member Selector" pane.
Note:
Children/Descendants and Parents/Ancestors are mutually exclusive pairs. You cannot choose both
the children and descendants of a member, and you cannot choose the parents and ascendants of a
member.
1.
In the "Members" tab of the "Member Selector", click in the selection box on the left of the member
name.
2.
In the "Member Selector", click the name of the selected member.
The list of available options appears.
3.
Choose the appropriate relation function from those described below:
2010-11-1651
Designing a query
DescriptionOption
Self
Children
Descendants
Siblings
Use only the selected member. This is the default setting.
Selects members of the same level in a branch of a hierarchy.
Selects the members below the active member in a hierarchy.
Selects all the members of the same level in different branches of the hierarchy
set.
Ancestors
To select the members above a specific member in a hierarchy, click the
member below the members you want to select, and select this function.
Parent
Selects the member directly above a member.
The selection is displayed in the "Summary" pane, preceded by fx.
To select members by level
You can select all of the members of the same level in different branches of a hierarchy. For example,
select all of the quarters in a time dimension, or cities in a geography dimension.
1.
Drag a hierarchy into the "Result Objects" pane.
2.
Launch the "Member Selector."
The "Member Selector" displays the hierarchy members in a tree view.
3.
In the "Member Selector," click the Metadata tab.
The "Member Selector" displays the available Levels, Calculated Members, and Named Sets.
4.
Select a level.
5.
Click OK.
When you run the query, the members from the selected level are computed dynamically when the
report is created.
5.1.1.2.2 About named sets
A named set is a group of members that you select and save as a personalized set of members. They
would not normally appear together in a hierarchy, but correspond to queries or parts of queries that
you frequently use. The named set is available in the "Query Panel" for creating queries for the end-user.
To select named sets
The hierarchy object you have placed in the "Result Objects" pane of the "Query Panel" contains one
or more named sets.
1.
Drag a hierarchy into the "Result Objects" pane.
2.
Launch the "Member Selector."
3.
In the "Member Selector", click the Metadata tab.
2010-11-1652
Designing a query
The "Member Selector" displays the available levels, calculated members, and named sets.
4.
Select a named set.
5.
Click OK.
5.1.1.2.3 About calculated members
A calculated member is a complex calculation that you create in the data source. The calculated member
is available on the "Metadata" tab of the "Member Selector".
To select a calculated member
Before you begin, drag and drop a hierarchy or hierarchy member of an OLAP universe into the "Result
Objects" pane of the "Query Panel". The hierarchy you have selected contains one or more Calculated
members.
1.
Drag a hierarchy into the "Result Objects" pane.
2.
Launch the "Member Selector."
3.
In the "Member Selector", click the Metadata tab.
The "Member Selector" displays the available Levels, Calculated Members, and Named Sets.
4.
Select a member.
5.
Click OK.
5.1.1.2.4 About selecting universe members
Use the "Member Selector" to select a part of a hierarchy, or members of a hierarchy of an OLAP
universe. You can:
•Select members according to their level or relationship within a hierarchy.
•Select named sets.
•Select calculated members.
•Specify members that you want to exclude from the query.
•Create a prompt for the end user to select criteria or members for a query.
When you have defined the members that are used in the query, you can use the query panel to add
filters and to preview the query.
Note:
When a member is selected along with a child node, all of the children of the member are included in
the query.
To sort members
By default the selected members are not sorted, they appear in the order they are stored in the data
source. You can sort lists in ascending or descending alphabetical order. This is the order that appears
in the query.
1.
Click a list of members.
2010-11-1653
Designing a query
2.
Click the Sort order button and select the sort order from the list.
The sort is performed locally, and is displayed in the "Member Selector".
Note:
The sorted list does not correspond to the order in the data source, the sort is performed locally.
To exclude a member or member set from a selection
Before you begin, drag and drop a hierarchy or hierarchy member of an OLAP universe into the "Result
Objects" pane of the "Query Panel". You want to exclude one or more members from the query.
You can exclude members from a query in order to restrict results. Use the Exclude function in the
"Summary" pane of the "Member Selector", you can accurately define a member or member set that
you do not want to appear in the query. For example, you could exclude one town from a query that
returns sales figures for all states in a region. You can exclude:
•Explicit members.
•Implicit members resulting from member functions.
•Implicit members resulting from hierarchy levels.
•The hierarchy default member.
You cannot preview the expected results. You must create a report in order to observe the results. To
select a member that you want to exclude from the query results, do the following:
1.
Click a hierarchy in the "Result Objects" pane to launch the "Member Selector".
2.
Use the appropriate functions in the "Member Selector" to define the members that you want to
exclude.
The defined member appears in the "Summary" pane.
3.
Select the member to exclude.
4.
Click the Exclude checkbox.
The excluded member name displays in the "Summary" pane (and in the "Result Objects" pane)
with a line through the name to indicate that it is excluded from the query.
To insert a prompt in a selection
The prompt will appear when the selected member is used as a result object or filter object in a query.
You can prompt the user to select a member for the query.
1.
In the query panel, double-click a member of a hierarchy.
The "Member Selector" appears.
2.
Click Prompt.
3.
Edit the prompt.
4.
Click OK.
2010-11-1654
Designing a query
5.1.2 Defining sorting
The sort button in the "Query Panel" will define how the data is retrieved from the data source. When
the query is run, a sort defined in the "Query Panel" will affect the order and amount of data that is
retrieved from the data source.
You can sort locally, using Crystal Reports features which sorts all the data retrieved from the query.
Using the sorting option in the "Query Panel" is recommended to define your sort more efficiently since
it sorts the data from the data source.
5.1.3 Defining query filters and prompts
You can add filters and prompts to your query to limit the data shown in the report.
Note:
Filters and member selection allow you to sort your data in different ways. Member selection does not
have an effect on the measure value of your data. For example, if you select a single city or all the cities
for a country, the value for the measure for that country will not be affected by the member selection.
Filtering data does have an effect on the measure value. For example, if you filter your data for a
particular city, the value for the related country will be reduced to the value of that country.
5.1.3.1 Creating query filters
You can use the following types of filters in a query:
•Predefined filters
These filters are created by your administrator.
•Custom filters
You define these filters while you are creating the query.
•Prompts
Prompts are dynamic filters that you define to display a question or a list of values; users can select
different filter values each time they refresh the report.
2010-11-1655
Designing a query
5.1.3.1.1 To add a predefined filter to a query
1.
Double-click the objects you want to use in your report, or drag them to the "Result Objects" pane.
2.
Drag a predefined filter to the "Filters" pane.
Note:
Predefined filters are created and edited by your administrator. As a user of the "Query Panel", you
cannot view the component parts of predefined filters, neither can you edit them.
When you run the query, the data corresponding to the query filters you selected is returned to the
report.
5.1.3.1.2 To create a custom filter
1.
Select the object you want to filter and drag it to the "Filters" pane.
2.
Select an operator from the list.
3.
Select Constant, LOV (list of values), or Prompt.
4.
The value you enter depends on the option you selected in step 3:
DescriptionOption
Constant
LOV
•Type a value into the text box.
a.
In the "Prompt(s)" dialog box, add members to your list by double-clicking
them, or by selecting them in the "Members" pane and clicking the arrow
in the center.
b.
Click OK.
Prompt
a.
In the "Edit Prompt" dialog box, select "New Prompt" to add a new prompt,
or "Use Universe Parameters" to select a parameter from your universe.
b.
If you selected a "New Prompt", enter prompt options, or if you selected
"Use Universe Parameters", select a parameter.
c.
Click OK.
The filter is added to the report. You can edit or remove the filter in the "Query Panel".
Related Topics
• Quick reference to query filter operators
5.1.3.2 Building prompts
2010-11-1656
Designing a query
A prompt is a dynamic filter that displays a question every time you refresh the data in a report. You
respond to prompts by typing or selecting the values you want to view before you refresh the data.
Crystal Reports retrieves only the values you specified from the data source and returns those values
to the report.
Tip:
Prompts allow multiple users to view a single report but specify a different sub-set of the data source
information. Prompts also reduce the time it takes for the data to be retrieved from the data source.
5.1.3.2.1 To create a prompt
1.
Select the object you want to apply a prompt to and drag it to the "Filters" pane.
For example, if you want to allow users to specify the geographical region for the report, drag the
Region object to the "Filters" pane.
2.
Select an operator from the list.
Note:
You cannot use the following operators for prompts: Is null or Is not null.
3.
Select Prompt.
4.
In the "Edit Prompt" dialog box, select New Prompt.
5.
Enter a prompt message in the "Prompt Text" box.
For example, you might ask "Which region do you want to see data for?"
6.
Select "Select only from list" if you want your prompt to display a list of values from which users can
select values.
7.
Click OK to confirm the prompt.
The prompt appears at each report refresh.
Related Topics
• Quick reference to query filter operators
5.1.3.2.2 Combining query filters and prompts
You can apply multiple filters and prompts on a single query.
Quick reference to query filter operators
The following table will help you select the operator you need to define a query filter.
Filter createdSelectExampleValues to retrieve
Values equal to a value
you specify.
Retrieve data for the
US only.
<Country> Equal to USEqual to
2010-11-1657
Designing a query
Filter createdSelectExampleValues to retrieve
Values different from a
value you specify.
Values greater than a
value you specify.
Values greater than or
equal to a value you
specify.
Values lower than a
value you specify.
Values lower than or
equal to a value you
specify.
Values between two
values you specify that
includes those two values.
Retrieve data for all
quarters except Q4.
Retrieve data for customers aged over 60.
Retrieve data for revenue starting from
$1.5M upward.
Retrieve data for exam
grades below 40.
Retrieve customers
whose age is 30 or
less.
Retrieve the weeks
starting at week 25 and
finishing at 36 (including week 25 and week
36).
Not Equal to
Greater than
Greater than or equal
to
Less than
Less than or equal to
Between
<Quarter> Different
from Q4
<Customer Age>
Greater than 60
<Revenue> Greater
than or equal to
1500000
<Exam Grade> Less
than 40
<Age> Less than or
equal to 30
<Weeks> Between 25
and 36
Values outside the
range of two values
you specify.
Values that are the
same as several values
you specify.
Values that are different from the multiple
values you specify.
Retrieve all the weeks
of the year, except for
weeks 25 through 36
(week 25 and week 36
are not included).
Retrieve data for only
the following countries:
the US, Japan, and the
UK.
Don't retrieve data for
the following countries:
the US, Japan, and the
UK.
Not between
In list
Not in list
<Weeks> Not Between
25 and 36
<Country> In list 'US;
Japan; UK'
<Country> Not in list
'US; Japan; UK'
2010-11-1658
Designing a query
Values for which there
is no value entered in
the data source.
Values for which a value was entered in the
data source.
Retrieve customers
without children (the
children column in the
data source has no data entry).
Retrieve customers
with children (the children column in the data
source has a data entry).
Filter createdSelectExampleValues to retrieve
<Children> Is nullIs null
<Children> Is not NullIs not Null
Values that includes a
specific string.
Values that don't include a specific string.
Retrieve customers
whose date of birth is
1972.
Retrieve customers
whose date of birth is
not 1972.
Matches pattern
Different from pattern
<DOB> Matches pattern, '72'
<DOB> Different from
pattern, '72'
To combine filters and/or prompts
1.
Create each query filter and/or prompt.
By default, the "Query Panel" combines the filters and prompts with the And operator. You can leave
the And operator or change the operator to Or.
2.
If necessary, change the operator to Or by double-clicking the And operator.
The prompts appear when you click OK, or when you refresh the report data.
Using And or Or to combine query filters
This table explains the difference between the And and the Or operators.
2010-11-1659
Designing a query
Data true for both filters.
Data true for any one of the filters.
Customers who ordered supplies in Q1 and in Q2 (the data
you retrieve will include: customers who placed orders in
both Q1 and Q2).
Customers who ordered supplies in: Q1 or Q2 (the data you
retrieve will include: customers
who placed orders in Q1only;
customers who placed orders
only in Q2, and; customers who
placed orders in both Q1 and
Q2).
SelectExampleRetrieve this data
And
Or
5.1.3.3 Incompatible queries
Incompatible queries contain objects from two different contexts that are combined in a query. Crystal
Reports for Enterprise does not support incompatible queries. If your query is an incompatible query,
in the "Query Panel", re-design the query to avoid incompatibilities before you run the report.
5.1.3.4 Selecting query context
Relational data sources can include data that is displayed in different ways depending on which context
is selected. The data retrieved from the data source is based upon the selected context.
Crystal Reports requires you to determine a specific context for your query to run the report if the query
contains multi-context options.
You can change the query context in the "Query Properties" dialog box.
2010-11-1660
Designing a query
5.1.3.5 To build a simple query
1.
Select an object in the "Universe" pane and double-click it or drag it to the "Result Objects" pane.
Objects that are placed in the "Result Objects" pane become the objects that your report will be
based on.
2.
Repeat the previous step for each object that you want to include in the query.
3.
(Optional) If you want to filter your query, select an object in the "Universe" or "Result Objects"
panes, and drag it to the "Filters" pane.
Add filters to the objects in the "Filters" pane to restrict the data your query returns. Filtering limits
the data that a user can see and reduces the runtime of queries.
4.
Click Finish.
The report is generated. The data from the objects in the "Result Objects" and "Filters" panes are
automatically formatted onto the report. The formatting time will vary depending on the size of your
report.
5.1.3.6 To create a combined query
In order to create a combine query, you must be connected to a relational universe with allow combined
operators enabled.
1.
After you create a simple query, click the (Show/Hide) the combined query pane button.
The combined queries pane appears below the "Universe" pane.
2.
Click Add a Combined Query.
A new query is added to the pane and the two queries are combined with a Union join. To change
the type of join, double-click the join button to choose between the following options:
•Union
•Minus
•Intersect
•Union All
3.
Repeat Step 2 for any additional queries you want to add.
You can switch between your query definitions by clicking the buttons in the "Combined Queries"
pane.
2010-11-1661
Designing a query
5.1.4 Query panel functions
The Query Panel consists of the following elements:
Table 5-4: The Query Panel elements
"Universe" panel
DescriptionQuery Panel element
This pane shows the available classes and objects, organized in a tree structure. Click a node
(+) to open a branch or hierarchy, click again on
the node to close or collapse the hierarchy. Select
the display mode (caption, technical name, or
both caption and technical name for each object).
You can search for objects in this panel by flicking
the Filter button and entering the search string.
To build a query, drag objects from this panel to
the "Result Objects" or "Query Filters" panel.
"Combine Queries" panel
"Result Objects" panel
"Query Filters" panel
This panel only displays when you are combining
queries. When you click (Show/Hide) CombineQueries Panel, the panel shows the structure of
the queries you are combining. You can move
the query icons to reorganize the way that the
queries are combined. Click a query icon to display the query properties in the "Objects" and
"Filters" panels.
Select the objects you want to include in the query
from the "Universe" panel and drag them into this
panel. These objects are returned as column
headers in the resulting report. When you place
hierarchical objects here, use the "Member Selector" tool to displays and select the members of
the hierarchy that you want to include in the query.
You can also select members that you want to
exclude from the query.
When you click (Show/Hide) Filter Panel, you
can drag objects into this panel to restrict the result data by limiting the query. For example, you
can limit the results returned to specific values or
value ranges.
2010-11-1662
Designing a query
"Data Preview" panel
Use the query panel to create the following types of queries:
•Hierarchical queries for OLAP universes.
•Non-hierarchical queries for relational universes.
•Non-hierarchical queries for SAP BusinessObjects Enterprise XI 3.X universes.
The "Query Panel" also has the following buttons:
•Combine Queries shortcut button to combine queries for a relational universe.
•Query Properties to view and edit the query properties.
•View Script to view the structure of the query.
DescriptionQuery Panel element
When you click (Show/Hide) Data Preview
Panel, this panel allows you to test the results of
the query. You can preview the results that the
user will see, and modify the query and preview
the effects of the modification.
5.1.4.1 About query properties
You can set the following properties for a query:
2010-11-1663
Designing a query
DescriptionProperty
Retrieve duplicate rows
Retrieve non empty rows
(only supported in OLAP universes
Max retrieval time
Max rows retrieved
When this option is selected, the query returns all related
rows, even if there are duplicate rows. If you do not want
duplicate rows in the result set, deselect this option.
An empty row occurs typically in multidimensional
queries when the data for the intersection of two or more
dimensions does not exist.
When this option is selected, the result set will contain
only rows that contain data.
When this option is deselected, the result set includes
rows that do not contain data.
Defines the maximum time (in milliseconds) that a query
can run before the query is stopped. By default, this
value is the same as the Limit Execution Time parameter
in the universe parameters.
When you set this value to 0, this option is disabled.
When the Limit Execution Time parameter is lower than
this setting, the Limit Execution Time value is used for
limiting the query execution time.
Defines the maximum number of rows of data that are
displayed when the query runs. The query retrieves all
the possible rows, but only displays the first n rows,
where n is the maximum number of rows set for this
parameter.
Sample result set
The administrator can override this setting in the user
security profile settings.
This parameter (when supported by the data source)
samples n data source rows, where n is the value set
for the sample result set. This method is faster than using
the Max rows retrieved parameter.
2010-11-1664
Designing a query
DescriptionProperty
Reset contexts on refresh
Allow other users to edit all queries
(interactive analysis only)
Prompt order
When this option is selected, when a user refreshes a
query that contains contexts, the user must choose the
context(s). The user can clear the previously selected
contexts by clicking Clear Contexts.
When this option is not selected, the query is refreshed
using the original contexts. If the contexts have been
edited since the last run for the query, the user must
choose the contexts again since the query is considered
as a new query.
When selected, other users can access Query View and
modify queries in the document. When cleared, only the
report creator can modify the document. This option
applies to all queries in the document.
When there are several prompts in a query, use this
feature to set the order in which prompts are executed
in a query. Click a prompt and use the up or down arrow
to change the position of the prompt.
5.1.4.2 View script
Use the "View Script" button to view the query specifications. The query specification is viewable in an
xml format that shows the query design.
5.1.4.3 About copying query specifications
Use the "Copy query specifications in clipboard" button to copy your current query specifications in the
"Result Objects" panel to a clipboard. The clipboard is viewable in xml format in the "QuerySpec XML"
dialog box.
5.1.4.4 About pasting query specifications
2010-11-1665
Designing a query
Use the "Paste query specifications from clipboard" button to paste your copied query specifications
from the clipboard to the "Result Objects" panel. Query specifications can be executed without defining
any object in the Query Panel.
5.1.4.5 Editing an existing query
You can return to the "Query Panel" to edit an existing query. Queries can be edited by adding or
removing an object, or you can add, edit, or remove a filter.
5.1.4.5.1 To edit an existing query
Before the query can be edited, you must first log on to an SAP BusinessObjects Enterprise server.
1.
To edit your report query, click Data > Edit Query.
The "Query Panel" appears.
2.
In the "Query Panel", edit your query as necessary.
3.
When you have finished editing your query, click Finish.
Changes that you made in your query are reflected in your report.
Note:
If you remove objects from your query that you have used in your report, the objects will automatically
be removed from the report.
5.1.5 Auto generate report with default layout
The "Generate Report" check box in the "Query Panel", when selected, will automatically generate the
report using the result objects placed in the "Result Objects" panel.
Note:
The "Generate Report" feature will work differently if you are connected to a relational data source or
an OLAP data source.
5.1.5.1 Relational data sources
When connected to a relational data source, the selected "Generate Report" check box will automatically
generate a report containing all report objects positioned in the "Result Objects" panel.
2010-11-1666
Designing a query
The objects will appear on the report canvas in the "Body" section in the same order they positioned
in the "Result Objects" panel.
5.1.5.2 OLAP data sources
When connected to an OLAP data source, the selected "Generate Report" check box will only
automatically generate a report containing all report objects positioned in the "Result Objects" panel if
a hierarchy is not selected.
If a hierarchy is selected, the hierarchy and the members the hierarchy contains will not automatically
be added to the "Body" section of the report canvas.
5.2 SAP BEx query design
SAP BEx queries contain pre-designed result objects to run reports on.
5.2.1 Active hierarchies
SAP BEx queries are often hierarchical and can have more than one hierarchy to choose from. As a
report designer, you need to choose a hierarchy to report on. This is referred to as the active hierarchy.
An active hierarchy is a hierarchy that is currently being used. The hierarchy represents a different
hierarchy from the data source, but with the same name. If the hierarchy variable is changed when the
report is refreshed, the report will change the underlying hierarchy represented by the active hierarchy.
For example if you have two hierarchies from an SAP BEx query: country_hierarchy_01 and
country_hierachy_02 the "Query Panel" will display a single hierarchy named country. The "country"
hierarchy represents the active hierarchy. When this hierarchy is used in a report, the name will remain
unchanged. If this hierarchy is mandatory to the BEx query to run the report, when the report is refreshed,
Crystal Reports will prompt you to select the hierarchy variable. Your selection of country_hierarchy_01
or country_hierachy_02 will change the underlying hierarchy represented by the country hierarchy, but
the name of the country hierarchy will not change.
It is recommended to use an active hierarchy (such as country) instead of a specific hierarchy (such
as country_hierarchy_01 or country_hierachy_02)
2010-11-1667
Designing a query
5.2.2 Defining the data selection for an SAP BEx query
You build queries in the "Query Panel" by using objects in an SAP BEx query. The objects in the SAP
BEx query are a graphical representation of the information available in a data source.
The "Query Panel" is divided into several panes:
•The "Universe" pane shows a tree view of the objects that your universe contains. You cannot add
new objects or edit existing objects in the universe from the "Query Panel".
Note:
You can see all available objects in this pane by clicking Expand all. If you want to see how objects
relate to each other, click Collapse all. This option provides you with a visual representation of the
hierarchical structure of objects if such a structure is present in the universe.
•The "Result Objects" pane is where you place the objects that you want as part of your query.
•The "Query Filters" pane is where you place the objects that you want to use to filter the data that
is returned from your universe. You can add predefined filters from your Universe, or create custom
filters by adding objects and using the list boxes to define your filter.
5.2.2.1 SAP BEx query member selection
Use the "Member Selector" to select members of OLAP SAP BEx query hierarchies to:
•Create named sets of members when creating an SAP BEx query
•Create queries based on hierarchies or members of hierarchies
•Define members that will be excluded from queries
The "Member Selector" consists of the following panes:
DescriptionPane
"Member Selector"
pane
"Summary "pane
"Members" tab: Select or exclude members according to specific relationships in
the hierarchy.
This shows the selected members, prompts, and excluded members of the query
that you are building. The information you see in the "Summary" pane appears
in the "Result objects" pane of the "Query Panel".
Note:
Universe and SAP BEx Query member selection differ in their behavior when restricting members. In
a universe member selection, there is no restriction of member selection. However, for an SAP BEx
2010-11-1668
Designing a query
Query, if you select a parent node and one of its child nodes, all children nodes will be selected in the
query.
5.2.2.1.1 About hierarchies
A hierarchy is an ordered series of related objects (dimensions). An example of a hierarchy is Geography,
which may group dimensions such as Country, Region, and City. Users can observe data related to
the hierarchy from various viewpoints (All cities for a selected region, all cities for a selected country,
the country and region for a selected city, and so on).
To select a members by hierarchal relationships
Use the member relations functions of the "Member Selector" to choose members by their relationship
or position within a hierarchy. The different relationships you can select are available when you select
a member in the "Member Selector" pane.
1.
In the "Members" tab of the "Member Selector", click in the selection box on the left of the member
name.
2.
In the "Member Selector", click the name of the selected member.
The list of available options appears.
3.
Choose the appropriate relation function from those described below:
DescriptionOption
Self
Children
Descendants
Use only the selected member. This is the default setting.
Selects members of the same level in a branch of a hierarchy.
Selects the members below the active member in a hierarchy.
The selection is displayed in the "Summary" pane, preceded by fx.
5.2.2.1.2 About named sets
A named set is a group of members that you select and save as a personalized set of members. They
would not normally appear together in a hierarchy, but correspond to queries or parts of queries that
you frequently use. The named set is available in the "Query Panel" for creating queries for the end-user.
To select named sets
The hierarchy object you have placed in the "Result Objects" pane of the "Query Panel" contains one
or more named sets.
1.
Drag a hierarchy into the "Result Objects" pane.
2.
Launch the "Member Selector."
3.
In the "Member Selector", click the Metadata tab.
The "Member Selector" displays the available levels, calculated members, and named sets.
4.
Select a named set.
2010-11-1669
Designing a query
5.
Click OK.
5.2.2.1.3 About selecting universe members
Use the "Member Selector" to select a part of a hierarchy, or members of a hierarchy of an OLAP
universe. You can:
•Select members according to their level or relationship within a hierarchy.
•Select named sets.
•Select calculated members.
•Specify members that you want to exclude from the query.
•Create a prompt for the end user to select criteria or members for a query.
When you have defined the members that are used in the query, you can use the query panel to add
filters and to preview the query.
Note:
When a member is selected along with a child node, all of the children of the member are included in
the query.
To sort members
By default the selected members are not sorted, they appear in the order they are stored in the data
source. You can sort lists in ascending or descending alphabetical order. This is the order that appears
in the query.
1.
Click a list of members.
2.
Click the Sort order button and select the sort order from the list.
The sort is performed locally, and is displayed in the "Member Selector".
Note:
The sorted list does not correspond to the order in the data source, the sort is performed locally.
To exclude a member or member set from a selection
Before you begin, drag and drop a hierarchy or hierarchy member of an OLAP universe into the "Result
Objects" pane of the "Query Panel". You want to exclude one or more members from the query.
You can exclude members from a query in order to restrict results. Use the Exclude function in the
"Summary" pane of the "Member Selector", you can accurately define a member or member set that
you do not want to appear in the query. For example, you could exclude one town from a query that
returns sales figures for all states in a region. You can exclude:
•Explicit members.
•Implicit members resulting from member functions.
•Implicit members resulting from hierarchy levels.
•The hierarchy default member.
You cannot preview the expected results. You must create a report in order to observe the results. To
select a member that you want to exclude from the query results, do the following:
2010-11-1670
Designing a query
1.
Click a hierarchy in the "Result Objects" pane to launch the "Member Selector".
2.
Use the appropriate functions in the "Member Selector" to define the members that you want to
exclude.
The defined member appears in the "Summary" pane.
3.
Select the member to exclude.
4.
Click the Exclude checkbox.
The excluded member name displays in the "Summary" pane (and in the "Result Objects" pane)
with a line through the name to indicate that it is excluded from the query.
5.2.2.2 Quick reference to objects
An object is a named component that maps to data or a derivation of data in the data source. For
example, an object may represent a column in a result folder, or it may be the summary of the values
in a column.
You use objects in a query to retrieve data for your reports. For example, some of the objects in a
human resources universe might be Names, Addresses, and Salaries.
Objects can represent different types of information.
Note:
•Object properties are defined in the SAP BusinessObjects Designer, but are not taken into account
by the "Query Panel" in Crystal Reports.
•Objects cannot be defined directly in the "Query Panel". Use the SAP BusinessObjects Designer to
define objects in a universe.
DescriptionExamplesObject
This object is a logical grouping
Analysis Dimension
of columns from one or more
dimension tables that describes
a similar set of characteristics.
This object retrieves the data
that provides the time basis for
Time Dimension
analysis in a report. Time Dimension objects typically retrieve
date-type data.
2010-11-1671
Designing a query
Attribute
Measure
DescriptionExamplesObject
This object provides descriptive
data about a dimension. A detail
is always attached to the dimension for which it provides additional information. For example,
Address, Birth Date and Commute Distance are detail objects
that are associated with the
Customer dimension.
This object retrieves numeric
data that is the result of calculations on data in the data source.
Measure objects are often located in a Measures class.
Default Hierarchy
Level based Hierarchy
Self-referenced and Value
based Hierarchy
Named Set
Filters
This object provides a specific
default sorting order of the dimension data.
This object provides a sorting
order of the dimension data
based upon a specific level.
This object provides a sorting
order of the dimension data
based upon a value.
This object is a group of members that you select and save as
a personalized set of members.
They would not normally appear
together in a hierarchy, but correspond to queries or parts of
queries that you frequently use.
An object that allows you to select a subset of objects based
on query criteria provided.
2010-11-1672
Designing a query
DescriptionExamplesObject
This object represents an axis
of analysis in a query. It can
map to one or more columns or
calculations that are used as a
key element for analysis in a
query. Dimensions based on a
data foundation or an OLAP
cube differ as follows:
Dimension
Level
Folder
•A dimension based on an
OLAP cube contains hierarchies organized by levels.
Each level can contain an
attribute.
•A dimension based on a data
foundation contains attributes. Hierarchies are
constructed across related
tables as flat hierarchies.
This object retrieves a subset of
the data from the parent hierarchy object where all of the returned values come from the
same depth in the hierarchy.
This object is a container that
holds a group of related objects.
This is equivalent to the Class
in Universe Designer.
5.2.3 Defining sorting
The sort button in the "Query Panel" will define how the data is retrieved from the data source. When
the query is run, a sort defined in the "Query Panel" will affect the order and amount of data that is
retrieved from the data source.
2010-11-1673
Designing a query
You can sort locally, using Crystal Reports features which sorts all the data retrieved from the query.
Using the sorting option in the "Query Panel" is recommended to define your sort more efficiently since
it sorts the data from the data source.
5.2.4 Defining query filters and prompts
You can add filters and prompts to your query to limit the data shown in the report.
Note:
Filters and member selection allow you to sort your data in different ways. Member selection does not
have an effect on the measure value of your data. For example, if you select a single city or all the cities
for a country, the value for the measure for that country will not be affected by the member selection.
Filtering data does have an effect on the measure value. For example, if you filter your data for a
particular city, the value for the related country will be reduced to the value of that country.
5.2.4.1 Creating query filters
You can use the following types of filters in a query:
•Predefined filters
These filters are created by your administrator.
•Custom filters
You define these filters while you are creating the query.
•Prompts
Prompts are dynamic filters that you define to display a question or a list of values; users can select
different filter values each time they refresh the report.
5.2.4.1.1 To add a predefined filter to a query
1.
Double-click the objects you want to use in your report, or drag them to the "Result Objects" pane.
2.
Drag a predefined filter to the "Filters" pane.
Note:
Predefined filters are created and edited by your administrator. As a user of the "Query Panel", you
cannot view the component parts of predefined filters, neither can you edit them.
When you run the query, the data corresponding to the query filters you selected is returned to the
report.
2010-11-1674
Designing a query
5.2.4.1.2 To create a custom filter
1.
Select the object you want to filter and drag it to the "Filters" pane.
2.
Select an operator from the list.
3.
Select Constant, LOV (list of values), or Prompt.
4.
The value you enter depends on the option you selected in step 3:
DescriptionOption
Constant
LOV
•Type a value into the text box.
a.
In the "Prompt(s)" dialog box, add members to your list by double-clicking
them, or by selecting them in the "Members" pane and clicking the arrow
in the center.
b.
Click OK.
Prompt
a.
In the "Edit Prompt" dialog box, select "New Prompt" to add a new prompt,
or "Use Universe Parameters" to select a parameter from your universe.
b.
If you selected a "New Prompt", enter prompt options, or if you selected
"Use Universe Parameters", select a parameter.
c.
Click OK.
The filter is added to the report. You can edit or remove the filter in the "Query Panel".
Related Topics
• Quick reference to query filter operators
5.2.4.2 Building prompts
A prompt is a dynamic filter that displays a question every time you refresh the data in a report. You
respond to prompts by typing or selecting the values you want to view before you refresh the data.
Crystal Reports retrieves only the values you specified from the data source and returns those values
to the report.
Tip:
Prompts allow multiple users to view a single report but specify a different sub-set of the data source
information. Prompts also reduce the time it takes for the data to be retrieved from the data source.
5.2.4.2.1 To create a prompt
1.
Select the object you want to apply a prompt to and drag it to the "Filters" pane.
2010-11-1675
Designing a query
2.
3.
4.
5.
6.
7.
The prompt appears at each report refresh.
Related Topics
• Quick reference to query filter operators
For example, if you want to allow users to specify the geographical region for the report, drag the
Region object to the "Filters" pane.
Select an operator from the list.
Note:
You cannot use the following operators for prompts: Is null or Is not null.
Select Prompt.
In the "Edit Prompt" dialog box, select New Prompt.
Enter a prompt message in the "Prompt Text" box.
For example, you might ask "Which region do you want to see data for?"
Select "Select only from list" if you want your prompt to display a list of values from which users can
select values.
Click OK to confirm the prompt.
5.2.4.2.2 Combining query filters and prompts
You can apply multiple filters and prompts on a single query.
Quick reference to query filter operators
The following table will help you select the operator you need to define a query filter.
Values equal to a value
you specify.
Values different from a
value you specify.
Values greater than a
value you specify.
Values greater than or
equal to a value you
specify.
Retrieve data for the
US only.
Retrieve data for all
quarters except Q4.
Retrieve data for customers aged over 60.
Retrieve data for revenue starting from
$1.5M upward.
Not Equal to
Greater than
Greater than or equal
to
Filter createdSelectExampleValues to retrieve
<Country> Equal to USEqual to
<Quarter> Different
from Q4
<Customer Age>
Greater than 60
<Revenue> Greater
than or equal to
1500000
2010-11-1676
Designing a query
Filter createdSelectExampleValues to retrieve
Values lower than a
value you specify.
Values lower than or
equal to a value you
specify.
Values between two
values you specify that
includes those two values.
Values outside the
range of two values
you specify.
Values that are the
same as several values
you specify.
Retrieve data for exam
grades below 40.
Retrieve customers
whose age is 30 or
less.
Retrieve the weeks
starting at week 25 and
finishing at 36 (including week 25 and week
36).
Retrieve all the weeks
of the year, except for
weeks 25 through 36
(week 25 and week 36
are not included).
Retrieve data for only
the following countries:
the US, Japan, and the
UK.
Less than
Less than or equal to
Between
Not between
In list
<Exam Grade> Less
than 40
<Age> Less than or
equal to 30
<Weeks> Between 25
and 36
<Weeks> Not Between
25 and 36
<Country> In list 'US;
Japan; UK'
Values that are different from the multiple
values you specify.
Values for which there
is no value entered in
the data source.
Don't retrieve data for
the following countries:
the US, Japan, and the
UK.
Retrieve customers
without children (the
children column in the
data source has no data entry).
Not in list
<Country> Not in list
'US; Japan; UK'
<Children> Is nullIs null
2010-11-1677
Designing a query
Values for which a value was entered in the
data source.
Retrieve customers
with children (the children column in the data
source has a data entry).
Filter createdSelectExampleValues to retrieve
<Children> Is not NullIs not Null
Values that includes a
specific string.
Values that don't include a specific string.
Retrieve customers
whose date of birth is
1972.
Retrieve customers
whose date of birth is
not 1972.
Matches pattern
Different from pattern
<DOB> Matches pattern, '72'
<DOB> Different from
pattern, '72'
To combine filters and/or prompts
1.
Create each query filter and/or prompt.
By default, the "Query Panel" combines the filters and prompts with the And operator. You can leave
the And operator or change the operator to Or.
2.
If necessary, change the operator to Or by double-clicking the And operator.
The prompts appear when you click OK, or when you refresh the report data.
Using And or Or to combine query filters
This table explains the difference between the And and the Or operators.
Customers who ordered supplies in Q1 and in Q2 (the data
Data true for both filters.
you retrieve will include: customers who placed orders in
both Q1 and Q2).
SelectExampleRetrieve this data
And
2010-11-1678
Designing a query
Data true for any one of the filters.
5.2.5 Query panel functions
Customers who ordered supplies in: Q1 or Q2 (the data you
retrieve will include: customers
who placed orders in Q1only;
customers who placed orders
only in Q2, and; customers who
placed orders in both Q1 and
Q2).
SelectExampleRetrieve this data
Or
The Query Panel consists of the following elements:
Table 5-8: The Query Panel elements
"Universe" panel
"Combine Queries" panel
DescriptionQuery Panel element
This pane shows the available classes and objects, organized in a tree structure. Click a node
(+) to open a branch or hierarchy, click again on
the node to close or collapse the hierarchy. Select
the display mode (caption, technical name, or
both caption and technical name for each object).
You can search for objects in this panel by flicking
the Filter button and entering the search string.
To build a query, drag objects from this panel to
the "Result Objects" or "Query Filters" panel.
This panel only displays when you are combining
queries. When you click (Show/Hide) CombineQueries Panel, the panel shows the structure of
the queries you are combining. You can move
the query icons to reorganize the way that the
queries are combined. Click a query icon to display the query properties in the "Objects" and
"Filters" panels.
2010-11-1679
Designing a query
"Result Objects" panel
"Query Filters" panel
"Data Preview" panel
DescriptionQuery Panel element
Select the objects you want to include in the query
from the "Universe" panel and drag them into this
panel. These objects are returned as column
headers in the resulting report. When you place
hierarchical objects here, use the "Member Selector" tool to displays and select the members of
the hierarchy that you want to include in the query.
You can also select members that you want to
exclude from the query.
When you click (Show/Hide) Filter Panel, you
can drag objects into this panel to restrict the result data by limiting the query. For example, you
can limit the results returned to specific values or
value ranges.
When you click (Show/Hide) Data PreviewPanel, this panel allows you to test the results of
the query. You can preview the results that the
user will see, and modify the query and preview
the effects of the modification.
Use the query panel to create the following types of queries:
•Hierarchical queries for OLAP universes.
•Non-hierarchical queries for relational universes.
•Non-hierarchical queries for SAP BusinessObjects Enterprise XI 3.X universes.
The "Query Panel" also has the following buttons:
•Combine Queries shortcut button to combine queries for a relational universe.
•Query Properties to view and edit the query properties.
•View Script to view the structure of the query.
5.2.5.1 View script
Use the "View Script" button to view the query specifications. The query specification is viewable in an
xml format that shows the query design.
2010-11-1680
Designing a query
5.2.5.2 About copying query specifications
Use the "Copy query specifications in clipboard" button to copy your current query specifications in the
"Result Objects" panel to a clipboard. The clipboard is viewable in xml format in the "QuerySpec XML"
dialog box.
5.2.5.3 About pasting query specifications
Use the "Paste query specifications from clipboard" button to paste your copied query specifications
from the clipboard to the "Result Objects" panel. Query specifications can be executed without defining
any object in the Query Panel.
5.2.5.4 Editing an existing query
You can return to the "Query Panel" to edit an existing query. Queries can be edited by adding or
removing an object, or you can add, edit, or remove a filter.
5.2.5.4.1 To edit an existing query
Before the query can be edited, you must first log on to an SAP BusinessObjects Enterprise server.
1.
To edit your report query, click Data > Edit Query.
The "Query Panel" appears.
2.
In the "Query Panel", edit your query as necessary.
3.
When you have finished editing your query, click Finish.
Changes that you made in your query are reflected in your report.
Note:
If you remove objects from your query that you have used in your report, the objects will automatically
be removed from the report.
2010-11-1681
Designing a query
2010-11-1682
Verify data source on first refresh process
Verify data source on first refresh process
When you open a report, Crystal Reports automatically checks for changes in the metadata of the active
data source the first time you refresh your report data. Active data sources include universes and SAP
BEx queries.
If any changes in the metadata are detected, a dialog box will appear indicating that a change has been
made on the data source and the report must be updated. Changes to a data source could include any
of the following:
•Changes to properties or attributes of a result object, for example, the result object name.
•Changes to data types of the result objects in the data source.
•Changes to the number of inherited parameters in the data source.
Depending on the changes made to the data source, you may have to remap result objects and reformat
your report.
Note:
When the set of result objects are updated, any saved data will be discarded.
Example: A parameter has been added or removed to filter data from a data source:
A universe designer may choose to add an inherited parameter to a result object to ensure all reports
are run on time during peak report periods. "Crystal Reports" will detect this change to the number of
parameters in the source data. The inherited parameter will restrict the amount of available data in
each report by prompting users to specify information, such as by department, region, or sales quarter.
If the universe designer removes the inherited parameter from the data source, "Crystal Reports" will
detect this change, but the parameter will remain in the report. It will appear in the "Parameters" area
of the "Data Explorer" as a local parameter which you can delete.
In this case, once you have refreshed the result objects in your report, save the report so that you do
not need to verify the metadata again the next time you open it.
2010-11-1683
Verify data source on first refresh process
2010-11-1684
Report layout and formatting
Report layout and formatting
This chapter refers to changes you can make to the layout and design of a report, as well as the
appearance of text, objects, or entire report sections.
You can use formatting to do many things, including:
•Dividing a report into sections.
•Calling attention to certain data.
•Changing the presentation of dates, numbers, Boolean values, currency values, and text strings.
•Hiding unwanted sections.
•Giving the report a professional appearance.
The following topics describe the types of formatting you can do with Crystal Reports, giving step-by-step
instructions for performing a variety of formatting tasks.
7.1 Using the report design environment
7.1.1 Understanding section characteristics
A report consists of several sections, including the "Report Header", "Page Header", "Group Header",
"Body", "Group Footer", "Page Footer", and "Report Footer".
For more information about sections, see Structure mode areas.
7.1.2 Creating multiple-column reports
Instead of having the data in the "Body" section of your report print straight down the page, you can set
up multiple columns and have the data flow from column to column.
2010-11-1685
Report layout and formatting
7.1.2.1 To create a multiple-column report
1.
Open the report you want to format with multiple columns.
2.
Right-click in the "Body" heading area and click Format Body.
The Format dialog box appears.
3.
Select Multiple Columns.
4.
Set the Column Width for your column.
Keep in mind the width of your paper when deciding your column width. For example, if you have
three elements in your Body section, and they take up four inches of space, limit the width of the
column to under four and a half inches so that all the element information can be seen.
5.
Choose a Flow Direction for your data.
6.
If the report you're formatting contains grouping, select Multi-Column Groups.
7.
Set the Horizontal and Vertical gaps you want to maintain between each record in your column.
When you preview the report, you will see that the data appears in columns. If your report has element
headers, they appear only for the first column. To have element headers for the second column, insert
a text element in the Crystal Reports editor.
7.1.3 Using smart guidelines
Smart guidelines help you format report columns in the Crystal Reports designer canvas. The columns
and the objects within them can be moved and rearranged simultaneously as the smart guideline
calculate associated objects based upon similar alignment. The grids that appear on the report depend
on the element you have selected and the feature automatically selects related elements in the column.
The smart guidelines feature can be turned off in the "Report Options" dialog box. To deactivate the
feature without turning it off, press Alt.
Note:
Smart guidelines do not work with elements that are already formated, such as cross-tab elements.
7.1.3.1 To insert a column using smart guidelines
2010-11-1686
Report layout and formatting
Smart guidelines allow you to insert new result object columns without having to manually move the
surrounding columns over. If smart guidelines are disabled, the inserted result object will overlap the
existing result object.
1.
Select a result object from the "Data Explorer" side panel and drag the object to the report canvas.
2.
Align the result object frame in the desired column until the smart guideline grids appear to indicate
the column position and place the result object.
Note:
If you insert a column between two existing columns, the blue smart guideline grid will become a
dark blue to indicate the column will be positioned between the existing columns.
7.1.3.2 Adjusting columns using smart guidelines
You can reorder, remove, and resize columns using the column side cursors and handles on the top
of the report canvas. Smart guidelines allow you to delete and adjust columns without having to manually
move the surrounding columns over.
7.1.3.2.1 To adjust column width
1.
Click the column you want to adjust.
Smart guideline grids appear.
2.
Select the right side of the column until the pointer changes to an edge cursor.
3.
Click and drag the column width to decrease or increase the size.
7.1.3.2.2 To adjust column position
You can move a single column horizontally on the report canvas or multiple columns simultaneously.
1.
Click a column you want to move.
Smart guideline grids appear.
2.
Click the column handles on top of the report canvas and drag the column:
•To move a single column, drag the column to the left or right. Smart guidelines will adjust the
existing columns to accommodate the re-positioned column.
•To move multiple columns, use a single column to push the existing columns over, or use the
left side edge to drag a row of columns.
7.1.3.2.3 To swap columns using smart guidelines
1.
Double-click the column you want to swap to select it.
Smart guideline grids appear.
2.
Select the column handles on the top of the report canvas and drag the column to overlap the column
you want to swap and click to place the column.
2010-11-1687
Report layout and formatting
The column positions are swapped.
7.1.3.3 To create subcolumns using smart guidelines
You can create a subcolumn by using a spanning header element such as a box or text element that
spans two or more columns.
1.
Double-click a column you want to become a subcolumn.
Smart guideline grids appear.
2.
Click Insert > Box or Insert > Text.
3.
Place the element on the report canvas and drag the element frame to span two or more columns
you want joined.
The spanning header element becomes a single column containing subcolumns.
The subcolumns can be rearranged as a single column using the handles for the spanning header
column.
7.1.4 Hiding report sections
Crystal Reports has several properties that you can set to hide or suppress report sections.
7.1.4.1 Show on Drill Only
The "Show on Drill Only" property hides a section whenever you run the report. For example, in a
summary report, the "Show on Drill Only" property can be used to display only the summaries, but not
the details behind the summaries. When the "Show on Drill Only" property is applied to a section, it
becomes visible when the Drill-down cursor is used to drill down on the section contents. This property
is absolute; it cannot be conditionally applied using a formula.
7.1.4.2 Hide
2010-11-1688
Report layout and formatting
The "Hide" property also hides a section when you run the report. Unlike the "Show on Drill Only"
property, however, you cannot apply the "Hide" property, then drill down to reveal the section contents.
This property can be applied absolutely, or conditionally using a formula. This is useful for writing form
letters. For example, in a form letter, you might create two Body sections: one to hide when sales are
equal to or over $X and one to hide when sales are under $X.
7.1.5 Hiding report objects
Crystal Reports has several formatting properties for hiding individual objects.
7.1.5.1 Hide If Duplicated
The "Hide If Duplicated" property prevents an object value from printing if it is a duplicate of the value
that comes immediately before it in the same section.
The value does not print, but the space in which it would have printed remains.
Note:
This property does not work for text elements that contain embedded elements.
7.1.5.2 Hide If Zero
The "Hide If Zero" property prevents a value from printing if it is a zero value. The value does not print,
but the space in which it would have printed remains. To remove the blank space, the section must
have "Hide If Blank" set.
Note:
This will only work if there are no other elements in the section.
7.1.5.3 Hide
The "Hide" property hides an object when you run the report. For example, it is common to apply this
property to formulas that are needed to do some report calculations, but that you do not want to print
when you run the report. When you select this property, the selected element does not print.
2010-11-1689
Report layout and formatting
7.1.6 Creating a section underlay
You may want to create a section underlay to add an image of a pre-printed form to a report, or to add
a watermark to a report.
To create the underlay, you first add a picture or watermark to your report and then you reset the
formatting so that the element underlays the report data.
7.1.6.1 To insert a picture onto the report
1.
Click Insert > Picture.
2.
Select an image file, and then place it in the "Page Header" section, to the right of the objects in the
report body.
Note:
The picture is placed to the right of the objects to avoid underlaying the text. When you are working
with a watermark (a subdued picture designed to be nearly invisible) place it directly above the text.
7.1.6.2 To make the picture underlay the following section
1.
Right-click in the "Page Header" area of the report canvas and click Format Section.
2.
Click Underlay Following Sections.
When you preview your report, you will see that the picture prints in both the first "Group Header"
and the following few "Body" sections, next to (instead of above) the text in the body of the report.
Note:
Using the technique of placing a picture to the right of the body of the report, you can set up a chart
or an employee picture to print beside the details pertaining to that chart or employee.
3.
In the Crystal Reports"Structure" mode, resize the picture vertically to make it two or three times
larger, then preview the report again.
The image file now underlays more sections.
The area in which the picture underlays depends on the following conditions:
•The size of the picture.
•The section in which the picture was originally placed.
2010-11-1690
Report layout and formatting
•The position of the picture in the section.
By modifying size and placement of an element, you can create a variety of visual effects, using the
underlay feature.
7.1.7 Using pre-printed forms
You can use the section underlay feature to create a Crystal Reports report that merges an image of
a pre-printed form with your report data as a single, merged unit.
7.1.7.1 To create a report that includes a pre-printed form.
1.
Scan a form.
2.
Place it in the report as a bitmap.
3.
Use the underlay feature to line up the bitmap and report data.
7.1.8 Preventing the truncation of text inside an element
Whether you accept the default widths of text-based elements or you resize them, a problem could
arise if the text inside the element prints right to the edge of the element frame. While the report may
look fine on the machine it was designed on, when the report is printed using another printer driver that
measures the font wider, the length of the text grows, but the element frame remains fixed. The resulting
text is cut-off or truncated.
7.1.8.1 To prevent the truncation of text inside an element
1.
Right-click the text element that you want to format and select Format Text.
2.
In the Format dialog box, click the "General" node.
3.
Select Can Grow.
The element is now formatted to print on multiple lines. If the text prints wider than the element, the
text wraps onto additional lines.
2010-11-1691
Report layout and formatting
7.1.9 Hiding blank lines in embedded objects
Because you can embed objects in text elements, you might encounter cases where an empty object
causes a blank line in a text element. You can hide blank instances of such embedded objects.
Note:
The hiding of embedded objects blank lines is designed to remove blank lines within a text element if
the text element contains an entirely blank object alone on a line followed by a carriage return.
7.1.9.1 To hide blank lines in embedded objects
1.
In the "Structure" mode, right-click the desired text element and click Format Text.
2.
In the Format dialog box, select General and then select Hide Blank Lines Caused By Empty
Objects.
Now, when the report prints, unwanted blank lines will no longer appear in place of empty embedded
objects. You can confirm your changes in the "Page" mode.
7.1.10 Placing multi-line, text-based elements
While text-based elements that are formatted to print on multiple lines follow the same design rules as
other elements, they have one additional characteristic to be considered. If the printer driver expands
or contracts the spacing of the text, word wrapping may differ, changing the number of lines necessary
to print the element in order to accommodate growth or shrinkage.
When placing multi-line text-based elements, you could encounter problems if other elements in the
same section are placed directly below them.
Unlike single-line text-based elements, expanding the element frame of a multi-line text-based element
to accommodate growth is not a viable option. When you do this, the line width increases according to
the expanded boundaries.
So, when possible, place multi-line text-based elements at the bottom of a section. If they require more
lines to print, the section expands downward to accommodate the growth, so that the expanded elements
do not overwrite other elements.
2010-11-1692
Report layout and formatting
7.1.11 Indenting lines
Using Crystal Reports, you can control line indentation for memo objects, string objects, and text
elements.
Note:
Only indentation values within the range of the object or text element width are accepted. An error
message appears on the bottom of the view when you enter an incorrect value.
7.1.11.1 To indent lines for a data element
1.
Right-click the element to be formatted and click Format Result Object Element.
2.
In the Format dialog box, select Paragraph.
3.
Set your preferred indent options.
7.1.11.2 To indent lines for a text element
1.
Right-click the text element to be formatted and click Format Text.
2.
In the Format dialog box, select Paragraph.
3.
Set your preferred indent options.
7.1.12 Allowing for overflow object representation
Crystal Reports lets you use overflow object representation to assist users who are working with numeric
or currency values in report cells. When the "Allow Object Clipping" option is not selected,
numeric/currency object values that exceed the object size are represented by number signs (######)
when you preview the report, letting you know immediately when the object is too small.
Otherwise, if a numeric or currency value is larger than the object containing it, that value is truncated,
or "clipped." For example, values like 100,000,000 might appear on the report as 1,000, or as 000
(depending on the properties you have set). This could potentially cause confusion when the report is
read.
2010-11-1693
Report layout and formatting
7.1.12.1 To allow for overflow object representation
1.
Right-click the currency object or number object that you want to format and click Format Result
Object Element.
2.
In the Format dialog box, expand "Format" and then select Number.
3.
Ensure that Allow Object Clipping is not selected.
7.1.13 Selecting multiple elements
You can select multiple elements, including text, object, chart, bitmap, and cross-tab elements, to format
them together.
Once you have selected multiple elements, you can move, align, size, and delete them as a group. You
can also change any common properties for these elements and have the changes apply to all elements.
Elements are moved, aligned, and sized based on a main element, which is the last element you select.
7.1.13.1 To select multiple elements
1.
Click an element and Shift + click or Ctrl + click the other elements you want to select.
2.
Right-click the main element and click Format Elements.
3.
In the Format dialog box, set your new formatting options.
7.1.14 Understanding text rotation
In the Format dialog box, you can use the text rotation properties to rotate text so that it reads vertically.
When you select a text rotation of 90 degrees, the text shifts 90 degrees in a counter-clockwise direction.
When you select a text rotation of 270 degrees, the text shifts 270 degrees in a counter-clockwise
direction.
2010-11-1694
Report layout and formatting
Note:
•If text rotation is left at 0 degrees, your text is oriented horizontally, left to right.
•Rotated text that spans over the edge of the page cannot be displayed as part of your report.
•Rotated text cannot be rendered by the DHTML viewers, so be sure to preview your report in the
desired viewer before you deploy it.
7.1.14.1 To rotate text
1.
Right-click the element that you want to rotate and click Format <element>.
<element> is the name of the element. For example, "Format Result Object Element", "Format
Text", and so on.
2.
In the Format dialog box, select Font.
3.
Change the "Rotation" to either 90 degrees or 270 degrees.
7.1.15 Modifying line spacing
With Crystal Reports, you can specify the amount of space between lines for memo objects, string
objects, and text-based elements.
7.1.15.1 To modify line spacing
1.
Right-click the object or element that you want to format and select Format <element>.
<element> is the name of the element. For example, "Format Result Object Element", "Format
Text", and so on.
2.
In the Format dialog box, select Paragraph.
3.
Enter a number for the "Spacing" value.
•If you chose "Multiple", the number you enter is multiplied by the font size of your text, and the
program inserts the result as line spacing.
•If you chose "Exact", the number you enter is the exact number of points that the program inserts
for line spacing.
2010-11-1695
Report layout and formatting
7.1.16 Setting page size and page orientation
Crystal Reports allows you to view and print your reports in a variety of page sizes using either portrait
or landscape orientation.
•All margins are calculated from the paper edge. Thus, a left margin of .25 inches causes the printing
to start exactly one quarter inch in from the edge of the paper.
•Select Adjust Margins Automatically if you want Crystal Reports to adjust the report's margins
automatically the next time you change the page size. If you choose a new page size that is large
enough for the current printable area, Crystal Reports increases or decreases the margins by
enlarging or reducing the left/right and top/bottom margins by the same factor. If you choose a new
2010-11-1696
Report layout and formatting
page size that is smaller than the current printable area, Crystal Reports fills the entire page by
reducing the margins to 0. If you next choose a bigger page, this (reduced) printable area is kept
and the left/right, top/bottom margin ratios become 1:1.
•Page margins can also be controlled by use of conditional formulas.
Related Topics
• Changing margins conditionally
7.1.18 Setting custom page size
If you are designing a report for the web, you may want to set a page size that does not correspond
with standard printing paper sizes. Crystal Reports allows you to set a custom page size using the
"Page Setup" dialog box.
Adjust the width and height of the page by entering new values in the appropriate text boxes.
4.
Click OK.
7.1.19 Using TrueType fonts
Designing your report with printer-specific fonts can lead to problems when using different printers. The
fonts may not be supported by other printers or they may not be installed on the printers.
During the printing process, if you encounter printer-specific fonts that are unrecognizable to the printer
driver, Crystal Reports substitutes the fonts, creating inconsistent results. To avoid this situation, only
common TrueType fonts should be used when designing reports.
2010-11-1697
Report layout and formatting
7.1.20 Using date formats on a Japanese system
There are many date formats you can choose to use on an English report, but if you send the report to
a Japanese system, there may be some formatting irregularities. Not all English date formats are
viewable on a Japanese system, and the same is true going from Japanese to English. For instance,
abbreviated English months do not appear on a Japanese system and Japanese eras in short format
do not appear on an English system.
7.2 Formatting properties
You can set formatting properties in Crystal Reports. In most cases, you can set one of two types of
properties:
•Absolute (always apply the property).
•Conditional (apply the property only if certain criteria are met).
Related Topics
• Working with absolute formatting
• Working with conditional formatting
7.2.1 Working with absolute formatting
Absolute formatting is formatting that applies under any condition. This type of formatting property
always follows a "select, then apply" procedure. For example, you select what it is that you want to
format (object or section), then you apply the formatting to the selection using property settings.
7.2.1.1 Adding borders, color, and shading to an object
Crystal Reports allows you to add borders, color, and shading to objects on your report in order to
emphasize important data and create professional-looking reports.
2010-11-1698
Report layout and formatting
7.2.1.1.1 To add borders, color, and shading to an object
1.
Right-click the object or element that you want to format and click Format <element>.
2.
In the Format dialog box, click Appearance.
3.
Set the desired appearance values.
For example, to add a border around an object, go to the "Border" section and set the properties for
top, bottom, right, and left.
7.2.1.2 Adding and editing lines
Crystal Reports allows you to add lines to a report to emphasize important data and create
professional-looking reports. Lines can run horizontally or vertically. For a vertical line to be broken
across several pages, the report section that the line ends in must not be on the same page that it starts
on. For example, if a line runs from a group header to the corresponding group footer, the line continues
on the top of each subsequent page—just below the page header—until the group footer is encountered.
7.2.1.2.1 To add lines to a report
1.
Click Insert > Line.
2.
Use the cursor to draw the line where you want it to appear.
Note:
You cannot draw diagonal lines.
7.2.1.2.2 To edit lines on a report
1.
Right-click the line that you want to format and click Format Line.
2.
In the Format dialog box, change the "General" or "Appearance" options for the line.
3.
When you are finished, click Close.
7.2.1.3 Adding and editing boxes
Crystal Reports allows you to add boxes to a report to emphasize important data and create
professional-looking reports.
7.2.1.3.1 To add boxes to a report
1.
Click Insert > Box.
2.
Use the cursor to place the box where you want it to appear.
2010-11-1699
Report layout and formatting
7.2.1.3.2 To edit boxes on a report
1.
Right-click the box that you want to format and click Format Line.
2.
In the Format dialog box, change the "General" or "Appearance" options for the box.
3.
When you are finished, click Close.
7.2.1.4 Adding shapes to a report
When designing report formats in Crystal Reports, you can insert a variety of shapes such as circles,
ellipses, and boxes with rounded corners, as part of your report. This is especially useful for formatting
reports in languages that require these shapes to effectively communicate.
7.2.1.4.1 To add shapes to a report
1.
Add a box to your report.
For more information, see Adding and editing boxes.
2.
Right-click the box that you want to format and click Format Line.
3.
Click the "Appearance" node.
4.
Set "Corner Rounding" to a number between 0 and 100.
The box that you started with gradually changes to an ellipse or circle, depending on how large a
number you enter.
Note:
If you have specified rounding for a box, you cannot use the Drop Shadow property. If you select
this property, Crystal Reports resets Corner Rounding to 0.
7.2.1.5 Using conventional accounting formats
As a way of supporting the conventions used in the accounting profession, Crystal Reports lets you
decide on how to display the currency symbol, negative values, and zero values on your financial
reports. You can also set up your report to reverse the signs for credit and debit amounts.
7.2.1.5.1 To use accounting conventions in a report
1.
Right-click the currency object or number object that you want to format and click Format Result
Object Element.
The Format dialog box appears.
2.
Expand the "Format" node.
2010-11-16100
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.