navigate site menu

Start learning with our library of video tutorials taught by experts. Get started

Crystal Reports 2011 Essential Training
Richard Downs

Crystal Reports 2011 Essential Training

with Curt Frye

 


This course shows business analysts how to use SAP Crystal Reports 2011 to analyze and summarize data to make better decisions. Author Curt Frye teaches how to maximize the power of Crystal Reports and import and analyze data from a variety of places, including Excel, Access, HTML/XML files, and more. The course also shows you how to define and manage reports, summarize data, visualize data using charts, focus analysis by selecting which data a report summarizes, export report data, and connect to external data sources.
Topics include:
  • Navigating within a report
  • Creating a report
  • Linking to a data source
  • Adding fields to a report
  • Creating sections in a report
  • Sorting, grouping, and summarizing data
  • Applying a template
  • Applying formats to date fields and other report controls
  • Managing images and drawing objects
  • Creating charts
  • Selecting records
  • Using formulas
  • Adding subreports
  • Working with cross-tabs
  • Exporting report data

show more

author
Curt Frye
subject
Business, Charts + Graphs, Data Analysis
software
Crystal Reports 2011
level
Beginner
duration
3h 25m
released
May 31, 2012

Share this course

Ready to join? get started


Keep up with news, tips, and latest courses.

submit Course details submit clicked more info

Please wait...

Search the closed captioning text for this course by entering the keyword you’d like to search, or browse the closed captioning text by selecting the chapter name below and choosing the video title you’d like to review.



Introduction
Welcome
00:04Hi, I am Curt Frye.
00:06Welcome to Crystal Reports 2011, Essential Training.
00:08In this course, I'll show you around the Crystal Reports user interface, describe how you can
00:13set program and report options, and get help using the program.
00:18Next, I'll show you how to create reports using the Design Wizard and also by linking
00:23to one or more data sources.
00:24I will then move on to sorting and grouping your data, show you how to change group options,
00:31and to summarize your data using statistical summaries.
00:34After that, I'll show you how to create and manage report sections, change the section
00:39order, and delete any sections you no longer need.
00:43My next chapter covers formatting, whether by applying a report template, formatting
00:47individual report controls or by highlighting records.
00:51The remainder of the course shows you how to summarize your data using charts, to focus
00:55on subsets of your data by selecting records using parameter fields, and by displaying data
01:01in subreports and crosstabs.
01:03Regardless of how you use Crystal Reports, the techniques in this course will help you
01:07analyze your data effectively.
01:12
Collapse this transcript
Using the exercise files
00:00If you are a Premium member of the lynda.com online training library, or if you are watching
00:06this tutorial on the DVD-ROM, you have access to the exercise files used throughout the
00:10course. When I downloaded the files, I put them on my desktop in a folder called Exercise
00:17Files and inside the Exercise Files folder, I have the files laid out by the chapter where I use them.
00:24So for example, in Chapter_03 if I double- click to open it, I see a list of all the reports
00:30that I used there. Some of the folders also contain the data sources that I used to create
00:35the reports and if you go back to the main Exercise Files folder, you will find at the
00:41bottom, a folder named Data Sources. So, if you want to look at the data I used in more
00:46detail or create your own reports using it, feel free to do so.
00:51If you are a Monthly member or an Annual member of lynda.com, you don't have access to the
00:56exercise files, but you can follow along from scratch with your own assets.
01:01
Collapse this transcript
1. Getting to Know Crystal Reports 2011
Exploring the Crystal Reports user interface
00:00If you've used other Windows applications, especially the Office 2003 line of products,
00:06then you'll be familiar with the interface style of Crystal Reports 2011. In this movie,
00:11I will run you through the user interface and will show you where to find the tools
00:14that you need to succeed.
00:16When you run the program, Crystal Reports displays the Start page where you can start
00:21a new report or open a recent report. In this case, I am going to open the FirstLook report,
00:28which I worked with earlier. This report probably won't appear in your version of the
00:33program because you haven't opened that report before, but don't worry; you don't need to
00:37have it open to follow along with this movie.
00:39The Crystal Reports user interface is the same as the user interface based in Office
00:462003, that is, it uses a menus-and-toolbar model. So at the top, you have the menu bar with
00:54the series of menus from which you can select commands and then below that you have a series of toolbars.
01:01There are five toolbars available to you and if you want to see which are currently displayed,
01:07you can right-click in the open spot on the toolbar and that lists the toolbars that are
01:13available to you. Any toolbar that is displayed with a check mark next to it is currently
01:18displayed, and I will show you how to hide those toolbars and bring them back in a later
01:23movie on working with the user interface. So now, I will just left-click off to the
01:27side to get rid of that shortcut menu.
01:30Below the toolbars, you will see a couple of tabs. The first is a tab for your open
01:36report, in this case FirstLook, and the other is for the Start page. So if we click the
01:40Start Page tab, you get back to the Start page and then if you want to switch back to
01:45your report, you can just click the FirstLook tab and you can go back. If you want to get
01:51information about any of the toolbar buttons, you can hover your mouse pointer over top
01:55of it. For example, if I hover the mouse pointer over the binocular icon at the top of the
02:00first toolbar, we will see that that's the Find button, and you will see that it displays
02:05the name and also the keyboard shortcut.
02:08So in Crystal Reports 2011, you can get at most commands in one of three ways, either
02:13by using the menus, by using the toolbar buttons, or by use keyboard shortcuts. It all depends
02:19on your preference and how you like to work inside the program.
02:22The final two things I would like to point out are at the right side of the program window,
02:26and those are the Field Explorer and the Report Explorer. They appear in the same task pane
02:32here on the right side. Currently, I have the Field Explorer displayed. If you want
02:37to switch over to the Report Explorer, you can go down to the bottom of the task pane
02:42and click that tab and it appears.
02:44I'll show you how to use the Field Explorer and the Report Explorer in many more movies
02:49throughout this course. You will go back to that side a lot. So those were the basics
02:53of the Crystal Reports 2011 user interface. If you need to get help on anything, you can
02:58use the steps in the movie on getting help that I will present later in this chapter.
03:03
Collapse this transcript
Setting program options
00:00After you use Crystal Reports 2011 for a while, you might want to change some of the program's
00:05default behaviors.
00:07If that's the case, you can do so by changing the report's options.
00:11In this movie, I am working with the FirstLook report, but you can work with any report that
00:16you have, or even a blank report.
00:19To change your program options, you can go under the File menu and click Options.
00:25Doing so displays the Options dialog box.
00:28All of the options that I am going to describe in this movie are available on the Layout tab.
00:32I will actually start in the second group, which is with Snap To Grid.
00:37When you have the Snap To Grid option turned on, any objects such as shapes or headers
00:43within the body of a report will move, but they will only more according to points on
00:48a grid that are defined in the Grid Size value.
00:52In this case, they are about 0.083 inches.
00:55So, a very small grid, but even so, you don't have the full range of motion that would be
01:00available if Snap To Grid were turned off.
01:04Anytime I have Snap To Grid turned on--and I usually do leave it on just because it makes
01:09aligning my elements easier--then I always display the grid in Design view.
01:15Doing so allows me to see where objects will go instead of just relying on the grid and
01:20assuming that I have them lined up when in fact I might not.
01:24You can also turn on the grid in Preview.
01:28Turning on the grid in Preview lets you visually assess where items will appear when you print
01:33your report, and you can also make sure that everything is lined up before you commit to printing.
01:38Now, if you do want more fine-grain control--that is, if control at the level of 0.
01:43083 of an inch isn't enough, and for some chronic reports I can certainly see where that would
01:47happen--then you can turn Snap To Grid off entirely by clearing that checkbox.
01:54Another thing that I do is turn on the rulers in Preview.
01:59Checking that box displays rulers at the top and along the left side of the report when
02:05you're viewing it in Preview before printing.
02:08That's a personal preference, and all of these options are completely up to you.
02:13That's just the way that I like to do it.
02:14And like I said, there are lot more options available to you than the ones I have had
02:19time to discuss in this movie.
02:21If you want to save the changes to the program options, you can do so by clicking OK.
02:26If you want to undo them, you can click Cancel. And I will go ahead and click Cancel so I
02:30don't make any changes to the current state of the program.
02:34Now, there are a lot more options available to you than the ones I have had time to discuss in this movie.
02:39If you see an option that you think you might want to change, go ahead and do it; you can
02:43always change it back.
02:48
Collapse this transcript
Setting report options
00:00In much the same way that you can set the Crystal Reports 2011 program options, you
00:05can set the options for individual reports.
00:07In this movie, I'll show you how to change the settings so your reports behave in a way
00:12that makes it easier for you to work with them.
00:14For this movie, I will use the FirstLook report, but you can use any reports that you happen
00:20to have opened, even if you create a blank report.
00:23To set a program's options, click the File menu and then click Report Options.
00:30Doing so displays the Report Options dialog box.
00:33I'd leave the settings in the first column alone.
00:35I find that they work just fine for me the way they are.
00:39In the second column, there is a default setting to save the data with the report.
00:44That's here at the top.
00:46That works well if you are summarizing relatively small data sets.
00:50On the other hand, if you are using Crystal Reports to summarize a large data set or sensitive
00:54data you don't want getting around, you should clear the check box so the data is not included with the report.
01:00Depending on your report structure, you might not want to print sections that don't contain any records.
01:06For example, you might want to know that there were sales in Colorado and Oregon, but you
01:10might not care that there were no sales to customers in California.
01:14If you don't need to know which groups contain no data, you can check the Suppress Printing
01:18If No Records checkbox.
01:21When you refresh your report's data, Crystal Reports displays an alert box telling you what it's doing.
01:26If you don't think you need that reminder, you can uncheck the Display Alerts on Refresh
01:31box, which is here, fifth in line in the second column. And finally, if you create reports
01:37you don't want your colleagues to be able to edit, you can check the Read-only box, which is here.
01:43You can save your changes by clicking OK or you can cancel out of them and not have those
01:48changes take effect by clicking Cancel.
01:52Just as with the program options settings, there are a lot more report options then I've
01:55had time to discuss.
01:57If you want to change one, go ahead and, as always, you can change it back.
02:02
Collapse this transcript
Assigning report properties
00:00When you create a report the data inside of the report and also the field headers give
00:05you a lot of information about it.
00:07That said, if you want to be able to search for the report easily on a server, such as
00:11a SharePoint Server, then you can add properties to the report.
00:16In this movie, I'm going to use the FirstLook report, which you can download from the Exercise
00:21Files folder, but you can use any report you like or just create a blank report.
00:26To add values to report properties, open the File menu and then click Summary Info. Doing
00:32so displays the Document Properties dialog box.
00:35You can use the controls inside the dialog box to add values such as author, keywords,
00:39comments, and so on, and I'll just fill in a few of them.
00:42So, for example, for the Author, I'll type in my name, Curt Frye, and then press Tab to
00:48move to the next field, and here you can add keywords.
00:51Keywords describe what is contained inside of your report and they can be used as search
00:56criteria on the server.
00:58So for example, this report deals with call data, so I might say "call," "data," and then have "center."
01:07You can also add any comments,
01:08so, for example, "Created in response to VP request" and anything else that provides supplemental
01:17information about this report.
01:19If you wanted to add a title which would appear in the report, then you can type "Call Data
01:24for Each Center" and do the same thing for your Subject, if there are any templates applied and so on.
01:32If you want information about the reports, such as when it was created, when it was last
01:36edited, and so on, you can find that on the Statistics tab.
01:39So, it shows you the number of times this has been revised, the length of time it's
01:44been edited, when it was last printed, created, last saved, and so on.
01:49If you want to save your changes, you can click OK, or if you don't, you can click Cancel.
01:55As I said before, the main reason that you add property values to a report is so you can
01:59find it in the SharePoint search or by searching on some other server.
02:03The server software can then use these field settings to help you look for the documents
02:07that you need.
02:12
Collapse this transcript
Navigating within a report
00:00If you work with a data set of any size, it's likely that the report summarizing your
00:04data will span more than one page.
00:07It's not immediately obvious how to navigate within your report, but once you know where
00:11to look, the controls are intuitive and easy to use.
00:14To move around within a report, you can use the tools on the navigation toolbar. And I'll
00:19point that out to you. It's here on the toolbar area and it is in the bottom-right corner
00:24by default. So it has the Refresh button, Stop, and other controls that are exactly the
00:31same as the controls that you'd use in PowerPoint to move among slides.
00:36So, for example, I'm on page 1 of 2.
00:40If I want to move to the next page, I can click the Show Next Page button, and that displays
00:46Page 2 of the report.
00:48If I want to go back, click Show Previous Page, and the other two buttons on this little
00:54portion of the toolbar allow you to show the last page. In this case it's Page 2 again,
00:59because it's only a two-page report. Or you can also go to the first page by clicking the
01:04Show First Page button.
01:06If you know the page that you want to go to within a report, you can type that value here
01:11in the Page Selector box. So just click there and you can type in the number. In this case,
01:16to show the change, I'll type in the number 2 to move to page 2 and press Enter.
01:21The two controls on this navigation toolbar that I haven't talked about yet are the Refresh
01:25button and the Stop button, and they work together.
01:29If the file supplying data for your report has changed or might have changed, you can update
01:33your report to reflect that change by clicking the Refresh button, or you can press F5.
01:39If the refresh is taking a long time, then you can click the Stop button.
01:43When it's activated, it will display in red, and then Crystal Reports will stop trying
01:49to update the data and you can continue to work with the data that was in place before
01:53you clicked the Refresh button.
01:55Navigating within a report should be pretty familiar if you've used other Windows programs.
02:00The techniques in this movie give you everything you need to know about navigating within your report.
02:09
Collapse this transcript
Adding page numbers and printing
00:00When you've created the report that you want and have populated it with the data that you
00:04want to display, you can print the report.
00:07If you're printing on paper, you should strongly consider adding page numbers.
00:12There is a very little worse than dropping a pile of unnumbered pages and trying to put
00:15them back in order.
00:17The first thing you need to do is to switch over to Design view.
00:21To do that, you click the Design view tab at the left side of the program window.
00:26Once you're in Design view, you can go down to the page footer, which is all the way at
00:30the bottom, and there you will see that there is a Page Number control already in place.
00:35What I want to show you how to do is to change that field to another field that reads "Page Number N of M."
00:42So, for example, if you had a ten-page report and you were printing out page five, it would say "Page 5 of 10."
00:49To do that, hover the mouse pointer over the Page Number control, click it to select it,
00:55and then press the Delete key; doing so deletes the control.
00:59Now you can add the Page N of M special field.
01:04To do that you'll work in the Field Explorer, which is here on the right side of the program interface.
01:10If the Field Explorer doesn't appear, then you can go up to the top tab bar and click
01:15the Field Explorer button to bring it back.
01:18Once the Field Explorer is open, you can click the expand control next to the Special Fields list.
01:24Now from within the list of special fields that appears, you can drag Page N of M to
01:30the Page Footer area of the report, so just click and drag and put Page N of M in the
01:38Page Footer area.
01:39Now if you switch back to Preview, which you can do by clicking the Preview view tab, and
01:46if you scroll down to the bottom of the report, you'll see that it says Page 1 of 2.
01:51Then if you navigate to Page 2, by clicking the Show Next Page button on the navigation
01:56toolbar, it displays Page 2 of 2.
02:01Now that you have page numbers in place, you can print out your report.
02:05To do that, go up to the File menu and click Print.
02:09If you like, you can also press Ctrl+P.
02:12The Print Setup dialog box is very similar to pretty much every other print dialog box
02:16that you'll see in Windows programs.
02:19You can change your printer, for example, by clicking the Name button and then selecting
02:27any printer that appears. You can change your page range, printer paper size, anything else.
02:33If you've made the change, you can click the Apply button to apply it and then when you're
02:37ready, you can click Print to make a paper copy or PDF of your report.
02:44If you don't want to print, you can click Cancel.
02:49
Collapse this transcript
Changing page layout
00:00When you are preparing a Crystal Reports report for printing, you should pay attention to
00:06your page layout to make sure that your report will look its best when you do print it out.
00:11In this movie, I will show you how to change your Page Layout settings so that you can
00:16make that happen.
00:17Taking a quick look at this report, if you look here, about two thirds of the way over
00:23on screen, you'll see a vertical line.
00:27That vertical line indicates that there is a page break. So, when I print this report,
00:32everything for California, Colorado, and Idaho will appear on one page and the entries for
00:37Oregon and Washington will appear on the second page.
00:40I really want all that information to be printed on the same page, so I can change the report's
00:46Page Layout to make that happen.
00:49To change report's Page Layout, click File, and then click Page Setup.
00:55In the Page Setup dialog box, you can select a number of options.
00:59If you never plan on printing out your file, even as a PDF, then you can check the No Printer box.
01:07In most cases, though, you'll probably make a printed copy, or at least a PDF or a web
01:12file, so the next thing you can do is select the printer that you want to send it to, Adobe
01:19PDF or whatever printers are available on your network.
01:22I'll just leave it on PDF for now.
01:24You can also, if you want, select from a large number of preset page sizes, so right now
01:30we have Letter, which in the U.S. is 8.5 inches x 11 inches
01:34but there are many, many, many other options that you can select
01:37from if you want.
01:39You can also type in your own horizontal and vertical values if you want, Horizontal being
01:45width and Vertical being height.
01:47Down toward the bottom of the dialog box, you can set the Margin values. This is the amount
01:52of white space that is left right above and below the data that appears on the page.
01:58A quarter of an inch is a very narrow margin, half of an inch,
02:02.5, is much more common, but do you need to do to make your data fit.
02:07The last option I'll describe--and this is one that I'll change--is Orientation, for Portrait
02:13versus Landscape.
02:15Portrait orientation has the short side on the top and bottom and the long side to the
02:21left and right; if you select the Landscape option, that's reversed:
02:26now the vertical sides are shorter and the horizontal sides are larger.
02:30So now when I click OK all of my data in this report will be printed on one page. The page
02:36break indicator doesn't appear because everything will be printed on a single page.
02:41Using Page Setup to change your report's page layout is a very powerful tool.
02:46It seems simple, but you shouldn't overlook it.
02:51
Collapse this transcript
Getting help in Crystal Reports 2011
00:00Crystal Reports 2011 is a large and very powerful program.
00:05Even if you work with it for a while, you might not find out everything that you want
00:08about the program.
00:09For example, there might be some toolbar controls that you haven't used, so you don't know what
00:14they are good for.
00:15In this movie, I will show you how to get help within the Crystal Reports program so
00:19you can find out everything that it can do.
00:22The first way that I will show you to get help in Crystal Reports 2011 is by opening
00:26the main Help interface.
00:28To do that, click the Help menu and then click SAP Crystal Reports Help.
00:35You can also press F1 if you prefer to use keyboard shortcuts.
00:39The Help system inside of Crystal Reports is probably familiar to you if you have used
00:43other Windows Programs.
00:45You have Contents, where you can click expand controls to display all of the Help files
00:50available under particular section.
00:53You can also go to the index, which shows a list of all the terms that are available
00:58for you to get help on. You can also search and you can add favorites
01:03so that you can go back to Help files that you use a lot.
01:06I will just close out of that.
01:09You can also get help for any toolbar controls by using what is called contextual help.
01:14To do that, hold down the Shift key and press F1.
01:18When you do, the mouse pointer changes from an upward-pointing arrow to an upward-pointing
01:23arrow with a question mark to the right of it; that means that the program that will
01:28give you help on the next item that you click.
01:31So let's say that you did not know what this Binocular tool did here on the top toolbar.
01:37If you click it, Crystal Reports displays the Help file for the toolbar button, and in
01:43this case it is the Find command, which allows you to look for particular values in a field within a report.
01:50If you click something that doesn't have a Help file available for it, say for example
01:54the Field Explorer header, which I can do by pressing Shift+F1 again, the mouse pointer
02:00changes to the Help pointer with the question mark to the right of the pointer, then click
02:06Field Explorer which does not have a help file associated with it. If that happens,
02:10Crystal Reports displays the main Help page.
02:13Crystal Reports gives you a lot of ways to get help within the program.
02:17Getting contextual help by pressing Shift+F1 and clicking a toolbar button is a very quick
02:22way to learn how one of those tools works.
02:27
Collapse this transcript
2. Creating a Report
Using the Standard Report Creation Wizard
00:00When you create a report in Crystal Reports 2011, you have a number of options.
00:05You can work with a blank report, make a connection to a data source, and then add the fields by
00:11hand, or you can use one of a variety of wizards.
00:15In this case, I want to use the Standard Report Wizard, which I can start from the Start page
00:21by clicking Report Wizard.
00:24Then, in the Standard Report Creation Wizard dialog box, I can create a new connection
00:30by clicking the expand control next to Create New Connection, and then I can identify the
00:36type of data source that I want to use.
00:38In this case that is an Excel workbook, so I will click the expand control next to Access/Excel.
00:46Then in the Access/Excel dialog box I can identify the database type.
00:51It comes up as Access by default, but we want to use Excel.
00:55So, I will click the Database type control and select Excel 8.0 from the list.
01:02You might be wondering what all those different versions of Excel mean.
01:06Well, Excel uses different file types depending upon the version that you are using.
01:11For example, in Excel 2007 and 2010, Microsoft changed to a new file type, the .xlsx file type.
01:19In previous versions from Excel 97 to Excel 2003, they used the .xls file type.
01:27The earliest of those versions, Excel 97, was referred to as Excel 8.0
01:31internally within Microsoft and that's why you see Excel 8.0
01:35in this list instead of Excel 97.
01:38What this means is that you can't use Excel 2007 and Excel 2010 files in Crystal Reports,
01:46or at least you can't import them.
01:48Instead, what you need to do is to save those files as Excel 2003 files by using the Save
01:54As controls within Excel.
01:57Now that I have identified the database type, I can identify the specific file that I want to use.
02:02To do that, I click the Browse button next to Database Name, and doing so will display
02:08a folder navigation suite that I can use to pick the file I want.
02:11I will go ahead and do that,
02:12and now I can click the file from which I want to import the data, and that is the CallData
02:19file, and then click Open.
02:21The full path of the file appears in the Database Name field, and I can click Finish.
02:26Now, in the Available Data Sources list, I can click the worksheet that I want to add
02:31from the file that I just added.
02:34So in this case that is Sheet 1, and I can tell it's the one that I want because the
02:38link to the file that I identified earlier appears above it.
02:42And then I can click the Add button. Doing so puts the table that I identified, Sheet
02:481, inside this Selected Tables list.
02:50Now I can click Next and identify the fields that I want to display.
02:55In this case, I want to display all of them-- Year, Quarter, Center, and Calls--so I'll click
03:00the Add All button, then click Next.
03:04Now I can identify the fields by which I want to group the values.
03:08Grouping changes how the data within your report is organized.
03:11In this case, I want to organize the data by year,
03:14so I will identify the Year field, which is already highlighted here under Report Fields,
03:21and click the Add button. Then click Next.
03:26Now I can select which fields I want to summarize.
03:29In other words, I want to put subtotal and grand total values at the end of each group,
03:35or in the case of grand total, at the end of the report.
03:39Now it doesn't make much sense to summarize Year and Quarter, so I will remove those two
03:44fields from the Summarized Fields list.
03:46To do that, I click the field and then click the Remove button, and I will do the same for Quarter.
03:54So I have Calls and I can set the summary operation; in this case I will leave it on Sum.
04:01But if I wanted to change it, I would click this control and I can select from a wide
04:06variety of calculations, but in this case, I will just stay with Sum.
04:11There are more steps to the Wizard, but there is nothing else I want to cover in this movie
04:14so I'll go ahead and click Finish, and when I do, Crystal Reports creates my report, along with
04:21the settings and the summary that I created.
04:24I think the Standard Report Design Wizard is extremely well done. Because all the options
04:29that you need to create a basic report there, you can create the report and then modify
04:33it to meet your needs.
04:38
Collapse this transcript
Linking to a data source
00:00In the previous movie, I showed you how to create a report using the Standard Report Design Wizard.
00:07In this movie I will show you how to create a blank report and then link it to a data
00:11source to provide values for that report.
00:13When you run Crystal Reports, on the start page, go under Start a New Report and then
00:19click Blank Report.
00:22When you do, the Database Expert dialog box appears.
00:26You can now select a new data source for your report.
00:29To do that, next to Create New Connection, click the expand control and then click the
00:35type of data source that you want.
00:37In this case, it will be an Excel workbook, so I will click the expand control next to
00:43Access/Excel and the Access/ Excel dialog box appears.
00:49Depending on the exercises you have completed, you might need to double-click the Make New
00:53Connection item to display the dialog box you see on your screen.
00:58Now I can select my database type, so I will click that control and from the list that
01:03appears, click Excel 8.0
01:05And then we can select the file that we want to import into the report.
01:10Click the Browse button next to Database Name. It has three periods on it.
01:17When you do, the Open dialog box appears and you can select what you want to bring in.
01:22For this movie we will bring in ContactData, so I will click it and then click Open.
01:27Now I can click Finish and that file appears within the Database Expert.
01:31I will now click Sheet 1, which represents Sheet 1 within that workbook, and click the
01:38Add button so that appears inside the Selected Tables list, and click OK.
01:43When I do, a new database entry appears inside of the Field Explorer.
01:49If the Field Explorer for some reason isn't displayed in Crystal Reports, you can go up
01:53to the standard toolbar and click the Field Explorer button to show it.
01:58Now, to work with the fields in the Field Explorer, next to Database Fields, click the expand control
02:05and next to that, click the expand control next to Sheet 1,
02:09and now you can add the fields from the Field Explorer to your report.
02:13That's all I want to you show you for this movie.
02:15In the next movie, I am going to show you how to add multiple data sources to a single
02:20report, and then in the movie after that, I will show you how to add these fields to
02:24the body of your report.
02:29
Collapse this transcript
Linking to a source with multiple tables
00:00In the previous movie I showed you how to link to the data source that contained a single table.
00:05In this movie, I am going to show you how to link it to a data source that has two
00:10or more tables that you want to use in your report.
00:12When you are in Crystal Reports, you can go to the Start Page and under Start a New Report,
00:19click Blank report.
00:21When you do, the Database Expert dialog box appears.
00:25We want to create a new data connection, so I will click the expand control next to Create New Connection.
00:32My version of the dialog box shows files I have been working with before.
00:36You might not see it, you might--it doesn't really matter.
00:40What you want to do is open up the Access/Excel item and then double-click Make New Connection.
00:49When you do, the Access/ Excel dialog box appears.
00:55Now, we need to select our database type, so I'll click that control and from the list
01:00that appears click Excel 8.0 .
01:02As I explained in the previous movie, Excel 8.0 refers to Excel 97.
01:07The implication is that you have to use a
01:10.xls Excel file type, so you only can use files from Excel 97 to Excel 2003.
01:17With that in mind, you can click the Browse button with three dots next to Database Name
01:23and then navigate to the Chapter 02 folder, under exercise files, and click CustomerOrders,
01:30and then click open. With that in place, we can click Finish.
01:35Now under, Create a New Connection, under this item, which is CustomerOrders.xls
01:42you will see two tables that you can add: Sheet 1 and Sheet 2.
01:47Under that item, click Sheet 1 and then click the Add button, and then click Sheet 2 and
01:53click the Add button--that is the one with the single right-pointing arrow, looks like a
01:58greater than sign.
02:00With those tables selected, click OK and you see the second page of the Database Expert dialog box.
02:06I am going to drag the right edge of the dialog box so you can see everything inside of it.
02:12What it contains is a list of the fields that are available in Sheet 1 and in Sheet 2.
02:18The idea when you create a report like this from two different data sources is to try
02:23to identify a link between the two of them, and in this case we have CustomerID occurring
02:29in both of the data sources. And Crystal Reports identifies that link with customer ID here
02:35and then you can follow the line down the CustomerID in the second source.
02:40So, after you create the report and you add fields, Crystal Reports will be able to relate
02:45records from Sheet 1 to those in Sheet 2. With that link identified, you can click OK.
02:53When you do, Crystal Reports adds those two tables to your report.
02:58Now you can go over to the Field Explorer, click the Database Fields expand control,
03:03and you'll see Sheet 1 and Sheet 2. Click expand control for Sheet 1 and you will see
03:10all the fields available in that data source, and for Sheet 2, you will see those fields as well.
03:16Adding multiple fields from a single data source to a report is very much like
03:20adding a single table, but there are a few slight differences.
03:24Now that you know what those differences are, you can add multiple data sources whenever
03:27you need to.
03:32
Collapse this transcript
Adding fields to a report
00:00After you've defined a data source or data sources for your report, you can add fields
00:05from those sources to the body of the report.
00:08In this movie, I will show you how to do just that.
00:12The first thing you need to do is go over to the Field Explorer and display the available database fields.
00:19To do that, click the expand control next to Database Fields and underneath that, click
00:26expand control next to Sheet1.
00:29If for some reason the Field Explorer isn't visible, you can go up to the standard toolbar
00:34and click the Field Explorer button to display it.
00:38Now you can drag fields to the body of the report.
00:41To do that, drag Year to the Page Header section-- and I'll put it at the top of that section.
00:48And then you can drag Quarter a little bit further to the right in the same section.
00:55Now we will add Center and Calls to the Detail section.
00:59And I'll explain the role of all the sections later on in chapter 3, which covers sections in detail.
01:05But first, I'll drag Center, put it below Year, and then Calls underneath Quarter.
01:13And when you drag them in to the Detail section, Crystal Reports adds a header for the name of that field.
01:20So here is the header and here is the actual data where the data will be displayed.
01:27Now with that in place, you can press F5 to add the data to the report,
01:32and when you do, Crystal Reports displays the data in Preview mode.
01:37At this point you might also see a dialog box asking you to select the data source.
01:41If you do, select to the callData file to see the report that's displayed on your screen.
01:48So you can see that we have data for the year 2011, Quarter Number 1, and then this is monthly data,
01:55so we have Austin, Boston, St. Louis and Seattle, and Las Vegas repeating throughout.
02:01Now this organization doesn't make much sense, but don't worry. I'll show you how to rearrange
02:07these fields and to group them later on in this course.
02:11And now that the fields are in your report, you can start analyzing the data they contain.
02:16
Collapse this transcript
Saving a report
00:00When you work on a report, whether creating a new one or editing an existing document,
00:06you should save your work frequently to avoid having to do anything over.
00:09In this movie, I will show you how to save your reports both using Save and Save As.
00:15If you want to save your report--that is, write your changes to disk--then you have a number of options.
00:21The first option is to press Ctrl+S.
00:24Pressing Ctrl+S saves your report immediately.
00:28If you prefer to use toolbar buttons, then you can click the Save button on the standard toolbar.
00:34If you haven't changed the user interface, then that is the third button from the left
00:38on the top toolbar.
00:40I haven't made any changes to this report, so the button is grayed out.
00:44But if I had, then it would be displayed in blue.
00:46Your third option, is to click the File menu and then click Save, and again, that item
00:53is displayed in gray because I haven't made any changes.
00:57The next item on the File menu is Save As,
01:01and that allows you to save your report but changing something about it,
01:05such as its name or the location where you are saving it.
01:08So to display the Save As dialog box, click File and then Save As, and you can use the controls
01:14in the Save As dialog box to change something about the report.
01:18For example, you could use the controls at the top of the dialog box to navigate to
01:22a different folder, or you can save it under different file name.
01:26For example, instead of saving, I could type saving_backup.
01:31You could then click the Save button to save the report under the new name, or you can
01:35click Cancel, which I'll do now, so that you don't save a new copy.
01:39The next option you should consider is whether you want to save the data with the report.
01:45You can change that setting, again on the File menu, and then click Save Data with Report
01:51to change between saving the data or not saving the data with the report.
01:55By default, in Crystal Reports 2011, data is saved with the report.
02:00That means that Crystal Reports takes the data and includes it in the report in that
02:05same file but compresses the data so it doesn't take up as much room.
02:10The program then decompresses the data when you display the report.
02:13Again, this option is turned on by default.
02:16So the question becomes, When should you turn it off?
02:18Well, there are couple of circumstances.
02:20The first is, if your colleague shouldn't have access to the original data,
02:24saym for example, salary data that you've summarized, but you don't want them to be
02:28able to look at the individual salaries of your employees.
02:31Secondly is if you have to send the report over public networks, such as by email.
02:37Public networks are notoriously insecure, so that means that if you don't want the data
02:41getting out, you shouldn't include it with the report when you send it.
02:45One thing to keep in mind is that if you do save the report without the data, then Crystal
02:49Reports must look up the source data when you open it.
02:52So that means if the data file isn't available or is on another computer, then either the
02:57report will be blank or you'll get an error.
03:01One thing I like to do is to save a version of the report with the data included and a
03:05version without that I can send safely across the Internet.
03:10
Collapse this transcript
3. Managing Report Sections
Creating a section
00:00In Crystal Reports 2011, reports are divided into sections.
00:05Each section takes on a different role within the report.
00:08In this movie, I will show you how to create a section within a report.
00:12The first thing you need to do is open your report and then on the Report menu, click Section Expert.
00:20Doing so causes the Section Expert dialog box to appear.
00:24Now you can select the type of section that you want to insert.
00:27In this case, I will insert a page header,
00:30and this is a section that appears at the top of every printed page of the report.
00:35Over on the right side of the dialog box, you can select options for the section that you're adding.
00:41So for example, you can choose to suppress it, to suppress the data, which means that
00:45you don't allow users to double-click on information to drill down and see the details.
00:51I'll cover that later in the course.
00:53You can also suppress a blank section.
00:55If the section contains no data, then selecting this option will cause it to disappear.
01:01In other words, it won't be included in the report.
01:04And the final setting, Underlay Following Sections, isn't something I ever have to deal with,
01:09so I suggest you to leave it blank.
01:11But if you feel like experimenting, feel free to select it and see whether it works for what you need.
01:17With all the these settings in place, you can click Insert, which causes the Page Header
01:22section to be inserted, and then click OK.
01:25When you do, if you scroll down, you see that there is a new Page Header section, and you
01:30can have data, graphics, or anything else you want to it.
01:33The techniques that I showed you in this movie work for all other types of sections as well,
01:38so it's not specific to the Page Header section.
01:43
Collapse this transcript
Resizing a report section
00:00After you create a report section, you might find that is not quite large enough to hold
00:05or display all the controls and the data that you need it to.
00:09On the other hand, it could be too large and take up too much space.
00:12In this movie, I will show you how to resize a report section.
00:16To resize a report section, when you have your report open, click the Design tab to
00:23display the report in Design view, and you can see in this case--I'll scroll up a bit,
00:28so that you can see the entire Report Header C section--
00:31this section is significantly larger than the chart that is contained within the section.
00:36If I want to resize it, I can go down to the divider at the bottom of the section, and
00:42when the mouse pointer changes to double horizontal lines with up- and down-pointing arrows, then
00:48you can click and drag the section line to resize the section.
00:52So that's what I'll do. I will click and drag the section line up, and when it's in the
00:58proper position, release it. And when I do, Crystal Reports resizes the section.
01:03There is no absolute minimum size for a section, but it should be the size of the data controls
01:08within it, so that they will all appear.
01:11The maximum size for any one section is the size of the printed page.
01:15If you find your data won't fit within a section, you should consider rearranging things
01:20so the layout either doesn't take up as much room or is split among multiple sections.
01:25
Collapse this transcript
Merging report sections
00:00When you create a report, every section in the report serves a specific purpose.
00:06If you have multiple sections of the same type and you want to consolidate them into
00:09a single section, you can do so by merging those sections.
00:14In this report, we have three report header sections: a, b, and c.
00:19We have the printed date and the report description in b and we have a chart in report header section c,
00:25so it makes sense to keep those apart.
00:27But from just looking at this report in Preview, it doesn't appear that there's anything in
00:31report header section a.
00:33If we switch to Design view by clicking the Design tab, we see that there is the report
00:39title and that's the field where if you assign a title to the report in the Report Properties,
00:44then that would appear there.
00:46However, there is no reason to keep the report title and the other information in report
00:51header section B separate.
00:53We could if we wanted to combine them into a single section, so that's what we'll do.
00:58To do that, on the Report menu. click Section Expert, and then in the list of sections, you
01:06click the section that is uppermost of the two you want to merge.
01:10So we want to merge a and b,
01:12so we would select Report Header a, if it weren't already.
01:16And now if we click Merge, header sections a and b are combined.
01:21Now we haven't committed the change yet by clicking OK, so we don't see it in the preview
01:24behind the Section Expert dialog box.
01:27But when I click the OK button, those two sections are combined.
01:32When you merge sections, Crystal Reports retains all the objects in the sections that you brought
01:37together so that you don't have to worry about losing any of your data, graphics, or images.
01:42
Collapse this transcript
Managing section order
00:00When you create a report in Crystal Reports 2011, you can use the order of the sections
00:05to emphasize some data elements over others.
00:08In this movie, I will show you how to manage section order.
00:11This sample file has three Report Header sections:
00:15Report Header A, which contains the Printed Date and Last modified values; then Report
00:20Header B has a chart; and Report Header C has the Report Description.
00:26What I want to do is to change the order of the sections so that the Report Description
00:31currently in Header Section C is below the Printed Date and the Last modified date.
00:37That information seems to make more sense when it comes together because it's the information
00:41about the report, as opposed to information about the data in the report, which is summarized in the chart.
00:48So to change the order of the header sections, on the Report menu, click Section Expert and
00:55then click the header that we want to move.
00:58So for that, we'll click Report Header C. When I do that, the up and/or down arrows appear,
01:05so we have the Move Up button and the Move Down button. You can only move a section within
01:11the group of sections of its type.
01:12So, for example, I couldn't move Report Header C below the Page Header; I can only move it
01:18above or below Report Header b or Report Header a.
01:22If I reclick Report Header b, which can move up or down, then both the Move Up and the
01:26Move Down buttons would become active.
01:28But I am focused on Report Header c, so I'll click that, and click the Move Up button, and
01:35then with that change in place, click OK, and Crystal Reports changes the order of those
01:40sections within the body of the report.
01:42Anytime you want to change the order of sections in your report, you can use the Section Expert to do so.
01:48Don't be afraid to experiment, because you can always undo any changes that you've made.
01:53
Collapse this transcript
Hiding report sections
00:00When you create a report, you might not need to display the contents of every report section all the time.
00:07Rather than delete a section and re-create it later, you can hide a section whenever you want.
00:13This report contains data about individual sales across five states,
00:18and those sales are individually listed in the Details section of the report at the bottom of the page.
00:25Let's say that all I wanted to do was communicate the total of the orders by state to my colleagues,
00:31and they didn't need to see the details, so I want to hide that section of report.
00:35I can do that by opening the Report menu, clicking the Section Expert to display the
00:42Section Expert dialog box, and then I click the section that I want to hide, which is
00:48Details, and then over in the right side of the Section Expert dialog box, I can check
00:54the Hide checkbox, which will hide the data.
01:00And when I click OK, that section is gone from the report.
01:03So if I scroll down by dragging the vertical slider, you see that there is no more detail
01:10section; that data has been hidden.
01:12It's not deleted; it's just been hidden.
01:15And all we have left is the chart and the data in the other report header sections.
01:20The Details section is only hidden in the preview; in other words, it won't be printed
01:24or displayed in Preview mode.
01:27If you go over to Design by clicking the Design tab, which displays the report in Design
01:32view, and you drag the slider down, you'll see that the Detail section is still there.
01:39If you don't want hidden sections to appear in Design view either, then you can turn that
01:43off by right-clicking a section in Design view and toggling the Show Hidden Sections
01:50in Design item from the shortcut menu that appears.
01:53So if I were to click it, Show Hidden Sections in Design, then the Details section would
01:59be hidden in Design view as well.
02:01If I right-click any other section and click Show Hidden Sections in Design again, then
02:07the Detail section comes back.
02:09So, anytime you want to hide a section, you can do so quickly and you can bring them back
02:13just as quickly.
02:18
Collapse this transcript
Creating multiple columns in a report
00:00When you summarize a lot of data in a report, it might make sense to arrange that data in columns.
00:06In this movie, I will show you how to format your report using multiple columns, specifically,
00:11putting multiple columns into the Details section.
00:14This report contains a bunch of data about individual sales.
00:19And these are just the sales amounts-- don't have any other information--
00:23so what I would like to do is to group this data into a series of columns so that it's
00:28easier to take in all at once.
00:30To do that, I will open the Report menu and click Section Expert. Then in the Section
00:36expert, I'll click at the Details section, and then over in the right side of the dialog
00:42box, on the Comment page, I'll check the Format with Multiple Columns box.
00:48When I do, a new Layout tab appears,
00:51so I'll go ahead and click that. And then using the controls on the Layout tab, I can
00:56define the layout of the Details section for the multiple columns.
01:01In this case I want to make each column 2 inches wide,
01:04so in the Width box, I'll type 2. And then I also want to have a gap between each of
01:11the values within the Details section, so I have the horizontal gap, which I'll make
01:16a quarter of an inch, which is .25, and I'll have the same vertical gap of
01:21.25. And what these two values do is to set the amount of white space that there will
01:27be between individual values within the Details section.
01:31So I've got a quarter inch each way, up and down, and left and right of each value.
01:36The next thing I'll change is the printing direction.
01:39Right now I have Down then Across.
01:41What that would do is to create a long column down the left side of the report and then
01:46when it reaches the bottom, it would go back up to the top of the second column and then
01:50start displaying values in that second column again, working its way down the page.
01:55I prefer to show the data so that goes in rows, so I'll select the Across then Down option.
02:01With all that in place, I can click OK and scroll up a bit using the mouse wheel, and
02:07the data appears within the body of the report, laid out in three columns.
02:11The specific settings that you'll use for your columns depend on your data and of course, your own style.
02:17As always, feel free to experiment with different settings and see which ones works best for
02:21an individual report.
02:26
Collapse this transcript
Deleting a section
00:00When you create a report in Crystal Reports 2011, it's likely that the first version you
00:05create will not be the final version.
00:08If you find that you no longer need a particular section in your report, you can delete it fairly easily.
00:14This report contains a chart in Report Header Section c,
00:19and my goal is to delete the chart so that only the data below it is displayed within the report.
00:26To delete a section, you can open the Report menu and click Section Expert.
00:32Then, within the Section Expert, you select the section that you want to delete--
00:37in this case, it is Report Header Section c--
00:39and then click the Delete button.
00:41When you're ready to commit the change, click OK and the section is gone from the body of the report.
00:47I am going to reopen the Section Expert-- again, that's on the Report menu, clicking Section
00:53Expert--to show you a few things about what you can and can't do, and which sections you
00:59can and can't delete.
01:00For example, you can not delete the Detail section.
01:03If you select it, the Delete button grays out. Same thing for the Report Footer.
01:08If there is only a single Report Footer or Report Header Section, then you can't delete
01:13it; it has to be there.
01:15You should feel free to delete a section when you no longer need it, or the data it contains.
01:20But you should always consider hiding the sections instead of deleting it.
01:23I'll cover how to hide and unhide sections elsewhere in this chapter.
01:28
Collapse this transcript
4. Sorting and Grouping Data
Sorting data
00:00When you create a report, the data appears in the body of the report in the same order
00:05that it was presented in the original source.
00:08If you want to change the order of your data, you can sort it using the Record Sort Expert.
00:14The data in this report is a series of sales and I have the sales number, the representative,
00:21the state of the sale, and the amount of the sale.
00:25My goal is to sort the data in the report so that the highest sales are on top and the
00:30lowest sales are on the bottom and continuing in order from highest to lowest.
00:35To do that, I will open the Report menu and click Record Sort Expert.
00:42In the Record Sort Expert dialog box, I can identify the fields that I want to use as
00:47my sorting criteria. First, I will just create a single sorting criteria and that will be the OrderAmount.
00:55So, under Report Fields, I will click Sheet 1 OrderAmount and then click the Add button.
01:02Doing so displays that field in the Sort Fields list.
01:06Now, I wanted the highest values on top and the lowest values on the bottom, so my sort direction
01:11will be Descending.
01:13With that in place, I will click OK and the data appears in the body of the report
01:19in descending order based on sale amount.
01:21Now let's say that I wanted to sort based on multiple criteria, say first by the sales representative
01:28and then by the amount.
01:30So we will take the sales rep's name in ascending order and the amounts of their sales in descending order.
01:37To do that, I will go back into the Record Sort Expert, Report menu > Record Sort Expert,
01:44and now I can add another field to this Sort Fields list.
01:48In this case, it's the sales representative,
01:51so under Report Fields, I will click OrderSalesRep and click the Add button.
01:57When I do, the OrderSalesRep field appears below the OrderAmount.
02:02So what that means is that the OrderAmount is still the primary sorting criteria where instead
02:07what I want is the SalesRep to be the first sorting criteria.
02:10In other words, I want all of the records for sales rep Jones to appear before the records
02:17of the sales rep Smith.
02:19I can make that change by clicking the OrderSalesRep field in the Sort Fields list and then click
02:26the Move Up button.
02:27When I do, the SalesRep moves above the OrderAmount, and that will change how the data appears
02:33within the report.
02:35I want to go in ascending alphabetical order,
02:37so I will leave for Ascending selected for the SalesRep field and click OK.
02:43When I do, I see all the sales for Jones, again in descending order by amount, and all
02:49the sales for Smith, with the amounts appearing in the same way.
02:54If you want to undo a sort, the easiest way to do it is to click the Undo button.
02:59Clicking it once will undo the first sort, but we are still in descending order by amount
03:04because we have done two sorts, and clicking Undo again will put us back in our original order.
03:10You can also go into the Record Sort Expert if I click the Redo button to reapply my first
03:16sort and then click Reports > Record Sort Expert. I can select the field that I want
03:21to remove and click the Remove button to take that field out of the Sort Fields list
03:27and then click OK to save the change.
03:32
Collapse this transcript
Defining a group
00:00When you work in Crystal Reports, most of your data sets will have sets of common values.
00:05For example, you might have records from the same sales representatives, the same cities,
00:10states, or countries.
00:11In this movie, I will show you how to group your data using those values.
00:16To insert a group, you open the Insert menu and then click Group.
00:23When you do, the Insert Group dialog box appears.
00:26You can now select the field on which you want to group your data, and for this, I will
00:30make it state.
00:32So click the first control to display the fields that are available and then under Report
00:38Fields, I will click OrderState.
00:40I can then select a sorting order.
00:42I will stay in ascending order for this case, but you can choose in descending order, you
00:47can specify an order, or you can put the data back in the original order, which basically
00:51undoes the grouping or any changes that you have made to the grouping sorting order previously.
00:57But like I said, we will stay with ascending and click OK.
01:03Now the data within your report is grouped based on the state from which an order was
01:07placed, and those go in ascending alphabetical order.
01:12So we've got California, Colorado, Idaho, Oregon, and Washington.
01:18What's happened is that Crystal Reports has added a new grouping section to your report,
01:24and you can see that if you go to Design view by clicking the Design tab.
01:29So we have the usual report headers and the page header and then above the Details section,
01:34we have Group Header #1 and below it we have Group Footer #1.
01:39Those sections have the definition for the group that we put in using the Group Expert.
01:44Now switch back to Preview. Another change you might have noticed is that over
01:49here on the left side of the program window, there is now a Groups pane that you can use
01:55to move around within the report.
01:57So, for example, if your report is multiple pages, you can move from group to group.
02:01The way that I have the report currently displayed on the screen has Idaho, Oregon, and Washington.
02:07If I wanted to move to the California group, I could go into the Groups list and click
02:12CA and doing so moves up to the California group.
02:16Grouping your data within a report makes it easier to analyze the values it contains.
02:20In the rest of this chapter, I will show you other things you can do with groups, such as
02:24reorganizing the order of your groups and changing the emphasis of your report.
02:29
Collapse this transcript
Grouping data based on dates and times
00:00In the previous movie, I showed you how to group your data using values and text and number fields.
00:06You can also group your data based on dates and times, but the procedure is a little bit
00:11different because the options available to you have changed.
00:14Let's dig in and I'll show you how to do it.
00:16The body of this report--which is quite large; it's 114 pages--contains data for sales going
00:22back to January 1, 2010.
00:26What I want to do is to group the data by week, but also to go in reverse order,
00:30so I want the most recent data to appear at the top of the report and the oldest data
00:34to appear at the bottom.
00:36To do that, I'll go to be in Insert menu and click Group to create a new group, and we're
00:43going to group the data on the Date field, so I click the top control and select Date
00:51from the list of fields that appears.
00:53And instead of in ascending order with the oldest data at the top of the report, I'll
00:58switch it to descending order.
01:01Then I can decide how the section will be printed. And this is one of the changes when
01:05you work with dates and times.
01:08So for example, we can group the data by week, we can go up by day, we can go every two weeks, and so on.
01:14For this exercise, I'll group the data for each two weeks and with all the settings in place, click OK.
01:21So what's happened in the body of the report is that I have all of the data grouped based
01:25on two-week intervals, and the weeks start with December 23rd, 2012 and work their way
01:32down in descending order.
01:34So if I scroll down in the report, and the second group doesn't start until the top of
01:41Page 2, which we can see by scrolling up.
01:45Grouping your reports' rows by date let you analyze different aspects of your business operations.
01:51Don't forget that you can group by day of the week.
01:53For example, if you run a call center, you might want to check your calls on Monday versus
01:57calls on other Mondays in the same quarter.
02:02
Collapse this transcript
Reordering and deleting groups
00:00When you add a group to a report, that group changes how the data appears within the report.
00:06You can then modify the presentation by reordering or deleting groups.
00:11This report contains call data for the year 2011 and 2012 for a series of call centers.
00:17I've grouped the report by year and by call center, and you can see that structure here
00:23with 2011 Austin, then Boston, then Las Vegas, and so on.
00:28What I want to do is change the grouping order and then delete a group.
00:32To perform either of those tasks, you open the Report menu and then click Group Expert.
00:40When you do, you see in the Group By List that you have the report grouped by year and then by center.
00:46If you want to change the order of these two fields--in this case you want to move Year-A
00:52below Center-A--then you can click Year and then click the Move Down button.
00:58So now the report will be grouped by Center and then by Year, and when I click OK, we see
01:03the Austin call center with results for 2011 and 2012, and so on for Boston, Las Vegas,
01:10and the other cities.
01:12Now, let's say that I want to delete a group.
01:14Say, for example, I want to delete the year.
01:17To do that, I'll go back into the Group Expert, by clicking Report > Group Expert. And I want
01:24to delete the Year,
01:26so I'll click the Year field in the Group By List and then click the Remove button.
01:31It's the less than sign or you can think of it as a left-pointing arrow.
01:36Click that. It's removed from the list. Click OK, and now I see results from 2012 and 2011 for Austin.
01:44Getting rid of a group or changing the order is a straightforward process, and even if
01:49you do remove a group from your report, you can always add it back using the Group Expert.
01:54
Collapse this transcript
Changing group options
00:00Like other elements of a Crystal Reports 2011 document, groups have options that you can
00:05set to control how they appear and operate within a report.
00:08In this movie, I will show you how to change to those options and what effect they have
00:13on your document when you do.
00:15So I want to change Group Options. To do that I will use the Group Expert, and I can get
00:20to that by clicking Report and then clicking Group Expert.
00:26The Group Expert appears and displays the grouping settings that I currently have applied.
00:31If I want to change my grouping options, I can do so by clicking the Options button.
00:37This displays the Change Group Options dialog box.
00:40The first thing I can do is select the group that I want to work with, so instead of Sheet1
00:45for the Year, I can select Sheet1_Center and then I can click over to the Options tab.
00:54The options that I use most frequently are Keep Group Together and New Page After, some
00:59number of Visible Groups.
01:02The first option I mentioned, Keep Group Together, forces Crystal Reports to print all values
01:07from a particular group on a single page if it's possible.
01:10If it spills over to two pages, in other words there is too much data to fill on the single
01:14page, then it won't.
01:16But if possible, it will start a new group on a new page, if necessary, to keep all of
01:22those group's records on the same page when you print it.
01:25The next option that I mentioned, New Group After some number of Visible Groups, allows
01:30you to set what is essentially a page break.
01:33So for example, if you had a set of records and you knew that there were eight records
01:38within each of the groups, then you could say that you want a new page after three visible
01:45groups. That means you would have three groups, each with eight records, appearing on a page,
01:49and you wouldn't have to worry about any sort of spilling-over effect.
01:53This is distinct from Keep Group Together because that would continue printing groups
01:58on a page until it ran out of room and had to move to the next page, so you could have
02:03four groups or possibly five or six instead of just three that you wanted.
02:07I'll show you what that looks like, by going over to three visible groups.
02:12So I have New Page After selected, three visible groups, and I'll click OK, and click OK again.
02:19So now we have Austin, Boston, and Las Vegas, and then when I go to the next page by clicking
02:27the Show Next Page button on the navigation toolbar, we'll see the two remaining groups.
02:33I'm going to go back into the Group Expert, clicking Report > Group Expert and then Options,
02:40so that I can talk about the third option that I use a lot, and that is Repeat Group
02:45Header On Each Page.
02:47When you print a report you might have a group that spans numerous pages: three, four, five, or more.
02:53If that's the case then you would want to have Crystal Reports print the group header
02:56name at the top of each page. That way you know to which group that data belongs.
03:02The option that I use most frequently is to keep the group together.
03:06I personally find that having your groups spill over to the next page makes it difficult
03:09for me to comprehend the data.
03:11If your groups are small enough that all of the data can fit on the same page, that's
03:15how I would prefer to present it.
03:20
Collapse this transcript
Creating a summary
00:00So far in this course, I have created reports that display each of the rows that are available
00:06in the source table.
00:08If all you need for your purposes is a summary of that data, you can create a summary function
00:12and add it to your report.
00:14I will show you how to do that in this movie.
00:17To create a summary, you need to have a report with some numerical data, and I have that here.
00:22I have a set of calls for quarters in the year 2011 and 2012 for a series of call centers.
00:30What I want to do is summarize the call data.
00:34To do that, I'll open the Insert menu and click Summary. Then in the Insert Summary dialog
00:40box, I can select the field I want to summarize,
00:44so I click the top control and click Sheet1_ Calls. Then I can select an operation to calculate
00:52the summary, and I'll just stay with the Sum, but I'll show you the list of other operations
00:57that you could use, and there are quite a few.
01:00Now I can select the type of summary that I want to create.
01:04I can have a grand total, which will go into the report filter, but what I actually want
01:08to do--and I'll click the control--is to have each summary appear underneath the center.
01:14So in other words, after 2011 for Austin, I want to see a summary; 2011 for Boston, a summary;
01:20and so on, throughout the report.
01:23So I'll click Group #2 Center-A, and those are the only options that I'll set for now.
01:29I'll go ahead and click OK, and when I do, the summaries appear below each of the groups.
01:34And you can see the first two on the screen: one for Austin 2011 and one for Boston 2011.
01:41Like I said, there are other types of summaries that you can create, so I'll give you an example of one of them.
01:45First, I'm going to click the Undo button on the standard toolbar to get rid of the
01:51summary I just created, and then on the Insert menu, click Summary again, and I'll choose
01:58the field, which will again be Calls, so Sheet1_Calls.
02:02I'll calculate the summary, like I did before.
02:06I'm going to put the summary location below the center, and when I do, I get a set of additional
02:11options at the bottom, which is based on the way the report is laid out.
02:15What I want to do is show the value as a percentage of the sum of all calls.
02:21To do that, I click the control below Show as a percentage of and I select Grand Total,
02:28which is the sum of every call.
02:31Now when I click OK, I see that in 2011, calls to Austin represented 8.1%, calls to Boston
02:39represented 12.06% of all calls, and so on, throughout the rest of the report.
02:44Summaries are extremely useful items.
02:45I recommend using them and using quite a few of them so that you can summarize your data
02:51and not have to get too bogged down in the details if you don't need to.
02:56
Collapse this transcript
Defining statistical summaries
00:00When you summarize data in a report, the most common operation you'll use is the Sum function,
00:06which adds up all the values that you included in your summary.
00:10You have many other operations you can perform, however, and in this movie I will show you
00:14which operations you can use and how to add them.
00:16The report I'm working with has call center data for 2011 and 2012 for a set of five cities
00:24that contain call centers.
00:25I want to summarize that data. To do that, I'll click Insert, and the second item is Summary.
00:32Doing so causes the Insert Summary dialog box to appear.
00:35Next, I need to identify the field that contains the data I want to summarize, and that is the
00:41Calls field. So I'll click the top control and from the list that appears under Report
00:46Fields, click Calls.
00:49Now I can identify the summary I want to use.
00:51To select that operation, I'll click the second control in the dialog box, one that currently
00:56says Sum, and doing so displays a list of the other summary operations I can use.
01:02In this case, I want to find the average of calls for each of the groups,
01:06so I'll click Average, and now I can identify where I want the summary to appear.
01:12So instead of having a grand total, I'll click this third control here and identify that
01:18I want it to appear below every center.
01:21So in other words for 2011 for Austin, I want to see the average, 2011 for Boston
01:26see the average, and so on.
01:28And those are the only changes I need to make here, so I'll click OK, and I see the average number of calls.
01:34And because these groups are fairly close, I can visually identify that the fourth quarter
01:39was above average, the third quarter was well above average, and quarters two and one were
01:45below average for Austin in 2011.
01:47Statistical summaries provide a lot of useful information about your data.
01:52You should take the time to experiment with different operations you can use to summarize
01:56your data and pick the one that works best for your report.
02:01
Collapse this transcript
Creating a drill-down report
00:00When you create a report that summarizes data, each row within your report represents several
00:06rows from the original data source.
00:08If you want to display the data that provides the values for the summary that is displayed
00:13within the report, you can do so by creating what is called a drill-down report.
00:18What I want to do is hide the data for Austin, Boston, Las Vegas, and the other call centers
00:24within a year, and then bring that data back using drilldown.
00:28So what I need to do is to hide the Center group.
00:32To do that, I'll open the Report menu, click Section Expert, and then I will select the
00:40Group Header #2 Sheet1_Center section, and then check the Hide (Drill-Down OK) box.
00:48It's very important that you select Hide instead of Suppress, because Hide allows drill-down
00:54as indicated in parentheses saying drill-down is okay, while as if you suppress the data,
00:59then drill-down is not allowed at all.
01:02So I've hidden the Group #2 header, and I'll do the same thing for the Group #2 footer.
01:08So I'll click that, and then check the Hide (Drill-Down OK) box over in the right side
01:13of the Section Expert dialog.
01:16Now, one thing to note is that the details don't appear in the body of the report, and
01:20that's because I've hidden the Details section.
01:23So if I click the Details section, you can see that I have checked the Hide box.
01:27Again, if I check Suppress, then I wouldn't be able to drill down to that data.
01:33With those changes in place, I can click OK, and when I do, I just see the summaries for 2011 and 2012.
01:40Now what I can do is go over to the Groups pane on the left side of the user interface
01:45and open up one of the years by clicking its expand control.
01:49So let's say that I want to see calls for 2011.
01:51I'll click the expand control next to 2011, and if I resize this pane a bit, you can see magnifying
01:59glasses beside the names of the cities.
02:01If there is a magnifying glass, that means you can drill down into it.
02:05So let's say that I wanted to see the Austin calls for 2011.
02:08If I click Austin, that data appears in a new tab. You can see it was added to Design, Preview, and then Austin.
02:17So that was my quarterly data for calls, for the year 2011, for Austin.
02:22And then I can close that tab by clicking the close box on the right side of the tab on the tab bar.
02:29Drilling down to the underlying data gives you details on the specific values generated
02:33by your business.
02:34If you see a value that doesn't quite fit what you expect, drilling down can give you
02:38valuable insights.
02:43
Collapse this transcript
Sorting by group
00:00When you group the data within your report, Crystal Reports gives you a number of additional
00:05sorting options that you don't have for regular data sets.
00:08In this movie, I'll describe those options and show you how to implement them.
00:13The report that I'm using contains data for five call centers for the years 2011 and 2012.
00:21Now, one thing I want to reiterate is that when you want to sort by group, you must have
00:26a summary operation on one group inside of your report, and in this case, I am summarizing
00:32calls by group for a given year.
00:34So, for Austin, we have calls for quarter one, two, three, and four of 2011. Those values are
00:40here, and they all add up to 10,675.
00:44With that summary in place, we can click the Report menu and then click Group Sort Expert.
00:51In the Group Sort Expert dialog box we can select how we want to sort the group center.
00:57So click the control under for this group sort, and we can select the type of sort that we won't create.
01:03The options that I use the most are Top N where N is sum number, Bottom N, Top Percentage,
01:09and Bottom Percentage.
01:11For this example, I'll show you the Top N values for each center within a given year.
01:17So I'll click Top N. And we do want to base it on the number of calls, so we can leave
01:23this value set as the calls field, and then we can select where N is and then type in another number.
01:31Right now we would display the top five values, but what I want to do is display the top two,
01:37so I'll type the number 2 and with those changes in place, click OK.
01:41What the report now displays are the top two groups for each year.
01:46So, we have Boston, with over 15,000 calls, and Seattle, with over 14,000 calls for the
01:52year 2011. Then in the year 2012, Seattle had over 16,000, and Austin had over 15,000. Because
02:00we're finding the top values among the groups, the values are displayed in descending order.
02:06In another words, the highest values are on top. If we look for the bottom values, then
02:10the lowest values would be on top.
02:12Finding the top and bottom values in the field is extremely useful. It's the operation
02:17I use most when I sort by groups.
02:22
Collapse this transcript
5. Formatting Reports and Report Elements
Applying a report template
00:00In Crystal Reports 2011, you can format individual report controls or you can apply a template
00:07that affects the entire report at one time.
00:09In this movie, I'll show you how to apply templates and then throughout the rest of
00:13this chapter, I'll show you different ways that you can format individual controls.
00:17This report has some very basic formatting: just the date at the top and then the data
00:22in individual rows throughout the body.
00:25What I want to do is apply a template and to do that, I'll open the Report menu and
00:30click Template Expert.
00:33When I do, the Template Expert dialog box appears and I can select the template that I want to apply.
00:39In this case, I'll select Block (Blue) and click OK.
00:45The data appears inside the body of the report with the new template applied, so you have
00:49the report description here, and it has a shadowed blue background, and then the data appears
00:54within the body of the report, with new font settings.
00:58Now you'll notice that there is a little bit of overlap here with the quarter where the
01:02value inside the Quarter field overlaps the value in the City field.
01:06You can fix that using techniques that I'll show you later on in this chapter.
01:10If you've applied a sample and you won't get rid of it then you can go back into the Template
01:14Expert, again by clicking Report > Template Expert, and click the Undo the current template
01:20option, and click OK.
01:22Doing so removes the template.
01:24One thing to keep in mind when you want to use Undo current template is that you can
01:29only undo one level.
01:31That means you can only undo the previous template that you've applied.
01:36If you've changed your mind and apply two or more templates, you can only undo the most recent one.
01:43The built-in report templates let you format your reports quickly.
01:46I prefer Block (Blue), but you should experiment with the other templates available and find
01:50one that you like best.
01:55
Collapse this transcript
Formatting a report control
00:00In the previous movie, I showed you how to apply a report template to format a report as a whole.
00:06In this movie, I will show you some of the most common ways that you can format individual report controls.
00:12When you want to format individual report controls, you need to switch over to Design view.
00:17So, on the View tab bar, you can click Design and view the report in Design view.
00:23The field we're going to work with is the Print Date field, which is here in the Page Header section,
00:28so I'll go ahead and click it. And when I do, you probably noticed that the controls on
00:34the Formatting toolbar went active.
00:37So if I click away from it, the formatting toolbar here, the controls our all gray,
00:43but when I click it again, those toolbar buttons become active. And now I can use those tools
00:48to change the formatting of the selected control.
00:51So, for example, if I wanted to change the font size, I can click the Font Size control's down
00:56arrow and select another size such as 14 point, and that makes the print inside the control larger.
01:05There are other common things that you can do, such as making it bold, italic, or having an
01:10underline, and you can also change the font color.
01:15There is a palette of the colors that are available to you there. And to display the
01:19palette, I clicked the arrow at the right of the Font Color control.
01:24If I were to click the control itself to the left of this little vertical separator line,
01:29then it would apply whichever color is displayed underneath.
01:32In this case, it's kind of a dusty purple. But if I click the down arrow then I see a
01:37palette of more colors.
01:39If I want more options, I can right-click the control and then click Format Field.
01:46The Format Editor basically gives me access to all the tools that I can use to format
01:51a particular control.
01:52In this case, I'm going to click the Common tab and I can give the object a name, I can
01:58rotate the text. Say, for example, if I wanted to go vertically instead of left to right,
02:03I could change its rotation. I could also change its horizontal alignment. And at the
02:07bottom, you see a preview of what it will look like if you apply those changes.
02:12On the Border tab, you can change the line style, such as making it single line, double,
02:18dashed, or dotted, and you can also change its color,
02:21say going from black to any of the other colors in this palette, or you can click more to see a wider variety.
02:27On the Font tab, you can change the font, the style, the color, and these are basically
02:32the same options that you see you on the left side of the Formatting toolbar.
02:35If all you want to do is change the appearance of the text, then you can do that using the
02:40controls on the Formatting toolbar, instead of opening the Format Editor.
02:44At the beginning of this movie, I displayed the Date tab. There is actually a lot going
02:49on in the Date tab,
02:50so I'm going to cover that in a separate movie.
02:52When you're ready to apply your changes, you can click OK and they appear in your report
02:56when you click Preview.
02:58Changing the appearance of format controls affects how the data they contain is displayed
03:02within your report.
03:04You can use bold, change the size of your text, or change fonts to provide the variety,
03:09as long as those changes make the reports easier to understand and not just decoration
03:13for decoration's sake.
03:18
Collapse this transcript
Applying number formats to report controls
00:00When you add a Number field to a report, Crystal Reports applies a standard format
00:05that includes two digits to the right of the decimal point.
00:08If you're working with financial data, that's not a problem;
00:11however, if you're working with quarters or days of the month, you don't want those decimal points.
00:16In this movie, I will show you how to change a control's number format.
00:20When you take a look at this report, you can see that I have two number fields in the Detail section.
00:25The first is the number of an order and those numbers are always going to be integers or
00:31whole numbers, so we don't need 1.00, 2.00. It will always be .00,
00:37so we can get rid of it.
00:38The other data I have that is of a numerical variety are the amount of each order.
00:46This data is actually currency data or financial data,
00:49so I want to apply a currency sign or dollar sign to the left of it to make that explicit.
00:55To change the formatting of a Number field, you switch over to Design view, then right-click
01:00the Number field that you want to change.
01:02I'll start with OrderID and then click Format Field.
01:07Then in the Format Editor, on the Number page, you can select the style that you want.
01:12The styles are displayed as negative numbers, so don't let that throw you off.
01:16It did throw me off when I first started using Crystal Reports.
01:20In this case, I want a format that has no digits to the right of the decimal point,
01:25so I will select the second item, and that is 1123 with nothing to the side and no comma.
01:32With that change in place, I'll click OK, and then when I display the report in Preview
01:37mode, we see that instead of 1.00, we have the much more sensible 1, 2, 3, 4, and so on.
01:44With that change is done, we can work on the currency data on the right side of the report.
01:49So go back to Design view and right-click the OrderAmount field and click Format Field.
01:57Now, again, on the Number tab of the Format Editor, I can leave the System Default Number
02:03Format, which has two digits to the right of the decimal point, but now I want to display
02:07a currency symbol.
02:08To do that, I will check the Display Currency Symbol box, click OK, and then go back to
02:14Preview mode. And we can see the data is now displayed with the dollar sign to the left.
02:20So now there is no question that that is currency value.
02:24It's surprising how disconcerting an improperly formatted number can be.
02:28When you create your report, you should flip to Preview mode frequently so that you can
02:32view your data and see if you need to change the formatting for any of the number fields
02:36to reflect the type of data they contain.
02:41
Collapse this transcript
Applying formats to date fields
00:00In the previous movie, I showed you how to format numbers to make them easier to read
00:04based on context.
00:06In this movie, I'll show you how to do the same thing for date fields.
00:10The Format_Dates report has three fields.
00:13The middle field is the Date field, and that is the date an order was placed.
00:18It has the date that the order was placed and the time of day.
00:23But in this case, the time of day the order was placed wasn't captured,
00:27so it just shows 12 a.m. or midnight.
00:30What I want to do then is to change the date field's format so the time no longer appears.
00:35I can do that by going into Design view, and then in the Details section, right-clicking the Date field.
00:43Then in the shortcut menu that appears, I can click Format Field, and doing so displays
00:48the Date and Time tab of the Format Editor.
00:52And from here I can select the Date and Time format that I want.
00:55In this case, I just want a date format,
00:58so I'll scroll down to find the format that I want, which is the full month, followed
01:05by the number of the day, followed by the year.
01:09So I'll go ahead and click that and then click OK.
01:13Then when I switch back to Preview, we see that the field now has December 18, 2012,
01:19and it's much easier to read, and there isn't any extraneous information, which is the time
01:23that we hadn't captured in the first place.
01:26If you want a little bit more control over your date fields, you can use the Customize option.
01:31So I'll switch back to Design view, and right- click the Date control in the Details section, and
01:37click Format Field.
01:38If you click Customize and then click Date, you can set all kinds of options for your date.
01:47So for example, you can have a custom date type, or you can use either of the two windows
01:51defaults, either Short or Long, and then you can change the format of the month, of the
01:57day, of the year.
01:58You can change the order in which your month and day appear.
02:02So let's say, for example, that you're in Europe or working with someone in Canada.
02:07They use the day-month-year sequence.
02:09If that's the case, you can select the DMY for day-month-year option to format the
02:15data in a way that they would be accustomed to.
02:18So there are plenty more options in here, and I'll leave it to you to play with them to
02:21see if you need to make any of those changes.
02:23But for now I'll click Cancel.
02:26The date format you choose for your report will vary based on your locale and your company's style.
02:31Once you've decided on the style for your date information, it's easy to apply the format
02:35you want.
02:40
Collapse this transcript
Resizing, aligning, and reordering objects
00:00After you add controls to a report, either by using the Report Wizard or adding the controls
00:05by hand, you can change the controls' positions and change their size.
00:10I intentionally misformatted this report so you can see here in the Details section,
00:14we have the customer ID and then the customer name and then underneath that, we have the
00:19city and the state.
00:20So, what I'd like to do is to bring all of those controls onto a single line, and also
00:25adjust their sizes if need be.
00:28So, the first thing I will do is switch over to Design view, and here we can see the details
00:34of the controls within the report.
00:35We can see the CustomerName is quite large, in fact, most likely a lot larger than it
00:40has to be, and CustomerState, which will be a two-letter abbreviation, is much, much longer
00:45than it needs to be.
00:47So, to resize the controls, the first thing you do is click a control, like I've done here
00:52with CustomerName, and then when it's outlined in blue, you can position the mouse pointer
00:56over a corner or edge and then drag it to resize the control.
01:01In this case, I want to make the CustomerName control not quite as wide. I want to make
01:06it narrower. So I will move my mouse pointer over the right edge, and when the mouse pointer
01:11changes to a double-headed horizontal arrow, like what you see here, I can click and drag
01:18to the left. And I will drag it to about there.
01:22And now, I will do the same thing for the CustomerState control.
01:24I will click the control and then grab the right edge. And again, I know when I've got
01:31the pointer in position, because it changes to a horizontal double-headed arrow. Click
01:36and drag it to the left, and I will make it about half its original size.
01:40So that's how you resize a control.
01:42If you wanted to resize it vertically--in other words make it taller--you could grab
01:46the control in the top-middle, and it turns into a vertical two-headed arrow, and you can drag.
01:53I'll just put that back.
01:55So now that I've resized my controls, I can put them all into a line.
02:00I want fairly fine control over positioning, so I don't want these controls to snap to
02:05the grid when I move them.
02:08I covered snapping to grid in Chapter 1, but I'll review it here briefly.
02:12To turn it off, go to File, and then click Options, and then on the Layout page of the
02:18Options dialog box, clear the Snap to Grid option.
02:23When you do, you can now move your controls anywhere within the window and you won't have
02:28to worry about lining them up to the grid.
02:30You have absolute control.
02:32So, with that change in place, I will click OK, and now I can start moving these controls.
02:37I will move CustomerCity up above the line, to the right of CustomerName, and then I will
02:44move CustomerState up there as well. And I will move CustomerState up a little bit too
02:50high and I will do that on purpose.
02:52What I want to do now is to align all of these controls
02:56so that they are at the same level along the bottom.
03:00To do that, I need to select the controls, so I'll hold down the Ctrl key and with CustomerState
03:06still selected, I will click CustomerCity, CustomerName, and CustomerID.
03:12And again, I was holding down the Ctrl key so that additional clicks selected those other
03:18items. Instead of just selecting one, I selected each one of them and added them to the group.
03:23So now I can change these controls' alignment.
03:26To do that, I will open the Format menu, point to Align, and then I want to align them along the bottom.
03:33So, from the list that appears, I will click Bottom. And I will click to clear my selection,
03:40and then I can preview my report to see how it looks. And that's how it's going to look
03:44now, and it looks much better than the report we started with.
03:47I like to have very fine control over the position of objects within a report,
03:51so one of the first things I do is to turn off the Align to Grid setting.
03:55I then use the Align command on the Format menu to ensure that my report controls line up properly.
04:03
Collapse this transcript
Managing images and drawing objects
00:00When you create a report, the data it contains is the most important aspect.
00:05That said, you can make your report more readable by adding items such as company logos or text
00:10boxes, lines, and other graphic elements.
00:13I'm going to add some design elements to this report to make it a little bit more readable
00:17and also to apply some corporate branding, so it's easy to identify where the report comes from.
00:23To do that, I'm going to switch over to Design view by clicking the Design tab and now in
00:29Design view I can add the items that I want.
00:32The first thing that I'm going to do is add a text box in the Report Header a section
00:37to provide a title for the report.
00:40To do that, I'll click the Insert Text Object button on the toolbar and then when the mouse
00:47pointer changes to a larger black cross, I can draw the text box that I want and then
00:55when I release the mouse button, I can type in the text I want, and I'll just call it Customer Summary.
01:01Now I can select the text and apply formatting using the controls on the Standard toolbar.
01:07So, I'll make the text a little bit larger by clicking the Increase Font Size button,
01:12so I'll take it up to about 18 point, and then I'll make it bold and then I'll center it
01:20within the control by clicking the Align Center button. So that's how that works. And I'll
01:26click the control and drag the handle on the bottom edge to make it little bit smaller
01:34so that the control doesn't take up as much room inside the Report Header section.
01:38Now I'm going to add a company logo, and it is just a placeholder because in this scenario
01:43the company hasn't finalized their logo, but they know what size they want it to be.
01:48So you can add a placeholder and indicate where that logo will go.
01:52To add a picture, you can click the Insert Picture toolbar button and then in the Open dialog
01:58box, click the image you want to add and click Open.
02:03When you do, your mouse pointer appears inside of the report, and you also see an outline
02:08of the image and how large it's going to be inside the body of the report.
02:13So you can move it to the position where you want it to go, using the edges of the Preview
02:18to tell you where it'll fit, and when you left-click, the image appears.
02:24If I wanted to put a box behind the Customer Summary, I could click and drag to draw the box
02:29after clicking the box control on the toolbar, and when I release left mouse button, the outline appears.
02:36But now let say that I wanted to put a line below each of the rows in the Detail section
02:40when it appears in Preview and when it's printed.
02:42To do that, I'll click Insert Line--it's on the same tool bar--and then in the Detail section
02:49I would just draw the line. That line is now in place, and when I click Preview, all of
02:56my changes appear. Just as with any other type of formatting, images and drawing objects
03:01should contribute to the report instead of being mere decoration.
03:04If you use them wisely, your reports will be that much easier to understand.
03:08
Collapse this transcript
Highlighting records
00:00Almost ever report contains certain rows of information that are more important than others.
00:06In this movie, I will show you how to highlight those rows within the body of a report.
00:11This report contains data about individual orders and the amount of the order.
00:16So for example, you have amounts of 575, 601, 1066, and so on.
00:21What I want to do is highlight the OrderID of orders that have amounts over 750, over
00:281000, and over 1250.
00:32So, to do that, I'll switch over to Design view, and then in the Details section, click
00:38OrderID. And again, that is the field that I want to change the highlighting of. So, with
00:44that field selected, I will open the Format menu and click Highlighting Expert.
00:50In the Highlighting Expert, I will click New to create a new rule and then I'll go over
00:55to the Item editor side of the dialog box to make my changes and define my rule.
01:01The first thing that I want to do is to identify the field that Crystal Reports should look
01:06at when it's determining what type of highlighting, if any, to apply.
01:10So I'll click the Value of control and then click OrderAmount. Then I can tell it, how
01:16to compare the value, so I want a comparison rule of greater than.
01:20The first rule I am going to create looks for a value greater than 750.
01:25So in the list of operations, I will click "is greater" than and then below that, I will
01:31click in the control and then type the value 750.
01:35So now this rule would be applied whenever the order amount control contains a value
01:40of greater than 750.
01:43I want to highlight the background in green, so I will change the background color and click green.
01:49So now any row in the report that contains a value greater than 750 will be highlighted
01:54in green, and when I click OK and switch to Preview, we can see that that change has
02:00been put in place.
02:02But now let's say that I want to create multiple rules. In other words, I want three different
02:06types of highlighting to appear.
02:08In this case, I want any OrderID field in a row that has an amount or greater than 750
02:14to be green, but I also want any row greater than a 1000 to be yellow and any row that
02:20contains an amount greater than 1250 to be red.
02:24So the first thing I am going to do is to create the rows incorrectly so that you can
02:29see a very easy trap to fall into and then do it the right way.
02:33So I'll switch to Design view, I will click the OrderID control, and then on the Format
02:39menu, click Highlighting Expert.
02:42Now I can create a new row by clicking New and then using the Item editor to make the
02:48settings that are required for the rule.
02:50We are looking at the value in the OrderAmount field, so I will select that from the value
02:55of control. Again I want values greater than a certain value, so for the comparison operation,
03:01I will select is greater than. And then in the comparison amount control, I will type 1000.
03:09I want the background color to be yellow for values greater than a 1000, so I will
03:13click the Background controls down arrow, and from the list of colors click yellow. And with
03:18that rule in place, I will go ahead and create the final rule, which will have any rows with
03:23values greater than 1250 in the OrderAmount field displayed in red.
03:28So I will click New, value of OrderAmount is greater than 1250, and the background will be red.
03:43Those changes are in place. Then I will click OK. And back in the body of the report, I will
03:47change to Preview and it doesn't look like anything is changed.
03:51The reason it doesn't look like anything is changed is because I have the rules in the
03:55opposite order that they need to be in to work properly.
03:58I will switch back to the Highlighting Expert, so I can give you a little bit more detail.
04:03So I will click Design, click OrderID, Format > Highlighting Expert.
04:11Crystal Reports evaluates highlighting rules in the order in which they are presented.
04:16So in other words, it looks to see if a value is greater than 750.
04:20If it is, it applies the format and stops.
04:23It doesn't look to see if the value is greater than 1000 or greater than 1250.
04:29It just says this rule is true; I can stop looking.
04:31What you need to do is order your rules so that the most restrictive case is on top
04:37of the list and the least restrictive is on the bottom.
04:40So in this case, we are looking for values greater than 1250--that should be evaluated
04:46first--then 1000, then 750.
04:50So what I'll do is click the red highlighting rule that is greater than 1250 and click the
04:57move-up button over Priority to move it to the top of the list, and then I'll click the
05:02green rule for greater than 750 and click the move down button so it's at the bottom of the list.
05:09So now Crystal Reports will evaluate the contents of an OrderAmount field for most restrictive
05:14to least restrictive, that is, greater than 1250, greater than a 1000, or greater than 750.
05:21With those changes in place, I will click OK and then switch to Preview, and we can see
05:27that the rules have been applied correctly.
05:29If I want to get rid of any highlighting rules, I can do so by once again going back
05:33into the Highlighting Expert, click Design, then OrderID, then on the Format menu click
05:40Highlighting Expert. And to delete a rule, you click the rule and then click the Remove
05:46button, and I will do the same thing for the yellow highlighting rule: click it, then click
05:51Remove, click OK, and then click Preview. And we can see we are back to just the one rule being applied.
05:59As with any other type of formatting, it's easy to go overboard on the highlighting.
06:04Just like the textbooks that you highlighted in school, a little bit of work goes a long
06:08way when it comes to emphasizing the most important ideas in a report.
06:13
Collapse this transcript
6. Adding Charts to a Report
Introducing available chart types
00:00In the previous chapters in this course, I have shown you how to summarize your data
00:04in Crystal Reports 2011 by using reports and by focusing on individual numbers or summaries.
00:11In this chapter, I'm going to show you how to summarize your data visually using charts,
00:15and in this first movie, I am going to describe the types of charts that are available to you.
00:21One of the most common types of charts--and one that you've probably used either in Crystal
00:25Reports or in other programs--is referred to in Crystal Reports as a bar chart, and that
00:31shows a value for each group and a subgroup. And there are three different subvarieties
00:35of bar charts that you can create.
00:38Another common and most likely familiar type of chart is what's called a line chart.
00:43Line charts plot data values as points and connect the lines for each series.
00:47Usually you display data over a time series using a line chart, such as sales by month--
00:53January, February, and so on--and you can use the line to track the ups and downs of the
00:57sales amounts over that time.
01:00An area chart is like a line chart, except that it's plotted over time to show contribution
01:05of a whole for each series.
01:07So let's say for example that your company has three separate departments and each of
01:11those departments or divisions contributes to a whole over time, so if you want to see
01:16the total of all sales and see how much each individual department contributed for a particular
01:22month, then you would use either a stacked area chart or a percentage area chart.
01:28A pie chart--and again, this is one of the most basic and most familiar types of charts--shows
01:33contribution of components to a whole.
01:36A doughnut chart does the same thing, just in a slightly different format.
01:40You can change the size of the doughnut so that its size is proportional to the total
01:45amount of all values summarized in the chart.
01:48A 3D Riser is simply a 3D column chart with vertical bars going up.
01:53A 3D Surface chart plots data on three axes with time often plotted along the major or x-axis.
02:00This is typically used in scientific functions, and you might not run into in the business that often.
02:06What you have probably run into, though, is an XY scatter chart.
02:09This plots data points along two independent axes that aren't related to each other.
02:14So, for example, one of the most common examples is plotting temperature versus rainfall, or
02:19you might also plot the number of visitors to a company's website versus the number of
02:24orders that were placed on a given day.
02:27A Radar chart, which again is used mostly in scientific or statistical studies, shows you
02:32a relationship among data and how they fit into patterns.
02:36A Bubble chart is like a scatter chart, which I showed you earlier, but it compares three
02:41sets of values rather than two.
02:44The third value is displayed by the size of the bubble at each data point. So, let's say
02:48for example that you had an XY scatter chart that showed the number of visitors to a website
02:54and plotted that against the number of orders placed on a given day.
02:58The third axis could be the value of all of those orders, and the size of the bubble would
03:02reflect that value.
03:04A Stock chart is used to determine the behavior of stock data, or to represent it in graphic
03:09form. So, for example, you can have a high-low stock chart which indicates the high value
03:14and the low value for a day, or within Crystal Reports, you can have the high-low-open-stock
03:19chart which shows the opening value as a line and then also displays the high and the low.
03:24A Numeric axis chart is great for showing data across time or as a value trends along
03:30the main horizontal axis.
03:33So for example, you can show the data across time as either a line chart, a bar chart,
03:38or an area chart.
03:40A Gauge is a dial that shows a small number of values.
03:43So let's say that you want to show the capacity of a manufacturing plant.
03:48Let's say that it was running at 70% capacity, 75% capacity, 80%, or whatever. You can use
03:54a gauge to show that.
03:56A Gantt chart is often used for project planning.
03:59It shows the start of a given task within a project and also the end, and it shows whether
04:04those tasks are dependent and how they interrelate.
04:07If you've ever used Microsoft Project then Gantt charts, I am sure, are very familiar to you.
04:12The final two carts I would like to discuss are the Funnel, which is commonly used in customer
04:16relationship management.
04:18Let's say for example that at the top of the funnel were the number of phone calls, the
04:22second level would be the number of follow-up phone calls, and the final area--the smallest
04:28area--would be the number of orders that were replaced by your customers.
04:31Finally, there is the Histogram.
04:33That shows the frequency of occurrence of data elements in a data set.
04:37So let's say for example that you were looking at the values of orders, and you would want
04:41to know the number of orders that were less than $100, between 100 and $200, between
04:46200 and 300, and so on.
04:48You could use a histogram to summarize that data visually.
04:52In the rest of this chapter, I will show you how to create, format, and modify your charts
04:56to present your data most effectively.
05:01
Collapse this transcript
Creating a chart
00:00After you bring your data into Crystal Reports, you can summarize it visually.
00:04By creating a chart, you allow your audience to view the data all at once without forcing
00:09them to summarize individual lines of data on their own.
00:13My goal for this movie is to create a simple chart that displays the number of calls for
00:17the years 2011 and 2012.
00:21To do that, I will go to the Insert toolbar and click the Insert Chart button and then
00:29I will move to position my mouse pointer so that it's in Report Headers C. And you
00:34can see the gray outline of the box indicating where the chart will go in Report Header c.
00:40So, I will click for left mouse button and when the do you the Chart Expert appears.
00:46The default chart type in Crystal Reports is a vertical bar chart, also called a column chart.
00:52If I wanted to change the chart type, I can click the Type tab and select any of the
00:57other chart types from the list that is available.
01:00But in this case, I do want to use the default, which is the Side by side bar chart.
01:05With that chart type selected, I can click Data to identify the data that I want to appear
01:11in the body of the chart.
01:12I wanted the data to be arranged by year,
01:16so I am going to click the Sheet1_Year field and then under On Change of, I will click the Add button.
01:25So what that means is that Crystal Reports, in this chart, will create a new bar for each
01:30year and will summarize all data that apply to a particular year, in this case 2011 and 2012.
01:38I want to summarize the call data, so I will click Sheet1_Calls, and then in the Show Values
01:44list, I will click the Add button there.
01:47So that means the chart will show the sum of all calls for 2011 and 2012.
01:53I do not want to make any other changes right now, so I'll click OK and when I do, my chart
01:57appears in Report Header c. And as with other objects, I can resize the chart, such as by
02:04grabbing one of the handles on the corner and pulling up it to make smaller, or if I
02:09want undo that change,
02:11I can click the Undo button on the standard toolbar.
02:15You can create a Crystal Reports chart quickly by following the steps that I described in this movie.
02:20If you find that one chart does not present your data in exactly the way that you want it
02:23to, you can always create another one.
02:28
Collapse this transcript
Creating a chart using the Group layout
00:00When you group data within a report, you change the data's organization.
00:05Those changes are reflected in the chart that you create based on that data.
00:10In this movie, I am going to show you how to create a chart that summarizes grouped data.
00:15This report contains grouped data. I have call data for 2011 and 2012, and I have it
00:22grouped based on the five call centers that are available: Austin, Boston, Vegas and so on.
00:28My goal is to create a chart that reflects the group organization within the report.
00:33To do that, I will click the Insert menu header and then click Chart.
00:40When I do, an outline appears, and I can drag that outline by moving the mouse pointer to
00:47the area where I want to drop the chart,
00:49in other words, where I want to place it. I want to place it place it in Report Header
00:53c, so with the outline there, I will click the left mouse button and the chart appears.
00:58This chart represents the summaries that I have within the report.
01:02So if I scroll down, you could see that I have summaries for 2011 for each of the individual
01:09call centers, and if I go to Page 2 and scroll up, you can see that there is a summary for
01:16the year 2011, and that is 64,000 calls, and for 2012 its 67,000 calls.
01:23So if I go back to Page 1 by clicking the Show Previous Page button on the Navigation
01:28bar, and scroll up,
01:31you can see that those amounts are reflected in the body of the chart.
01:35If I want to edit the chart--that is, change out summarizes the data--
01:38I can click the Design tab to go over to Design view, right-click the chart, and then click
01:44Chart Expert. And from here I can change anything I want about the chart.
01:49For example, I can change the chart type if I wanted to,
01:51but in this case what I want to do is to change the way the data is laid out, so I will click Data.
01:57Now notice that I have the Group tools available to me within Layout. That reflects the fact
02:03that I have a report that contains grouped data and those groups have summaries.
02:08So what I can do is change how the chart summarizes the data visually.
02:13The one thing that I can change in this particular chart is how many bars it draws.
02:18For example, right now it is only displaying a different bar for each year and that is
02:22reflected in the On Change of Year value here.
02:26I have another summary for each individual center.
02:29So if I click the On Change of control, then I can have Sheet1_Year and Center.
02:35So I'll go ahead and click that. I do not have any other summaries other than calls, so if
02:40I were to click that control, I would not see any other options, so you do not need
02:44to worry about that one in this case.
02:46But if you have multiple columns within your report that could be summarized then you will
02:51probably see them there.
02:52So with that in place, I will click OK. And the preview of my chart has changed in Design
02:58view, but if I click Preview to view the chart as it will be displayed, I can see that I
03:04have the number of calls for each of the centers broken out by year: 2011 and 2012.
03:10And that is how you create a chart using grouped data within Crystal Reports.
03:15
Collapse this transcript
Creating a chart using the Cross-Tab layout
00:00One way to summarize data in Crystal Reports is to create a cross-tab.
00:05A cross-tab summarizes data in a grid with headers for both rows and columns.
00:10I cover cross-tabs in great detail in a separate chapter later on in this course,
00:14but I wanted to show you how to create charts based on the data in this chapter because
00:18that is where all the charting material is.
00:20So this report contains a cross-tab, and it has sales data for two sales representatives,
00:26and it goes across California, Colorado, Idaho, Oregon, and Washington, and also, there are varieties
00:32of payment methods.
00:33So now to insert the chart, I will go up to the Insert menu and click Chart, and then
00:42with the outline in place, I am going to move the mouse pointer down to the Report Header
00:47b section and click the left mouse button.
00:51When I do, the Chart Expert appears. I have a new option available to me and that is Cross-Tab
00:56under Layout, so I will click that, and I can select how I want to lay out the data.
01:02I have On change of, Subdivided by, and Show.
01:06On change of means that the data will be organized at the first level by State, and that is correct.
01:12I want to do that.
01:13My other option would be Sales_Rep. But in this case I do want to stay with State as
01:18the primary division within this data.
01:21I want it subdivided by Sales_ Rep, and that is my other option.
01:26So I will click the Sales_Rep item under Subdivided by. And I want to show the Order_Amounts;
01:32in other words, I'd like to total of all the sales, so I will click OK, and when I do--
01:40scrolling down--my chart appears inside of Report Header b. And I see by the legend that
01:46all of the bars in blue are for Jones and all the ones in orange are for Smith.
01:52There is a missing blue bar about the state of Colorado, but that is just because I have
01:57looked at the data and I know that Jones had no sales for Colorado during the period that
02:01we are looking at in this data set.
02:04Cross-tabs let you summarize your data concisely in Crystal Reports 2011, and the charts are
02:08just as effective.
02:13
Collapse this transcript
Formatting chart elements
00:00After you add a chart to a Crystal Reports report, you can change the location and appearance
00:06of the chart's elements.
00:07In this movie, I will show you how to change the format of the most common chart elements
00:12in Crystal Reports 2011.
00:14To work with a chart and change its formatting, you can display your chart in Preview mode
00:19and then click the chart.
00:22Doing so causes a new chart menu to appear on the menu bar.
00:27You can then click the Chart menu header and from there you can select a series of options.
00:32The first one I'd like to show you is Format Background.
00:37You can use the controls in the Format Background dialog box to change the background of your chart.
00:42And this is the confusing part, but it's just the way that this dialog box is laid out:
00:47Foreground Color actually changes the background of the chart.
00:51In other words, this isn't a color layer that gets layer that gets laid over the top of
00:55the chart; it's in the background.
00:57So just understand that that's a little bit confusing.
01:00It confused me the first time I tried it. But changing the Foreground Color setting
01:04will change the background color of your chart.
01:07So I'm going to select a light gray, and when I do, that color appears in the background.
01:14I could also select a pattern if I wanted to, by clicking Pattern, Gradient, Texture, and Picture.
01:19All those options are available to you, and I invite you to explore them.
01:23To save my change, I'll go ahead and click OK.
01:27Another tool that's available to you under the Chart menu is the Chart Options dialog box.
01:33So I'll click the Chart menu header and then click Chart Options.
01:38You can use the controls in the Chart Options dialog box to change the chart's overall appearance,
01:43its titles, data labels, and so on.
01:45So let's say, for example, that I want to show labels for the data.
01:49If I select or check the Show Labels dialog box, then Crystal Reports displays the values
01:55for each one of the vertical bars.
01:58And then I can change the label's location and also the format if I want to.
02:02I can also change the formatting of the legend, and that is this box here on the right side
02:08of the chart, which indicates that blue bars represent sales by Jones and orange bars represent sales by Smith.
02:15So if I click the Legend tab, I can get rid of it by clearing the Show Legend checkbox,
02:20or I can do any other number of things like changing markers, changing the box style,
02:25its color, and so on.
02:27On the Gridlines tab, I can affect the gridlines that appear inside the body of the chart.
02:33So let's say for example that I wanted to have gridlines for each of the groups.
02:37I can click the Major Gridlines button, and when I do, vertical lines appear.
02:42But in this case for this chart, I think that it's pretty obvious where the separations
02:46are, so I'll go ahead and clear that checkbox.
02:49But it's a good thing to keep in mind if your data isn't separated as clearly as it is in
02:53this particular chart.
02:55Then on the Axes tab, you can decide whether to show or hide group axes.
03:00For example, if I clear that checkbox, then we don't see the states that are listed at the bottom.
03:05But that is important information, so I'll check it to bring it back.
03:09And you can also change the way that the data is displayed, based on the type of data that you have.
03:15For example, if you have time data, then you should select the Show Time Scale option.
03:20If you have numeric data, then you can do the same thing by showing the Numeric Scale.
03:25If you clear the Show Data Axes checkbox, then you don't get the values on the Y axis--
03:32in other words, the vertical axis--that gives you a relative sense of what the numbers would be.
03:36Because we have data labels applied at the moment, that's not a big deal, but I actually
03:41do like to keep the data axes displayed so that I don't have to look to the middle of
03:46a particular bar.
03:47I can just look at the top and get the relative magnitude of each of the values.
03:52So with all those changes in place, if I click OK, Crystal Reports applies them to the body of the report.
03:58I've only had time to go over the most common formatting changes you can make with chart elements.
04:03Feel free to experiment with the rest of the interface and use the techniques that I described
04:07to change those aspects of your chart as well.
04:12
Collapse this transcript
7. Selecting Records in a Report
Selecting records within a single field
00:00When you summarize data in Crystal Reports, you are often interested in the overall patterns
00:05or how a set of records holds together.
00:08If you want to focus on a particular value, then you can do so by selecting records based
00:12on the value in a single field.
00:15For this movie, I am going to show you how to select values using values from a single
00:19field of your report.
00:20My goal for this movie is to display values first for Austin and then for Austin and Boston.
00:27So I am going to create a selection rule that does exactly that.
00:32To create that rule, I will open the Report menu, point to Select Expert, and then click Record.
00:42Then in the Choose Field dialog box, I want to select Center, because the call centers
00:47relate to cities Austin, Boston, and so on.
00:50So with Center selected, I will click OK.
00:54Doing so causes the Select Expert to appear.
00:57The first thing I need to do is to identify the type of rule that I want to use.
01:02If I want to display all of the values, then I can use the "is any value" rule, but if
01:07I click that control, I display a list of all the other rules that are available to me.
01:12These comparison rules are probably familiar to you" "is equal to," "is not equal to,"
01:17"greater than," and so on.
01:19The rule I am going to use for this movie is "is one of."
01:23What that rule allows me to do is to type in a list of values and indicate to Crystal
01:29Reports that I only want to see records that contain a value from this list in the Center field.
01:35So the first one will be Austin, and I will click add.
01:41When I do, that value appears in the list.
01:44I am only interested in calls for the Austin center, so I will go ahead and click OK.
01:49Crystal Reports asks if I want to use the saved data from the original version of the report. I do,
01:55so I will click Use Saved Data.
01:57If I thought that the data might have changed, then I would click Refresh Data, but this
02:02is historical data that will definitely not change, so all click Use Saved Data, and
02:08when I do, I see records only from the Austin center.
02:12I can add more terms by going back into the Select Experts, so I will click Report > Select
02:18Expert > Record, and now I can add more values.
02:23So let's say that I wanted to work Austin and Boston, so I will type in "Boston" and click the Add button.
02:31So now I have those two values in my list. And in this case order doesn't matter; just
02:36as long as the value is in the list, you are fine.
02:39If for some reason you wanted to remove a value, you could select it and then click
02:43the Remove button.
02:45But in this case I want both Austin and Boston to stay, so I will click OK. And again, I
02:50will use the saved data, and now my report contains all of the records that apply to
02:55Austin and Boston.
02:58Crystal Reports lets you focus on your data using the values in a single field.
03:02You can also focus on your data using the values in more than one field.
03:06I will show you how to do that in the next movie.
03:11
Collapse this transcript
Selecting records using multiple fields
00:00When you examine data in Crystal Reports, you might be interested in particular sets
00:05or subsets of values.
00:07For example, you might only want to look for data about calls to call centers that occurred
00:12within the first quarter of the year.
00:14In this movie, I will show you how to find that data by selecting records using values
00:19in multiple fields.
00:21Just like I did in the last movie, I want to create a rule that displays values for
00:26particular call centers.
00:28To create that rule, I will open the Report menu, point to Select Expert, and then click Record.
00:35Then, in the Choose Field dialog box, I want to focus on centers, so I will click the Center
00:41field and then click OK.
00:45Now, in the Select Export dialog box, I can create the type of rule that I want.
00:49I want to identify centers that are part of a list of values that I supply, so I will
00:55click the "is any value" control and then click "is one of" and now I can type in the values for the list.
01:02The first will be the city of Austin and click Add, and the second is Boston so I will
01:09click back in the box where I can enter values and type "Boston" and then click Add.
01:16I want to create additional criteria--so I will click New--this allows me to add a second
01:21rule, and this will be based on quarter. So remember, I am looking for values in the first
01:27quarter of the year.
01:28So from the Report Fields list, I will click Quarter, then click OK.
01:32I am interested in the calls from the first quarter, so I will set my comparison operator
01:38to "is equal to" and then in the value box to the right, I will type 1.
01:44Now I can click OK because I have completed the rule. And Crystal Reports asks if I want
01:50to use the saved data. This is historical data that probably hasn't change, so I can
01:54click Use Saved Data, and when I do, the values for quarter number one for Austin and Boston
02:01appear within the body of the report.
02:04The search rules that I have described in this movie let you narrow down your data significantly.
02:09If you create multiple rules, you can focus on exactly what you need to get the job done.
02:14
Collapse this transcript
Creating selection rules using the Or operator
00:00Most of the selection rules you create in Crystal Reports use the "and" operator.
00:06When you use "and," each of the rules you specify must be true for a row to be displayed within the report.
00:13If you want to display a row, if one of several values occurs, then you can use an "or" operator.
00:19In this movie, I will show you how to create selection rules that use "or" instead of "and,"
00:24Actually, that's a bit of a misnomer, because you first need to create a rule that uses
00:29"and" and then edit it so that it uses "or."
00:33I've left the selection rule that I created in my last movie implemented here in the report.
00:38I am looking at results for Austin and Boston that occurred within quarter number 1.
00:44But let's say that I wanted to see results from Austin and Boston or any other center
00:50that occurred during quarter number 1.
00:52If I want to create that type of rule, then I can edit the rule that I currently have
00:57to make that possible.
00:59To display my rule, I will open the Reports menu, point to Select Expert, and click Record.
01:05And here I have my rule.
01:07If you look down in the text pane, you will se that the rule is spelled out in more or
01:13less plain language.
01:14We are looking for the center from the list of either Austin or Boston and the Quarter = 1.00.
01:23If I want to have Austin or Boston displayed or any results from quarter number 1, all
01:29I have to do is edit the text so that instead of "and," I have "or."
01:37With that in place, I can click OK, indicate that I want to use the saved data, and I have
01:44every result from Austin and Boston, plus all of the first-quarter results from Las
01:50Vegas, Seattle, and St. Louis.
01:52"Or" operators give you a lot of flexibility when you create selection rules, and of course,
01:57you're not limited to single "or." You can have multiple "ors" to expand the list of
02:01acceptable values.
02:06
Collapse this transcript
Selecting records based on dates
00:00Many business data collections include dates. It might be the date of an order, the date
00:06a call was received, or the date a shipment is expected.
00:09In this movie, I will show you how to select records that include dates.
00:14My goal is to select records from the data source that meet certain date criteria.
00:20So for example, I might want to select records for a particular date.
00:24To do that, I open the Report menu, point to Select Expert, and then click Record.
00:32Then, in the Choose Field dialog box, I can click the field that contains the dates that
00:36I want to select on; and in this case, it is Date, and click OK.
00:42Now, I can define my selection rule.
00:45I want to have a specific date, so I want to create an "is equal to" rule.
00:50So I will click the selection operator control and click the second item which is "is equal
00:56to." And now I can type in the date I want to select, and I'll make that 4/16/2012.
01:05So I'm looking for records from April 16the of 2012.
01:09When I click OK, I am given the option to use saved data or to refresh data.
01:16This is historical data, so it shouldn't have updated,
01:19so I will go ahead and click Use Saved Data.
01:22Doing so causes all the records from the day I identified, April 16, 2012, to appear in the report.
01:28Now, if I want to undo that selection, I can click the Undo button, and Use Saved Data,
01:35and all the data reappears back in the body of the report.
01:38If I want to identify records from a set of days, then I can create a similar rule.
01:44I'll do that by clicking the Report menu, then point to Select Expert, and click Record.
01:50In the Choose Field dialog box, I click the Date field and click OK.
01:55Now, instead of saying "is equal to," I can say "is between."
02:01So now I can identify the starting date and the ending date.
02:04So I will make it 4/16/2012, then click in the second box and type 4/17/2012, and then
02:14when I click OK, say that I want to use the saved data,
02:19then I see all the records for April 16 and April 17 of 2012.
02:22And again, to undo the sort, I will just click the Undo toolbar button, use the Save Data,
02:29and it's all back.
02:30There's one other way that you can identify periods of dates that you want to use.
02:35So, I'll go back into the Report menu, Select Expert, click Record, and as I did before,
02:43I will identify the Date field and click OK.
02:46Now, if I click the comparison operator control, I can select "is in the period."
02:51When I do, a second control appears to the right, and it gives me a list of periods that I can select.
02:57So for example, I could select the week to date from the previous Sunday or if I click
03:03the list, you see a long list of other periods that you can define: MonthToDate, YearToDate,
03:09Last7Days, and so on.
03:11You and I are separated in time, and all of these periods are based on the present day,
03:17so if you were to do what I'm about to do, you will probably see different results.
03:21But just to give you an idea of what it would look like, I'm going to select the last seven days of data.
03:27So I will click Last7Days and then click OK. Use Saved Data.
03:32So what I see is data starting on April 12. And if I go up to the Navigation toolbar
03:40and click Show Next Page, I see values from April 18.
03:45So those are my last seven days of data: April 12, 2012 to April 18, 2012.
03:51Selecting records based on dates in Crystal Reports is extremely powerful because it
03:55lets you focus on your most recent data, or data from a specific period, so that you can
03:59find the answers you need.
04:04
Collapse this transcript
Selecting records using formulas
00:00So far in this chapter these selection rules that I've created use the simple rules
00:05as opposed to formulas.
00:07Formulas could be as complex as you'd like to make them.
00:10In this movie, I will show you how to create simple formulas and then you can use the techniques
00:14I show you to create any selection formula you like.
00:17My goal for this movie is to display records in the report that reflect a call volume of
00:23greater than 3500 per quarter, and that call volume appears here in the right-hand column.
00:28So again, what I want to do is display only those rows where this value is greater than 3500.
00:36To do that, I can create a formula-based selection criteria.
00:40So I'll go up to the Report menu, point to Select Expert, and click Record.
00:47Then, in the Choose Field dialog box, I'll click Calls--that's the value that I want to work
00:52with--and click OK.
00:55Within the Select Expert dialog box, instead of selecting a criteria from this list, I
01:00want to create a formula, so I'll click the Formula Editor button. Doing so opens the
01:05Formula Workshop.
01:07Now, within the Formula Workshop, I can create the formula that I want. It's going to be
01:12based on the Calls field, so in the list of fields, I'll click the expand control next
01:18to Report Fields and now in the list of fields available to me, I'll double-click Sheet1_Calls,
01:24so that it appears in the formula text pane.
01:27Now I'm going to type in the formula so that it reads Sheet1_Calls with a space greater
01:33than, space, 3500, so 3500.
01:37So this formula will identify any rows that contain a call value of greater than 3500.
01:43I'll go ahead and click Save and Close and the formula appears here in the bottom of
01:49the text pane, so I'll click OK.
01:52As I've explained in previous movies, I do want to use saved data instead of refreshing.
01:57And when I click OK, my report only contains values greater than 3500.
02:02Using formulas to select records gives you a lot of flexibility. I've only shown you
02:06the most basic examples, but as you gain facility using formulas, which you'll learn about in
02:11detail in a later chapter, you'll find a lot of ways to use these criteria to your advantage.
02:16
Collapse this transcript
8. Managing Reports Using Parameter Fields
Creating a parameter field by entering a list of values
00:00Parameters fields are fields that let you filter the records that appear in a report
00:05by selecting a value.
00:07For example, if you have Month as a parameter field, then you can select one of the 12 calendar
00:12months and limit the records displayed to just those in that month.
00:17In this movie, I will show you how to define parameter fields and let you select from a
00:21static set of values.
00:24This report contains data about five separate call centers, and they are listed here.
00:29My goal is to create a parameter field that will let us select one of those cities and
00:34limit the data to just that call center.
00:37To create the Parameter field, go over to the Field Explorer. It's at the right side
00:41of the program window.
00:44If you don't see the Field Explorer, you can go up to the Standard toolbar and click the
00:48Field Explorer button to display it, then click Parameter Fields, and click the New button.
00:55When you do, the Create New Parameter dialog box appears.
00:59Now you can type in a name for your parameter, and I will call it Center.
01:04The type of data reflects the type of data that is in a particular field.
01:09This is String data, in other words, text, so we can leave it alone. And we will be creating
01:14a static list of values.
01:17A static list of values is a list that you type in yourself.
01:21It's not based on any field in the original data source.
01:24That's a dynamic list and we will cover that in the separate movie.
01:28With those settings in place, we can type in our Values, so click in the Click here
01:32to add item box in the Value pane, and then type in the first city, which is Austin.
01:39And it is absolutely vital that you type in the names accurately.
01:43If I were to type in, instead of Austin with an I, I would type in Auston, then if I selected
01:51it, it wouldn't match anything, and no records would be displayed. So, spelling counts here.
01:55So we have Austin, press Enter, then click here; Boston, Enter, and click; Las Vegas,
02:07don't forget the space, click again; Seattle, Enter, and click for the final one, which is St. Louis.
02:17Now that I have created my list, I can click OK.
02:21Next, I need to create a selection rule that will allow me to select one of those parameter values.
02:26To do that, click Report on the menu bar, point to SelectExpert, and click Record.
02:34Then in the Choose Field dialog box, click Sheet 1_Center, because we want to select
02:39a call center, click OK, and now in the Select Expert dialog box, you need to create a rule
02:47where the Center field is equal to your parameter.
02:50Instead of "is any value," click the comparison operator control here, click "is equal to."
02:56Then you click the control next to it. It shows a down arrow and it's currently blank,
03:01and now you need to identify which value you want it to be equal to.
03:05You don't what it to be equal to any of the values that you typed in; instead, what you
03:09want it to be equal to is whatever the current value of the center Parameter field you created is.
03:16A Parameter field is identified with the name in curly brackets and with a question mark
03:21in front of the name.
03:22So question mark center is your Parameter field.
03:25Go ahead and click it and then click OK to create the rule.
03:29When you do, the Enter Values dialog box appears.
03:31Now remember--and I will just slide this dialog box to the side for a moment--
03:36we have data from all five call centers currently displayed.
03:39If I click the Enter Center control's down arrow and select Austin and click OK, then
03:46only data from Austin appears in the body of the report.
03:51If you see a dialog box asking you to either refresh your data or connect to a data source,
03:56you can do so using techniques that you have learned elsewhere in this course.
04:00Now let's say that I want to change it.
04:01I want to display perhaps St. Louis.
04:04To do that, I go over to the Parameters List, which is here in the left-hand pane of the
04:10program window. And if for some reason that isn't displayed, for example, if you click
04:15on Groups or something else, you can click the Parameters box at the bottom to redisplay it.
04:23To give yourself the opportunity to enter another parameter, click the Prompt for Parameters
04:28button. This displays the Enter a Value dialog box again. Select a new value, such as St.
04:35Louis and click OK.
04:37Now notice that the report hasn't changed to reflect the parameter choice. You need
04:42to go back to the Parameters pane and click Apply Changes.
04:46It's the button that looks like a green arrow.
04:49When you do, your report updates.
04:51Entering a static set of values is great for lists that either never change or don't change frequently.
04:57Abbreviations for states, in the United Sates, are great example of data set that works well
05:01for a static list.
05:06
Collapse this transcript
Defining default parameter values
00:00When you define a Parameter field, you allow your users to select from a set of values.
00:06If one value will be selected much more frequently than the others, such as standard shipping
00:10for an online retailer, then you can set the value as the default.
00:15In this movie, I'll show you how to assign a default value to a parameter.
00:19I have already created a parameter field and I currently have the parameter values set
00:24to quarter number 4.
00:26What would I like to do, though, is to assign a default parameter value of 1, so that way
00:32whenever someone opens the report, Crystal Reports will display the data for quarter
00:37number 1 because that is what is more frequently requested.
00:41To do that I need to edit the Parameter field, and it's over here in the Field Explorer pane.
00:46Again, if you don't see the Field Explorer, you can go up to the standard tool bar and
00:50click the Field Explorer button. So click Quarter and then on the Explorer toolbar
00:56click the Edit button.
00:59Here you can see the details of the Parameter fields I created.
01:03Its name is Quarter and it is a number and it is a list of static values, and the values
01:09are listed here in the Value list.
01:11To assign a default value, you go to the Value Options area and scroll down just a bit to
01:17see the default value.
01:20You can then click in the box to the right of the default value label and select the
01:25value by clicking the down arrow.
01:26I have the values 1, 2, 3, and 4, so I will click 1 and click OK.
01:33When I do, I have assigned the default value of 1 for the quarter.
01:37One interesting thing to note is that Crystal Reports only looks at the default value once.
01:42In other words, the next time you open the report, the default value will be whatever
01:46you set it to be.
01:47However, if you change it, then whatever value is saved with the report is what will appear
01:52the next time you open it.
01:57
Collapse this transcript
Defining multi-value parameter fields
00:00Filtering the records in a report using a Parameter field lets you focus on the data
00:05that is most important to you.
00:06So far in this chapter I have shown you how to define a single-value Parameter field.
00:11In this movie I will show you how to define Parameter fields that let you select multiple
00:16values at the same time.
00:18This report contains an existing Parameter field called Quarter. It is over here in the Field Explorer.
00:24If you do not see the Field Explorer, you can go up to the standard toolbar and click
00:28the Field Explorer button to display it.
00:30As currently configured, the Parameter field only allows a single value,
00:35so I want to go in and change it.
00:37If you need to review how to create a Parameter field you can go back to the first movie in this chapter.
00:41But for now, I will click Quarter, which is the Parameter field, and then click the Edit button.
00:48Just too quickly look at what the Parameter field is, it's named Quarter and is of Type
00:54Number--in other words, it contains numeric values--and it is a static list which I entered
01:00here in the Value list.
01:02So now what I want to do is allow multiple selections at the same time.
01:07To do that, I will go in to the Value Options area and scroll down and here it says Allow multiple values.
01:15I will click over on the side of the line where it says False. This displays a list,
01:20and I am going to change that property's setting to True and then click OK.
01:26So now when they enter Values Dialog Box appears, like it did in previous movies, we can select multiple values.
01:33So if I wanted to see only the data for quarters 2 and 3, I could click 2 and then click the
01:39Add button. And then the highlight moved down to 3 automatically, so I will click Add, so we have 2 and 3.
01:49If I wanted to remove one of those values, I could select it and click Remove or to remove
01:54all of them, I could click All.
01:56But I do want to look at 2 and 3, have that as my filter, so I can click OK. And when I
02:03do, data for Quarters 2 and 3 appear inside the body of the report.
02:08If Crystal Reports displays a dialog box asking you either to identify the data source or
02:13to make a connection, then you can connect to the call data file using the techniques
02:18that you've learned elsewhere in this course.
02:21Letting users select multiple values in a Parameter field gives them the power to display
02:24just the data they are interested in. Rather than go into one value at a time and try to
02:30keep the numbers in their head when they change the Parameter value, multiple values puts
02:34all of the data in the report at one time.
02:38
Collapse this transcript
Allowing dynamic parameters
00:00So far in this chapter, I have described Parameter fields that use a static set of values.
00:06In this movie, I will show you how to create a Dynamic Parameter field which draws its
00:11values from a data source, such as the original data source, Excel workbook, or a field within the report.
00:18This data file, which we haven't seen before in this course, tracks prices for two types
00:23of products, two departments: Windows and Doors.
00:28There's always the possibility that my business could grow and add more product lines, more
00:33departments, so what I want to do is to create a Parameter field that would work with whichever
00:38product departments I have in place.
00:40But I will start by applying it to just Windows and Doors.
00:44The first thing I need to do is define my Parameter field.
00:48So I will go over to the Field Explorer on the right side of the program window.
00:52If you don't see it, you can go up to the standard toolbar and click the Field Explorer button.
00:58In the Field Explorer, click Parameter Fields and then click the New button.
01:05In the Create New Parameter dialog box, you can type a name for your parameter.
01:09I will make it Dept, short for department. The value type is a string. That is it's text.
01:17As for the List of Values, I want to change it from Static to Dynamic, and when I do,
01:24the Create New Parameter dialog box changes.
01:27Now I can select a new data source by going into the Value list, and when I click Click
01:33here to add item, I can select a column within that data source.
01:38And in this case, I want the ProductDept, which is here.
01:43I don't need to make any other changes, so I can click OK and I've made my Parameter field.
01:49But now I need to create a selection rule that allows me to select any value from the
01:54Department field.
01:56To do that, open the Report menu, point to Select Expert, and click Record.
02:03Under Report Fields, I can click ProductDept and OK.
02:08I want to set the Product Department equal to the value that is currently displayed in
02:14the Department Parameter field,
02:16so I'm going to change the comparison operator to "is equal to,"
02:21then click the down arrow in the control to the right to identify the data source, and
02:26that will be the Department Parameter field.
02:29By way of review, a Parameter field appears in curly brackets with a question mark in front of it,
02:35so that's how you can identify it as a parameter.
02:38I'll click that, everything looks good, and I will click OK.
02:42When I do, the Enter Values dialog box appears.
02:45If Crystal Reports displays a dialog box asking you either to use saved data or to connect
02:51to a data source, then you can do so using the techniques you've learned elsewhere in this course.
02:56Now, I can select one of the two departments.
02:59I will select Windows and click OK.
03:03When I do, Crystal Reports filters the document so only Windows appear.
03:07If I want to switch over to Doors, I can go to the Parameters panel on the left side
03:12of the user interface, click the Prompt for Parameters button, and then under Enter ProductDept,
03:22click Doors, click OK, and then, again in the Parameters panel, click the Apply Changes
03:29button--it looks like a green check mark--and Crystal Reports applies my setting to the report.
03:35Dynamic parameters are perfect for value sets that could change rapidly.
03:39For example, if you run an international shipping business, you might get orders from businesses
03:44in countries from which you've not received orders before.
03:47Rather than enter those countries names into a static list, you can use the data from your
03:51customer table to populate the values for your parameter.
03:56
Collapse this transcript
Editing and deleting parameter fields
00:00After you create a Parameter field, you can change it, such as by adding a default value,
00:05or delete it entirely.
00:07In this movie, I will start by showing you how to edit your Parameter fields, and then
00:11how to delete them.
00:13When you open the exercise file, you will see that it has a Parameter field called Department.
00:19And I've already applied a parameter value so that I'm only displaying doors within this report.
00:27There are actually products for both doors and windows.
00:30If I want to edit the Parameter field, I can select it in the Field Explorer. And again,
00:37if you don't see the Field Explorer, you can go up to the standard toolbar and click the
00:42Field Explorer button. But then with the Parameter Field selected, click the pencil button, which is Edit.
00:51Using the tools in the Edit Parameter dialog box, you can give your parameter a new name,
00:56change how it gets its values, either from a dynamic source or from a static list you
01:00type in. You can also change its Value Options.
01:04For example, you can change its sort order. Instead of ascending by value, you can go
01:09descending by value or ascending by description or descending by description.
01:14You can also change the prompt text. For example instead of saying Enter Product Department,
01:22you can edit that just by selecting the text and using the keyboard, and saying "Enter a
01:29product." And there are other options that you can change; I'll leave those for you to explore on your own.
01:35When you're done making your changes, you can click OK and the Crystal Reports applies them.
01:41If you want to rename your Parameter field, you can click the Rename button, which highlights
01:46the name, and then you can type a new name, such as Dept, and press Enter.
01:52If you want to delete the field entirely, there isn't actually a button that lets you do that.
01:57Instead, you need to right-click the Parameter field and click Delete.
02:03First, you have to delete the select rules associated with the field.
02:08You've seen how to do that elsewhere in the course. Then you can continue on with this procedure.
02:14If your Parameter field appears in the body of the report, Crystal Reports will display
02:19a dialog box indicating that's the case.
02:22If you want to delete it, click Yes; if you don't, click No.
02:26I'll go ahead and click No and leave the Parameter field in place.
02:31Editing a Parameter field is a lot like creating it.
02:34You can go in and change pretty much every aspect of the Parameter field that you want,
02:38and you should do so to meet the needs of your growing business.
02:43
Collapse this transcript
9. Summarizing Data Using Formulas
Introducing the Formula Workshop
00:00So far in this course, I have shown you how to create reports and then to modify them,
00:05either by changing their format or by selecting which records appear.
00:10What I'd like to do now is to show you how to customize your reports by adding custom calculations.
00:15To do that, you will use the formulas and functions available to you in Crystal Reports.
00:21You get at that functionality through the Formula Workshop, and I'd like to introduce
00:25that to you in this movie.
00:27Let's say that I want to add a custom calculation to this report.
00:31I can do that by going over to the Field Explorer, clicking Formula Fields, and then clicking the New button.
00:38If you don't see the Field Explorer in your Program window, then you can display it by
00:42going to the standard toolbar and clicking the Field Explorer button.
00:47My Field Explorer is already open, so I'll just go over, and with Formula Fields selected,
00:52click the New button.
00:54Now I can type a name for my formula and I'll just call it Sample, and click the OK button.
01:01So here's the Formula Workshop, and the lower part of the workshop is divided into five panes.
01:08This pane here, the largest one in the bottom-right, is where the formula itself will appear.
01:13To the left, there is a series of assets that are available to you.
01:18Those are Formatting Formulas, Selection Formulas, SQL Expression Fields, and so on.
01:23We won't actually be using any of those in any of the movies in this course, but I wanted
01:27to let you know that they were there so you didn't wonder.
01:30The second pane along the top row contains the report fields and any summaries that you've included.
01:36So for example, here we have the group that is based on Center, and then we have our Sample formula.
01:42To the right, we have the list of functions that are available to you.
01:45You might need to click the expand control next to Functions to display the entire list.
01:50And when you do, you see a list of all the categories of functions that are available
01:53to you, and you can click inside of those by clicking this command control such as for
01:59the Math subcategory, and you get the mathematical functions that are available to you.
02:05To the right--and again, you might need to click your expand control to display all the
02:10operators that are available to you.
02:13Operators are actions that you can take within a formula.
02:16So the most common examples would be addition, subtraction, multiplication, that sort of thing.
02:21Now, just as an example, I'll create a very simple formula.
02:24Let's say that in my business I owed taxes at the end of the tax year, but the rule in
02:29my jurisdiction is that I can just omit any cents on the dollar.
02:34In other words, I only have to pay the whole dollar amount; I don't have to worry about any cents.
02:39I can just leave it off and not worry about rounding up or down.
02:42The function for calculating the integer part of a number in Crystal Reports is Int.
02:48So I have Int and then I'll type a left parenthesis and the number 4011.56.
02:54It can be any number, as long as it has some sort of a number to the right of the decimal point.
03:00So this formula would take the integer value of 4011.56.
03:05I'll click Save and close, and then my new formula field appears in the Field Explorer
03:13underneath Formula Fields.
03:15And if I drag it onto the body of the report-- and I'll just put it here on the report header--
03:19the integer component of 4011.56 appears, and that is 4,011.00.
03:27One other thing I'd like to show you about the Formula Workshop is how to get help.
03:31To do that, I'll reopen the Formula Workshop by clicking Sample and then click Edit.
03:37If you want to get help inside of the Formula Workshop, go up to the top toolbar and click
03:43the question mark button, which is Help.
03:45When you click that, you'll get help on whatever is active, and in this case, the integer formula
03:51is used in the body of the Formula Workshop, so you get help on that.
03:56If you want other help, you can go to Search and type "formula workshop" and press Enter
04:04and you get a list of all the help files that are available on that topic.
04:08If you've used other programs that let you create formulas, most of the information in
04:12this movie was probably familiar to you.
04:15Even so, getting a good look at the Formula Workshop interface will make creating your
04:18own formulas that much easier.
04:21
Collapse this transcript
Using functions in formulas
00:00When you're ready to perform custom calculations on your data, you can use Crystal Reports' built-in
00:05functions to do so.
00:06In this movie, I'll show you how to use those built-in functions in your formulas.
00:11To create a new formula field, I'll go over to the Field Explorer and click Formula Fields.
00:18If for some reason the Field Explorer doesn't appear in your program window, you can go to
00:22the standard toolbar and click the Field Explorer button to display it.
00:27Once it's there and you've clicked Formula Fields, you can click the New button and then
00:32in the Formula Name dialog box, type a name for the formula. And I'll just call this one
00:36AverageCalls and click OK.
00:41Now what I want to do is add the Average function.
00:44I can find that in the third pane along the top, so I'll click the expand control next to
00:49Functions. And then I happen to know that Average is under the Summary category, so I'll click
00:57that category's expand control. And then I have three options to select from:
01:02average for a single field, for a conditional field, or a third option. We'll just work with
01:07the first option.
01:09So I'll find the Average and actually I'll double- click it, and that adds it to the body of the formula.
01:15Now I can identify the field that I want to do the calculation on, and that will be the
01:20number of calls, which is here, Sheet1_Calls, so I'll double-click that. And as long as the
01:27cursor was flashing within the parentheses beside average, that is where the field will be added.
01:32Now note that there is also Sheet1_Calls up here, but that is a Sum.
01:38You can see that by the sigma
01:40or the sum indicator, and that means that it's a summary so you don't want to use that;
01:45instead, you want to use the field itself, which has something that looks like a database row next to it.
01:51So that's how you can tell which one you want to use.
01:54With that in place, I can click Save and close, and the formula appears in the Field Explorer.
02:02I can now drag the formula to the body of the report, just put it there in the Report
02:06Header, and we see the average value of 3293.28.
02:11Now it's not immediately obvious what that value represents, so I'll just add a text box,
02:16just draw it above it, and type in "Average quarterly calls."
02:24And you can change the formatting and positioning using techniques I've covered elsewhere in this course.
02:29You can tell when a formula field is displayed within the body of a report because in the
02:34Field Explorer there will be a green check next to its indicator.
02:39If I were to remove the AverageCalls field from the report, that check would go away.
02:43Crystal Reports has a wide range of functions that you can use in your custom calculations.
02:48I've shown you one. If you want more details, you can use the Help facility inside of the
02:53Formula Workshop to find out everything you need to know.
02:57
Collapse this transcript
Adding if-then logic to formulas
00:00When you analyze business data, you will often want your formulas to return one result if
00:05one criterion is true and another if it's not.
00:09In this movie, I will show you how to use if-then logic to make those two occurrences happen.
00:14In this case, I'm going to assume that I want each of the call centers to have a quarterly
00:18call target number, or a goal, of 4000 calls.
00:23That means if the number of calls is above 4000 then they are above target, and if it's
00:28below then they are below target.
00:30My goal is to create an if-then formula that will display either below target or above
00:36target as appropriate to the right of the calls value.
00:40To do that, I will create a new formula field. So over in the Field Explorer, I will click
00:46Formula Fields. And again, if you don't see the Field Explorer, you can go to the standard
00:50tool bar and click the Field Explorer button to display it. Then, with Formula Fields selected,
00:57click the New button, and then in the Formula Name dialog box, type Target and click OK.
01:04In the Formula Workshop, you can create a formula by typing in the main formula area,
01:11which is down here in the bottom-right corner-- it's the largest pane in the window. And you
01:16will type "If," and then double-click Sheet 1_Calls is the Report Fields area.
01:24So if Sheet1_Calls > 4000 then, and a space, then "Above Target," and then close
01:37the double quotes.
01:39If I were to save the value right now, then anytime that we have a calls number of greater
01:43than 4000, then it would be about target. That is what would appear in this formula field.
01:49But instead what I want to do is add an additional criteria that would tell it what to do if
01:55the number is not greater than 4000.
01:58So for that, I will type a space, then else, a space "Below Target," then close the double quotes.
02:09So what's happening is that Crystal Reports checks to see if this row's calls number is great than 4000.
02:16If it is, it's above target; if not, it's below target.
02:19I will click Save and Close and that takes me back to the body of the report.
02:25Now I will switch to Design view by clicking the Design tab, and I would drag the Target
02:30field from the Field Explorer to the details area, to the right of the Calls control.
02:39When it appears, we get the @ Target field, and that just means that it's a calculated
02:44field named Target. And I will Ctrl+Click Calls. That way both of the fields are selected.
02:52And I will go up to Format > Align > Align Tops and that moves up the Target field so
02:59it's in a line with calls and all the other fields in the row.
03:03When I switch to Preview, by clicking the Preview tab, the formula field has been added and
03:08we see all of the rows that are below target and those that are above target.
03:13The if-then structure is extremely useful.
03:15You will probably find yourself using it a lot, especially when you analyze data in relation
03:19to your company's goals and other criteria.
03:24
Collapse this transcript
Adding case statements to formulas
00:00In the previous movie, I showed you how to use the if-then structure to decide which
00:05of several sets of instructions to follow based on a report's value.
00:09In this movie, I will show you another way to select which set of instructions to follow
00:13by using the case structure.
00:16As in the previous movie, I have call data for a series of call centers broken down by
00:22quarter and by year.
00:23Now, what I want to do is indicate one or three conditions, whether the call volume
00:28is low, moderate, or heavy.
00:31I can do that by creating a new formula field.
00:34So, in the Field Explorer, I will click Formula Fields.
00:38And if your Field Explorer doesn't appear inside your program window, you can go up
00:42to the standard toolbar and click Field Explorer.
00:45But after you have selected Formula Fields, click the New button, and in the Formula Name
00:50dialog box, type a name for the formula. And I'll just call it ThreeCases and click OK.
00:58Now, inside of the Formula Workshop, I can create my formula.
01:04To do that, I'll follow this structure.
01:06The first is Select and then a left parenthesis, and I want to do my selection based on the number of calls.
01:14And that field is Sheet1_.Calls, so I'll double-click it in the Report Fields area, and then type a right parenthesis
01:22to close the first line of the statement.
01:24Then I'll press Enter and press the spacebar twice, and then I'll type Case 0 to 2000:.
01:34So what I've done is first, I've offset the case statement below Select just so I know
01:40that it's on a different level within the formula that I'm creating.
01:45It helps visually. It doesn't really matter in terms of functionality. It just makes it
01:48easier to read it, I think.
01:50And then I define the range, 0 to 2000, for which the following action is going to take place.
01:57So, Case 0 to 2000, and then you indicate the end of a case by typing a colon.
02:04Then press Enter, and then press the spacebar four times.
02:09Again, that's just for spacing. You don't have to.
02:12Then "Low volume."
02:15So, for any value between 0 to 2,000, this formula will display Low volume.
02:22I'll press Enter twice, two spaces, and now I can define my other cases.
02:27I have Case 2001 to 4000:, Enter, and then four spaces, "moderate volume."
02:40The reason that I'm putting double-quotes around these values is because they are text strings.
02:45If they were numeric values or a reference to a field, I wouldn't have to do that.
02:49I'll press Enter twice, two spaces, and then the final case is a catchall case for anything
02:56that I didn't define above.
02:58That is Case is > 4000. Then type a colon, Return, four spaces, and that is High volume.
03:09I've created my formula, and now I can click Save and close, and the Formula field appears
03:15inside of the Field Explorer.
03:16Now, I'll switch over to Design view by clicking the Design Tab, and I will drag the ThreeCases
03:23field to the Details area to the right of Calls.
03:27Then, with ThreeCases still selected, I'll hold down the Ctrl key and click Calls, and
03:33then on the Format menu, point to Align and click Tops.
03:38So now ThreeCases is in a line with Calls, Center, Quarter, and Year, so the data will look good
03:45when it appears within the report.
03:47The next thing I'll do is move the ThreeCases header from the Page Header field to the Group
03:55Header just above the ThreeCases formula field.
03:59With that in place, I can switch to Preview, and you can see that we have Low volume, Moderate
04:04volume, and High volume in all the cases that I defined in the case statement.
04:08I tend to use if-then if I only have one criteria or two criteria, so that I can use if-then-else.
04:16If I have three or more conditions that I want to check against, I use Case.
04:19I just think that the layout of the Case statement makes it easier to understand than a series
04:24of if-then statements.
04:29
Collapse this transcript
Correcting formula errors
00:00Creating formulas can be tricky.
00:03There are a lot of moving parts, and there's always the possibility you might type something incorrectly.
00:07In this movie, I will show you how to correct formula errors just in case they occur.
00:12This report contains data about the number of calls received by salespeople in a particular
00:17region and the number of calls that were converted to sales.
00:21So in the first column we have the number of calls, and in the second column we have
00:26the number of conversions, and then over in the right side in the third column, there
00:31is the conversion percentage or rate.
00:34So this formula here for the conversion rate is working properly.
00:38What I'll do now is change it so that it doesn't work.
00:41I'll go into the Field Explorer and click the Formula Fields expand control. And again,
00:47if you don't see the Field Explorer, you can click the Field Explorer button on the standard
00:51toolbar to display it. Then I'll click ConversionRate and then click the Edit button.
00:57It looks like a pencil.
01:01Doing so displays the Formula Workshop's Formula Editor.
01:04So this formula is working correctly, but what if I were to change the field name of
01:09Conversions to Conversion?
01:12There is no field inside this report named Conversion.
01:16The field's name is actually Conversions.
01:19So when I click Save and close, Crystal Reports displays a dialog box indicating that there
01:24is an error in the formula and asking if you want to save it anyway.
01:29The answer to this question is always No, because if you say Yes, then the formula will
01:34stay inside of your report, but there won't be an easy indication--at least until later--
01:39that there is an error.
01:41So I'll go ahead and click No, saying I do not want to save it anyway.
01:45And then if it's possible, Crystal Reports will display a note indicating what the error type is.
01:51So in this case, the field name is not known.
01:54Click OK and the program has highlighted the code that is giving it trouble.
01:58Well, I can look in the Field list above. You'll see that Conversions actually has an
02:03S on it, so I can fix the field name by typing in the S and everything will be fine.
02:09But now, let's suppose that you're inside the Formula Workshop and you want to check
02:13your formula for errors before you try to do Save and close.
02:16So let me put the error back into the formula by deleting the S from the Conversions field name.
02:23I can go to the second toolbar here on the second level and click Check.
02:29I could also press Alt+C to start this process.
02:33So I click the Check button, and when I do, Crystal Reports runs the same checking mechanism
02:39that it does when you click Save and close, and it gives me the error message saying the
02:44field name is not known, and it highlights the offending code.
02:47So I'll click OK and I'll make the fix, changing Conversion to Conversions, and now when I
02:54click Save and close, everything works as expected.
02:58Crystal Reports does a good job of alerting you when a formula contains an error and also
03:03helping you find the errors so you can fix them.
03:05Always make sure your formulas are correct before you save them and to get out of the
03:09Formula Workshop.
03:13
Collapse this transcript
10. Adding Subreports
Creating an unlinked subreport
00:00When you analyze business data in Crystal Reports, you will often find that your data
00:04sources are related.
00:06For example, you might have multiple reports that relate to an individual customer.
00:12In this movie, I will show you how to summarize data using a subreport but without linking
00:17that subreport to any value in the main report.
00:20The first thing I'm going to do is to switch to Design view so that I'll be able to position
00:24my subreport properly when I add it.
00:27To start adding my subreport, I'll open the Insert menu and click Subreport.
00:33In the Insert Subreport dialog box, if it isn't already selected, click the Create a
00:39subreport with the Report Wizard option, and then in the New report name box, type "Orders."
00:45Now I'll click the Report Wizard button to open the Report Wizard.
00:49When you do, the Standard Report Creation Wizard dialog box opens.
00:53And you've already seen this when you worked through Chapter 1, but because you probably
00:57haven't created any new connections recently, your dialog box might look like this, with
01:02the Create New Connection submenu collapsed.
01:07So if you need to, click the expand control next to Create New Connection and then expand
01:12Access/Excel if you need to, and then double-click Make New Connection.
01:17You can select the data type.
01:22So if you click the control next to Database Type, select Excel 8.0, and we select Excel 8.0
01:28as I explained back in Chapter 1, because our file is an Excel 97 through Excel 2003
01:34file, which has the .xls file type.
01:38We can select the particular file, so click the Browse button next to Database Name and
01:44in the Chapter 10 exercise files folder, click CustomerOrders and click Open.
01:49With that done, you can click Finish, and we see the connection here, CustomerOrders.xls.
01:58Click the expand control to display the tables that are available.
02:04Click Sheet 2 and click the Add button.
02:07It's possible that this will already be expanded for you.
02:10It changes based on what work you've done before.
02:13So now with that table selected and in the Selected Tables list, click Next, and now
02:19we identify the fields that we want to add.
02:21I could add them one at a time by clicking a field and then clicking the Add button,
02:26but I want to add all of them, so I'll click the Add All button.
02:30And then because I don't want to make any other changes, I'll click Finish.
02:34The Insert Subreport dialog box reappears and I can click OK.
02:39When I do, an outline is attached to my mouse pointer, and that represents the subreport.
02:45I'm going to drop it in the Report Footer section, so I'm going to position my mouse
02:51pointer carefully inside the Report Footer section and click.
02:57When I do, the subreport appears there.
03:00And when I switch to Preview, we see the main report, but here on the Orders tab, we see the subreport.
03:08To see the data inside the subreport, we need to click the Refresh button or press F5 if
03:14you prefer, and when we do, a new Orders Preview tab appears and it contains all of the order
03:20data for those customers.
03:23An unlinked subreport presents all of the data from a related report in your current report.
03:28Doing so makes it easier to find that data when you want to examine it.
03:31In the next movie, I'm going to show you how to create a linked subreport that displays
03:36data for each individual customer.
03:40
Collapse this transcript
Creating a linked subreport
00:00In the previous movie, I showed you how to create a subreport within a main report, but
00:05there was no link between the two data sets.
00:08In this movie, I will show you how to create a linked subreport that displays values related
00:13to the current row of the main report.
00:15I'm going to use the Subreports_Linked file that you can find in the Chapter 10 folder
00:21of your Exercise Files archive.
00:24I'm also going to rely on work that I did in Chapter 10, Video 1.
00:29I'm going to use the connection that I created for the data for the subreport in that previous movie.
00:36So if you haven't worked your way through Chapter 10, Video 1, please do it now so that
00:40you can follow along exactly as I work through this movie.
00:43The first thing I want to do is switch over to Design view so that I can add my subreport
00:48to the section that I want, and now I can insert the subreport and define the data connection.
00:56So, on the Insert menu, I'll click Subreport.
00:59If it isn't already selected, select the Create a subreport with the Report Wizard option,
01:05and for the New report name, type Orders, and then click the Report Wizard button.
01:12The data connection I created in the previous movie is to the Chapter 10 file CustomerOrders.xls.
01:20And inside of that file, I want to use Sheet 2.
01:23I'll click the Add button to add it and click Next.
01:28Now I can select the fields that I want to add.
01:30In this case, I want to add all of them, so I'll click the Add All button.
01:34It looks like two greater than signs.
01:37I don't want to make any other changes, so I can click Finish.
01:41Inside the Insert Subreport dialog box, click the Link tab.
01:45Doing so allows me to identify the fields that I want to link.
01:49So I'll click CustomerID and then click the Add button.
01:55And when I do, in the bottom part of the dialog box, Crystal Reports makes its best guess
01:59on the field that I want to link to, and in this case, in the subreport, it is based on CustomerID.
02:07If I wanted to--in other words, if Crystal Reports had identified the wrong field--I
02:12could click this control and identify the correct field.
02:16But in this case it's right, because the fields have the same name and I can click OK.
02:22When I do, an outline appears attached to my mouse pointer.
02:25That is the subreport.
02:27The next place I click is where the subreport will be added to the report, and I'm going
02:32to add that to the Details section.
02:35So I'll move the mouse pointer below CustomerID and click the left mouse button.
02:41When I do, the Orders report is inserted.
02:44And I'll click Preview, and all the orders related to Brown Shipping customer 1 appears
02:52in the subreport.
02:54So we have CustomerID 1.00, CustomerID 1.00, Order 1.00, and Order 3.0.
02:59If I scroll down using my mouse wheel, for Customer 2.00, we have that customer's orders as well.
03:06In some ways, linked subreports are like groups.
03:09You see related data for whatever field you choose to create the group or to link to in the subreport.
03:15But the benefit of using a linked subreport is that you don't need to combine your data
03:19sources into a single file.
03:21All you need to do is identify the link between them based on a common field and add the second
03:26data set as a linked subreport.
03:31
Collapse this transcript
Creating an on-demand subreport
00:00Subreports provide a lot of useful information,
00:03but they do take up room in the body of your report.
00:07If you want to have the benefit of the subreport without it taking up so much space, you can
00:11create an on-demand subreport which only appears when you click on its link.
00:16For this movie, I'm going to use the Subreports_OnDemand, file which you can find in the Chapter 10
00:22folder of your Exercise Files archive.
00:25I'm also going to use the data connection that I created in Chapter 10, movie number one.
00:31So if you haven't worked through that movie, please do it now, so that you can follow along
00:35exactly as I work through here.
00:38The first thing you want to do is to change to Design view, and then on the Insert menu, click Subreport.
00:46In the Insert Subreport dialog box, if it isn't already selected, select the Create
00:52a subreport with the Report Wizard option, and then in the New Report Name Box, type Orders.
01:00Then click the Report Wizard button.
01:03A list of your available data sources appears, and under the Chapter 10, CustomerOrders.xls
01:11connection, click Sheet2$.
01:14Then click the Add button--it looks like a greater than sign--and click Next.
01:20On the next page of the wizard, you can identify the fields you want to add.
01:24In this case, you want to add all of them, so click the Add All button.
01:29There are no other changes that you want to make, so click Finish.
01:34We're back in the Insert Subreport dialog box, and click Link.
01:38That displays the Link tab in the dialog box.
01:40What we want to do now is identify the field that establishes the link between the two
01:45data sources, and in this case, it is CustomerID,
01:50so click that in the Available Fields list, and click the Add button.
01:55When you do, Crystal Reports identifies the fields that are linked.
02:00So we have Sheet1_CustomerID and a CustomerID in the Subreport data. That link is correct.
02:06Now, let's go back to the Subreport tab, and toward the bottom of the tab page, check the
02:13On-demand subreport checkbox.
02:16Everything is good. Click OK. When we do, my mouse pointer changes so it has an outline
02:23attached to it. That's the body of the subreport.
02:26I'm going to add it to the Details section, below CustomerID, and when it's in place,
02:32I will click the left mouse button, and the linked subreport appears.
02:36Now, this is an on-demand subreport, so when I click Preview, instead of having all the
02:42related records appearing below Brown Shipping and taking up a lot of space, instead, I have
02:48a link; it's like a hyperlink that you click to go to a website.
02:52I needed to click away to clear the selection of the fields, which happens when you add a
02:58subreport to a main report.
03:00So once that selection is cleared, you can click the link.
03:02I'll click for customer number 2.
03:05The mouse pointer changes to a pointing hand, and when it's in that position, click, and
03:11you get a separate page that has a subreport with orders for only customer number 2.
03:18You can close that tab by clicking its Close button and go back to Preview to see your main report.
03:25On-demand subreports are extremely useful and they let you display your data in a compact
03:29form, only displaying the details when you want them.
03:33
Collapse this transcript
Formatting subreports
00:00After you add a subreport to your main report, you can format it just like any other report object.
00:05In this movie, I'll demonstrate some of the most common subreport formatting tasks that you can perform.
00:11The first thing you need to do is to display the report in Design view,
00:15so go ahead and click the Design tab to do that.
00:19Then go down to the Detail section and right-click the subreport.
00:23It is the Orders object that you can see there. Right-click and then from the shortcut menu,
00:30click Format Subreport.
00:31This displays the Format Editor.
00:33You can use the tools in the Format Editor dialog box to change many aspects of your
00:38subreport. There are a couple that I will focus on; the first is the object's name.
00:43You'll notice that it says Subreport2, and that's not very informative.
00:48You don't know what the subreport contains.
00:50So what I like to do is change the name to reflect its contents, and have OrdersSubreport.
00:58Your object name cannot contain any spaces, and you should make it reasonably short so
01:02it's quick to read.
01:04Next is the Tool Tip Text. That's in the box just below the object name, and this is what
01:10appears when you hover your mouse pointer over the object when you're in Design view.
01:14The tool Tip Text can contain spaces,
01:17so I like to say Orders Subreport by Customer.
01:25Something like that is a little bit more explanatory but still quick to read.
01:28Those are the only options I will cover on this page, but if you switch over to the Border
01:32tab, then you can add a border around your subreport.
01:36Now, you notice here in the sample that appears at the bottom of the dialog box that the
01:41subreport already has a border around it.
01:44But if you want, you can make the border a different color. For example, if you wanted
01:48to change the border color from black to a dark gray, you can do that and the sample changes.
01:56You can also add a background color.
01:58To do that, you check the Background box and then click the down arrow. And if you
02:05don't see a color that you like, you can click More and select a color from somewhere in this range.
02:11I like to use a fairly light background so it doesn't detract from the black text in front of it,
02:17so I tend to go just a couple of shades darker than white.
02:21I mean you can barely see it here in the Preview.
02:24But that's how I like to work with it, and if you prefer a darker color, then feel free
02:28to select any color from the palette you like.
02:31When you click OK, the color appears there, and it also appears in the subreport.
02:37And I forgot to mention, if you want to change some aspect of the lines--for example you
02:41want to make them thicker--then you can go up to the Line Style area, and then you can
02:46affect the left, right, top, and bottom lines of the border separately.
02:51So let's say that you want to make the top line of the border around the subreport a
02:55double line instead of a single line.
02:57To do that, you can click the Top control, select Double and you see the change reflected in the sample.
03:04The last thing I will show you is how to change the font, and you do that, no surprises, on the Font tab.
03:11You can change the font, you can change its style, say from Regular to Italic, Bold Italic
03:17or Bold, and you can also change the color.
03:20In this case, I will change the font, just for demonstration purposes, to Arial Narrow.
03:25And with all of those change in place, click OK.
03:29You'll notice that the preview and the Design view changes, and I'll switch back to Print
03:34Preview by clicking the Preview tab, and you can see all of the changes applied to your subreports.
03:40Formatting your subreports properly lets you make your data easier to read, and also fit
03:44in with whatever theme you've chosen for your presentation.
03:47It's also great for adhering to corporate style guides.
03:52
Collapse this transcript
11. Summarizing Data Using Cross-Tabs
Creating and manipulating a cross-tab
00:00Most of the reports that I've used earlier in this course just used data and columns.
00:06As you can see in this report, we have the Order ID, the salesperson's name, the state
00:13the order came from, shipping method, and so on.
00:16If you want, you can arrange your data into cross-tabular tables, which are called crosstabs
00:21in Crystal Reports 2011.
00:24It's easier to show you what a cross-tab looks like by creating one than it is to describe
00:28it, so I will just go ahead and do that.
00:29The first thing I will do is switch to Design view, and then open the Report menu, and click Section Expert.
00:38What I am going to do is add a new Report Header section below Report Header b.
00:43So, I will click Report Header b, click Insert so I get a new section Report Header c, and
00:50click OK, and the section appears.
00:52I will go up to the Insert menu, and click Cross-Tab.
00:58Doing so causes my mouse pointer to change. It now has an outline attached to it that
01:02indicates where the cross-tab will appear when I click.
01:05So, I'll drop down to the Report Header c section and click, and the crosstab appears.
01:13I can start adding fields to the crosstab.
01:15And as you can see, I have columns and rows.
01:19To add fields to a crosstab, you drag them over from the Fields Explorer the same way
01:23that you add fields to the body of the report.
01:25So, I'll move over to the Field Explorer.
01:27As I have said in previous movies, if the Field Explorer doesn't appear in Crystal Reports,
01:33you can go up to the standard toolbar and click the Field Explorer button to display it.
01:38But now, if necessary, click the expand control next to Database Fields, and again, next to
01:45Sheet1 to display the fields that are available to you, and now you can drag fields over to the cross-tab.
01:50I will put OrderSalesRep in the Rows area.
01:56And when I drop it, we have Row #1 Name, and when I hover over Row #1 Name, it indicates
02:02in the tooltip that SalesRep is the field that goes there.
02:07For the columns, I am going to add state.
02:10So I will do the same thing, just drag it over and drop it into the Column Header area, and it appears.
02:16For the body of the cross-tab, I will use the OrderAmount,
02:19so I will drag that field into any of the Insert Summarize cells. And now with everything
02:25in place, I can click over to Preview by clicking the Preview tab and the cross-tab appears.
02:32I have data for Jones--his total amount of sales and his sales broken out by state--and
02:39I have the same thing for Smith.
02:41If you want, you can also add a second or third level of organization to either the
02:46rows or the column area.
02:48So, let's say that I wanted to find out what type of payment methods were used for these
02:52two sales representatives most commonly, or to summarize them.
02:57To do that, I will switch back to Design view and then go over to the Field Explorer and
03:04drag OrderPayment type.
03:05I am going to put it in the Row area, and I drag it to the right of Row # 1 Name, and
03:14you can see a small, gray downward-pointing arrow indicating where it's going to go.
03:18If I wanted to put it before the salesperson's name, I could drag it over to here to this
03:23line and it would go before it.
03:25But in this case, I want it to be a lower level of organization, so I will drop it here.
03:30And you can see that the cross-tab changes in Design view. And when I switch to Preview,
03:36the data is broken out further, so now I have Jones and then payments by check, by credit
03:41card and purchase order, and those amounts are still broken out by state.
03:46Now, if I want, I can change the order of the fields after I've already added them to a crosstab.
03:52So I will switch back to Design view. And let's say that I do want to put the payment
03:57type at a higher level of organization than the sales rep.
04:01To do that, I will just drag Row # 2 Name on top of Row #1 Name, and you can see that
04:08there are two opposite-pointing arrows.
04:10That indicates that Row #1 and Row #2 will be swapped.
04:14So, when I drop it, the change occurs, and I click to Preview, and we now have payment
04:20methods as a higher level of organization than sales rep.
04:25Cross-tabs help you summarize your data efficiently in a familiar format.
04:28In the rest of this chapter, I'll show you how to manipulate your cross-tabs, and also
04:32to format them to make them easier to read.
04:37
Collapse this transcript
Sorting cross-tab group values
00:00When you create a cross-tab with multiple criteria, you are essentially creating groups.
00:06In this movie I will show you how to sort your cross-tab data within those groups.
00:10Here on the Report Header c I have a small cross-tab that summarizes sales data by payment
00:16type in the Row area and by sales rep in the column area.
00:21In this case the three payment methods--check, credit card, and purchase order--are in ascending
00:27alphabetical order.
00:29What I want to do is to change the sort order so that they appear in an order that I specify
00:35instead of either ascending or descending alphabetical order. So, I'll show you how to do that.
00:42The first thing you need to do is to click this area at the top-left of the cross-tab.
00:48It's the empty space at the top-left where this column and this row intersect, so you right-click
00:55that space--that selects the entire cross-tab-- and then from the context menu that appears,
01:02click Cross-Tab Expert.
01:05You can use the Cross-Tab Expert to change anything you want, practically, about your cross-tab,
01:10but in this case I'm going to focus on changing the sort order of a particular field.
01:15So, in the rows area where it says OrderPayment, go ahead and click it, and now I want to change
01:22the group's options, so I'll click the Group Options button. Doing so displays the Cross-Tab
01:27Group Options dialog box.
01:29On the Comment tab I see that order payment is the field I'm working with--that's correct--
01:35and then the control underneath that has a series of sort orders.
01:39The active sort order is ascending order and when I click the control, I see that I can
01:44change to descending order or in specified order.
01:48I've covered sorting and ascending and descending order elsewhere in this course, so I'm going
01:52to go ahead and click in specified order, which displays a new tab page inside the dialog box.
01:59What I can do now is click the Named Group control's down arrow and select the items in
02:06the order that I want them to appear. And that order is Purchase Order, so I'll click it,
02:15and then Check and finally, Credit Card.
02:20And after I've put these items in, I can change the order if I wanted to, using the move up
02:24and move down buttons.
02:26So, let's say if I wanted to move Check below Credit Card, then I can click the move down button,
02:31but that just puts them into sending alphabetical order.
02:34So, for the purposes of this demonstration, I'll leave Check selected and click the move up arrow.
02:40So, now my order is Purchase Order, Check, and Credit Card. Click OK to save that new
02:46order and OK to close Cross-Tab Expert and when I do, I see that my column is sorted
02:54Purchase Order, Check, and Credit Card, just like I wanted.
02:58Sorting cross-tab data within a group lets you order the data according to the criteria that you set.
03:04Doing so makes your data easier to analyze and also makes it easier for your audience
03:08to get the point of your presentation.
03:13
Collapse this transcript
Adding summary fields to a cross-tab
00:00When you create a cross-tab, Crystal reports assumes that you want to find the sum of the
00:05values within the table.
00:06In this movie, I'll show you how to change the summary operation if that's not the case.
00:11If you want to change the summary operation for the field in the Summary area of your
00:17cross-tab, you can right-click any cell in that area and then in the shortcut menu that
00:25appears, click Edit Summary.
00:28Then in the Edit Summary dialog box you can verify that you do have the OrderAmount field
00:33selected, or whichever field is providing values for the interior of your cross-tab, and then
00:39you can select your summary operation.
00:41As I said, the default is Sum, but if you click the Operation control, you can see that there
00:46is a huge list of other ways that you can summarize your data.
00:50So, for example, if you wanted to display the average, you can click Average and click OK,
00:56and the body of the cross-tab changes to reflect the average value of each order that was placed
01:02by check, credit card, and purchase order and that was assigned to salesperson Jones or Smith.
01:09There is another way you can summarize your data and that is by displaying it as a percentage of all sales.
01:14So, I'll right-click a cell in the Summary area and again click Edit Summary. Then I'll
01:21click the Calculate this summary control and switch it back to Sum, which is at the top
01:25of the list. And now I'm going to use the Options at the bottom to show it as a percentage,
01:30so I'll click Show as percentage of, and for this it will be the total of all orders.
01:36And you can also control whether to summarize based on row or column and in this case, I'll
01:41summarize based on column. So if a move the Edit Summary dialog box to the side, we'll
01:46see that we'll be shown as a percentage of check purchases, credit card purchases, and
01:53purchase orders, because those are the row headers.
01:55If I were to switch column, we would see them by Jones and by Smith, the salespeople.
02:00So with that change in place, I'll click OK and we'll see that we have the percentages and
02:05as always, the percentages in each column must add up to 100%.
02:11Adding summary fields to cross-tabs lets you present your data efficiently. It also
02:15makes it easy to see how much each aspect of your data collection contributes to the whole.
02:23
Collapse this transcript
Adding a formula field to a cross-tab
00:00When you summarize your data using a cross-tab, you can customize your analysis by creating a formula field.
00:07Creating a formula field means that you're not limited to the built-in functions that
00:10are included in Crystal Reports.
00:13The cross-tab which I have in Report Header section c summarizes sales data. First we
00:18have the Total, which appears in the top-left corner by default, and then it's broken down by Sales
00:24Rep and then also by Payment Method.
00:27My goal for this movie is to change the summary operation, which is currently Sum, to calculate
00:33the commission that is due to each of the two sales reps. To do that, we need to create
00:37a formula field and then put that formula field in the summary area of the report.
00:43The first thing we need do is to create a new formula field to calculate the commission,
00:48so I'll go over to the Field Explorer and click Formula Fields. And as always, if you
00:53don't see the Field Explorer, you can go up to the standard toolbar and click the Field
00:59Explorer button to display it.
01:02Once you have selected formula fields, click the New button and then type a new name for
01:08the formula, and I'll just call it Commission and click OK.
01:13After I click OK, the formula workshop appears.
01:16So, what I want to do is to calculate the commission due each of the sales reps based
01:22on the OrderAmount.
01:23So, I'll go to the Report Fields list and double-click OrderAmount to add it, type a
01:29space, add an asterisk--I do that for multiplication-- and then we'll give them a 15% commission. So I'll type
01:37.15. The formula looks good, so I'll click Save and Close and when I do, the new formula field
01:44appears in the Field Explorer.
01:46So my next step is to add that formula field to the summary area.
01:50To do that, I right-click the cell in the top-left corner of the cross-tab, and this
01:57is where this column and this row intersect, so right-click there, and then from the shortcut
02:03menu, click Cross-Tab Expert.
02:05So, now what I need to do is to change the summary field, and I can do that by clicking
02:12in the Summarized Fields list. So I've selected OrderAmount and then I'll click the Remove
02:18button--it looks like a less than sign--to get rid of that field.
02:22I can over to the Report Fields area, click Commission, and add it to the Summarized Fields list.
02:31It appears as Sum of Commission because that is how the data in that field is going to be summarized.
02:36I showed you how to change the summary operations in a previous movie, so I'll just leave
02:40it that way for now and click OK.
02:44After I click OK, we switch back to Preview, and we see that instead of Total Sales Data,
02:50we see the total commissions that are due to each of the sales reps.
02:54In this movie, I've shown you how Formula fields let you augment your cross-tab analysis
02:58with custom calculations.
03:01You can create any calculation you want and add it to find the exact information you need.
03:06
Collapse this transcript
Formatting a cross-tab
00:00The basic cross-tab you create in Crystal Reports is just that: basic.
00:04In this movie I'm going to show you how to format your cross-tab as a whole and also
00:09how to change the appearance of its individual outlets.
00:12To display the controls that you need to format a cross-tab, you click the top-left corner
00:18of the cross-tab, and that's in the imaginary cell at the intersection of the row header
00:24column and the column header row, so it's right here.
00:28It'll say cross-tab when you hover over it. Right-click and then from the shortcut menu,
00:34click Format cross-tab.
00:37When you do, the Format Editor appears. You can use the tools in the Format Editor to
00:41change quite a few things about your cross-tab's appearance.
00:45The first thing I'll show you how to do is to change the object's name.
00:48The object is referred to in the program as CrossTab2, and that's not very informative,
00:54so instead, I'll change it to SalesCrossTab.
00:59Your object's name can't have any spaces in it.
01:02It can only have alphanumeric characters and the underscore character.
01:06Next, you can also display a tooltip. The tooltip is what appears when you hover your
01:12mouse pointer over the cross-tab, and this value can contain spaces.
01:17So I'll call it Sales Summary for Western States.
01:24Those are the only changes that I'll make on this tab, so I'll switch over to the Border tab.
01:30The Border tab, as the name implies, lets you affect the border for the cross-tab and also
01:36to change the background color.
01:39Let's say that instead of having no line along the bottom of the cross-tab, you want to have a single line.
01:44To do that, you will click the bottom control and click Single.
01:49When you do, these sample of your cross-tab changes to reflect the change that you just made.
01:54If you want, you can also affect the color of the borderline.
01:58To do that, you would click the Border control and select a color, and in this case I'll
02:03make it a dark gray.
02:06If you want to change the background color so the cross-tab stands out a bit more from
02:09the rest of the report, you can check the Background box and then click the background
02:16color control's down arrow, and then you can either select one of the preset colors or
02:21click more to have more choices.
02:24I prefer to use a gray that is just barely darker than white.
02:28So I'll click White, if it isn't already, and then go up near the top of the spectrum on
02:35the right side of the color palette, click a value there. You can see that the color
02:41appears here in the box, and it's a very slight change, but when I click OK, I can see that
02:47the body of the cross-tab will have a background color that does make it stand apart from the
02:52rest of the report, but it doesn't obscure the text within the cross-tab itself.
02:57So with those changes in place, I'll click OK, and my work appears in the body of the report.
03:04And I should also point out that if I hover my mouse pointer over the top-left cell of
03:09the cross-tab, I see the tool-tip Sales Summary for Western States.
03:15As with any other formatting, you should experiment with the settings that make your cross-tabs
03:18easiest to understand.
03:23
Collapse this transcript
12. Exporting Report Data
Exporting to Excel
00:00Crystal Reports is a powerful analytical and data-summary tool.
00:04That said, if you want to perform further analysis using Microsoft Excel, you can do
00:09so by exporting your data to that program quickly.
00:12When you want to export a ne file to Excel, display the file, and then on the File menu, point
00:19to Export and then click Export Report.
00:25Then, in the Export dialog box, click the format control and from the list that appears, click
00:31Microsoft Excel (97-2003).
00:35The destination is a disk file.
00:37We want to save it as an Excel workbook, so go ahead and click OK.
00:41After you do, the Excel Format Options dialog box appears.
00:46You probably won't need to change any of the settings in here.
00:48What the program is asking is whether the column width should be based on objects in
00:52the whole report, which means that Crystal Reports will export the data and it will
00:57make sure that all of the data from individual columns fit into cells in your Excel workbook.
01:03So, that won't be an issue.
01:04You don't need to change that.
01:06Other options you might want to set are creating page breaks for each page.
01:10I never do that, but you might want to.
01:13Converting date values to strings, this might be helpful if you have included weekdays,
01:19and also times in your dates.
01:22But if it's just regular dates, then Excel will pick it up and identify them as dates,
01:26and you won't need to worry about it.
01:28And for showing gridlines, that's an option you can set within Excel, so you don't need
01:32to worry about it here.
01:34With those options in place, you can click OK.
01:37From there, you can navigate to your Chapter 12 exercise files folder, or any folder that
01:41you care to, make sure that the file name appears the way that you want it, and then click Save.
01:49One thing to keep in mind when you're exporting data to Excel is that Excel 2003 and earlier
01:55versions, which are the only program versions that you can export to from Crystal Reports
02:012011, have a maximum row number of 65,536.
02:06If you are working with a large data set, even if it's may be only 50,000 rows or so, you
02:12need to be careful that you don't exceed that limit or your data won't get exported properly:
02:17either the Export would fail or some of it will be left out.
02:21If your dataset does contain more than 65,000 rows, then you should use another format, such
02:26as comma-separated values.
02:27I will show you how to export to that format later in this chapter.
02:32
Collapse this transcript
Exporting a report to Word using an RTF file
00:00After you create a report, you might want to include it in another document.
00:05If that's the case, you can export your report to Microsoft Word or another word processing
00:10program by creating a rich text format, or RTF, file.
00:15To export this report, open the File menu, point to Export, and then click Export Report.
00:24From here, you can select the format that you want to export your file into.
00:28So I'll click the Format control and scroll down and click Rich Text Format (RTF).
00:35I do want to send it to a disk file, so I'll click OK.
00:38I can select the page range, and in this case my report only has one page--you can see that
00:44on the navigation control up top.
00:46But if I wanted to, I could select the Page range option button, and then enter the page
00:52range numbers from and to in the boxes below.
00:56But in this case, I want to export the entire report,
00:58so I'll select All and click OK.
01:02Now if I want to, I can put in a new name for the file, and verify that Rich Text Format
01:08is the format that I'm exporting to, and also navigate to the folder where I want the file to end up.
01:14With all of those settings in place, I can click Save, and my file's been exported.
01:19Pretty much every modern word processing program can open and render RTF files without any problem.
01:26If you need to share a Crystal Reports document with another user who doesn't have Crystal
01:29Reports, RTF is a great baseline format to use.
01:33
Collapse this transcript
Exporting a report to a CSV file
00:00The contents of Crystal Reports documents are, at their base, sets of values.
00:05If you just want to communicate the values themselves and not any of the formatting,
00:10you can export that data to a Comma-Separated Value field.
00:14Just as the RTF format--which I covered in the previous movie--is the baseline for formatted
00:19text files, the CSV file type is the baseline for communicating data to databases or spreadsheets
00:25without taking any formatting along.
00:28To export the file, open the File menu, point to Export, and then click Export Report.
00:37Then, in the Export dialog box click the Format control, click Separated Values (CSV), and
00:45again, CSV stands for Comma-Separated Values.
00:49We do want to export it to a disk file, so we can click OK.
00:53The next dialog box that appears is the Separated Values Export Options dialog.
00:59There are number of options that we can set.
01:01The first is the delimiter.
01:03The delimiter is the character used to indicate where the beginning and end of a field value
01:09is if that field value contains a space.
01:13So for example, my name is Curtis Frye, and it's written C-U-R-T-I-S F-R-Y-E.
01:19If I wanted to delimit that value and identify it as a string, then I would put a double
01:25quote in the front of it and a double quote in the back.
01:28And that is the delimiter character here.
01:30It's a little blurry, but that is a double quote.
01:33You could change that if you want to, but that is the standard,
01:36so I recommend leaving it as it is.
01:39The separator value is a comma, and that is what separates one field's value from the next.
01:44So in other words if you have the number 14, then a comma, then the number 15, then any
01:49program that reads that data would know that one cell will contain 14 and the next cell will contain 15.
01:56And there are other options that are available to you,
01:58but you don't have to worry about any of them for this simple export operation.
02:03With those settings in place, we can click OK and then type in the name of the file,
02:10verify that it is going out as a CSV file, and then select the folder where you want
02:18it to go, and click Save.
02:21Pretty much every data-analysis program in use today can import Separated Value files.
02:27If you can't come up with a common format to send your data to someone else using a
02:30database or other application, I can almost guarantee that CSV will work.
02:35
Collapse this transcript
Exporting a report to a web file
00:00An increasing amount of business is conducted on the web, both in terms of commerce and
00:05also data presentation.
00:08In this movie, I will show you how to export a report to a web file.
00:12So, once again, the goal is to export this file to an HTML file.
00:19HTML stands for Hypertext Markup Language.
00:22To start the export, we'll open the File menu, point to Export, and then click Export Report.
00:31Then, in the Export dialog box, click the Format control, and from the list of formats that
00:37appear, scroll up--or scroll within the list depending upon how yours is laid out--and click HTML 4.0.
00:46We do want the destination to be a disk file.
00:49With those settings in place, click OK.
00:52And when we do, the Select Export File dialog box appears.
00:56You can use the controls to select the drive and destination folder for your file.
01:01In this case, I'll just leave the settings as they are, and then I can change the base
01:06file name if I want to, but Export_Web.html seems fine.
01:11Next, I can decide whether to have a page navigator and separate HTML files created.
01:19Page navigator and separate HTML pages would place each of the individual pages from a
01:25printed report on its own web page.
01:28In this case, I want them to be all on the same page--in other words, the entire document
01:34to be presented as a single webpage--
01:36so I will clear those two checkboxes: Page navigator and Separate HTML pages.
01:43If my report did contain multiple pages, I can either select all or if I clicked the
01:49Pages Option button, I could indicate the pages From and To that I wanted to include.
01:54With those settings in place, I'll click OK, and Crystal Reports exports my file to a web page.
02:03When you export a report to a web file, it makes the report visible to anyone with a web browser.
02:08Selecting the HTML 4.0 setting will correctly render the data in pretty much any modern browser.
02:16
Collapse this transcript
Exporting a report to an XML file
00:00Earlier in this chapter, I showed you how to export data using a Comma-Separated Value file.
00:06One limitation of CSV files is that they do not include any information about the data inside the file.
00:12In this movie, I will show you how to export your data to an Extensible Markup Language,
00:17or XML, file, which can include information about your data.
00:21To begin the export process, open the File menu, point to Export, and then click Export Report.
00:29Then, in the Export dialog box, click the Format control, and scroll down to the bottom list and click XML.
00:38We do want to export to a disk file, so we can leave the destination setting in place
00:43and then go ahead and click OK.
00:46XML interpreters, which can include spreadsheet programs such as Microsoft Excel, databases
00:51such as Microsoft Access, and so on, use what are called schemas to interpret data that's coming in.
00:57Unless you're told differently, you should use the Crystal Reports XML (default) schema
01:03to export your data.
01:05Someone in your company's IT department would have had to tell you to use another schema
01:09and install that on your system for you to be able to use it.
01:13Unless you're told differently, use the default schema to export your data.
01:18With that in place click OK. After you click OK, the Choose export file dialog box appears.
01:25You can navigate to select the target folder,
01:28change the file name if you want--we won't in this case--
01:31and then also make sure that the Save as type is .xml.
01:36With that in place, you can click Save, and Crystal Reports exports your file.
01:41Most large companies use XML or a version of XML to communicate data among applications.
01:47If for some reason a colleague can't read an XML file you sent to them, you should
01:51check with your IT folks to see if you need to apply a specific schema to the file.
01:56If so, they should give you the address of the file on your network, which you can then
02:00use in the procedure I described in this movie.
02:05
Collapse this transcript
Conclusion
Additional resources
00:00Thanks again for taking the time to work through Crystal Reports 2011 Essential Training.
00:06I hope you've learned a lot, and I've have had a lot of fun teaching it to you.
00:09If you want to learn more, I do want to recommend several additional resources.
00:13If you need to share a Crystal Reports document with someone who doesn't have Crystal Reports,
00:18they can view it using the Crystal Reports Viewer,
00:21and you can find that on the main site of cystalreports.com.
00:25If you want more in-depth instruction on our Crystal Reports, I highly recommend
00:29the book Mastering SAP Crystal Reports 2011 + SAP Crystal server 2011, by David Mcmanus,
00:37and the book is put out by Kuiper Publishing.
00:40If you want to get help from the community of other SAP Crystal Reports users, you can
00:44find that online at scn.sap.com/welcome.
00:50Thanks again and best of luck.
00:54
Collapse this transcript


Suggested courses to watch next:

Access 2010 Essential Training (3h 30m)
Alicia Katz Pollock

SQL Server 2008 Essential Training (6h 54m)
Simon Allardice


Excel 2010 Essential Training (6h 21m)
Bob Flisser

Access 2010 Power Shortcuts (3h 43m)
Alicia Katz Pollock


Are you sure you want to delete this bookmark?

cancel

Bookmark this Tutorial

Name

Description

{0} characters left

Tags

Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading
cancel

bookmark this course

{0} characters left Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading

Error:

go to playlists »

Create new playlist

name:
description:
save cancel

You must be a lynda.com member to watch this video.

Every course in the lynda.com library contains free videos that let you assess the quality of our tutorials before you subscribe—just click on the blue links to watch them. Become a member to access all 104,069 instructional videos.

get started learn more

If you are already an active lynda.com member, please log in to access the lynda.com library.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Access to lynda.com videos

Your organization has a limited access membership to the lynda.com library that allows access to only a specific, limited selection of courses.

You don't have access to this video.

You're logged in as an account administrator, but your membership is not active.

Contact a Training Solutions Advisor at 1 (888) 335-9632.

How to access this video.

If this course is one of your five classes, then your class currently isn't in session.

If you want to watch this video and it is not part of your class, upgrade your membership for unlimited access to the full library of 2,025 courses anytime, anywhere.

learn more upgrade

You can always watch the free content included in every course.

Questions? Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com.

You don't have access to this video.

You're logged in as an account administrator, but your membership is no longer active. You can still access reports and account information.

To reactivate your account, contact a Training Solutions Advisor at 1 1 (888) 335-9632.

Need help accessing this video?

You can't access this video from your master administrator account.

Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com for help accessing this video.

preview image of new course page

Try our new course pages

Explore our redesigned course pages, and tell us about your experience.

If you want to switch back to the old view, change your site preferences from the my account menu.

Try the new pages No, thanks

site feedback

Thanks for signing up.

We’ll send you a confirmation email shortly.


By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked