Sie sind auf Seite 1von 102

Epicor 9 Crystal Reports Course

Instructor

Disclaimer
Copyright 2008 by Epicor Software Corporation. All rights reserved. Printed in the United States of America. No part of this publication may be reproduced in any form without the prior written consent of Epicor Software Corporation. Epicor, Vantage, and Vista are registered trademarks of Epicor Software Corporation. All other trademarks are property of their respective owners. Microsoft product screen shots reprinted with permission from Microsoft Corporation. Epicor Software Corporation makes no representations or warranties with respect to the contents of this document and specifically disclaims any implied warranties of merchantability, satisfactory quality or fitness for any particular purpose. The contents of this document are believed to be current and accurate as of its date of publication. Changes to this document between reprintings and other important information about the software product are made or published in release notes, and you are urged to obtain the current release notes for the software product. We welcome user comments and reserve the right to revise this publication and/or make improvements or changes to the products or programs described in this publication at any time without notice. The usage of any Epicor Software shall be pursuant to an Epicor end user license agreement and the performance of any consulting services by Epicor personnel shall be pursuant to Epicor's standard services terms and conditions.

ED84690

90521-900-9226-583503

9.04.503

Crystal Reports Course | TOC | iii

Contents
Crystal Reports Course................................................................8 Before You Begin.......................................................................10
Audience.................................................................................................10 Prerequisites...........................................................................................10 Setup.....................................................................................................10

Crystal Reports Overview..........................................................12 Setup Review............................................................................15


Workshop - Access Crystal Reports and Define Report Defaults.......................15 Open Crystal Report Options.............................................................15 Set up Layout .................................................................................15 Set up Reporting .............................................................................15 Set up Numbers ..............................................................................15 Set up Dates...................................................................................16 Sort Fields and Tables.......................................................................16

Overview...................................................................................18
Create a BAQ Report................................................................................20 BAQ Report File Locations..........................................................................20 Workshop - Define BAQ Report Paths..................................................21 BAQ Report Header Detail.........................................................................22 Workshop - Define Report Header Detail.............................................23 Optional Fields.........................................................................................24 Workshop - Add Option Fields............................................................25 Filters.....................................................................................................25 Workshop - Define Filters..................................................................26 Sorts......................................................................................................27 Workshop - Label Sorts.....................................................................27 The BAQ Report Designer Actions Menu.......................................................28 Test the BAQ Report.........................................................................29 Generate Sample Data......................................................................29 Design Crystal Report.......................................................................30 Deploy the BAQ Report.....................................................................30

Crystal Standard Report Wizard................................................32


Workshop - Define Early-Late Job Report.....................................................32 Verify the Report Option Paths...........................................................32 Enter the BAQ Report Header............................................................33 Establish an Option Field...................................................................33 Test the Report Form........................................................................33 Generate Sample Data......................................................................34 Design a Crystal Report....................................................................34 Workshop -Create a Report Using the Crystal Report Wizard..........................34

iv | Crystal Reports Course | TOC

Access the Standard Report Wizard....................................................34 Select Data Sources.........................................................................34 Select the Tables..............................................................................35 Review the Links..............................................................................35 Review the Fields.............................................................................35 Review the Optional Choices..............................................................36 Save the Report...............................................................................36 Resize Field Lengths.........................................................................36 Move the Fields...............................................................................37 Insert a Field...................................................................................37 Add a Report Title............................................................................37

Database Concepts....................................................................39
Identify Table and Field Names...................................................................39 Using the Online Technical Field Help..................................................40 Customization Tools.........................................................................41 Data Dictionary Viewer.....................................................................43 Table Linking...........................................................................................44 Dataset Relationships Tracker............................................................45 Join Types.......................................................................................47

Custom Report Design Tools.....................................................49


Workshop - Define Manufactured Parts Report in Vantage..............................49 Verify the Report Option Paths...........................................................49 Enter the BAQ Report Header............................................................49 Test the Report Form........................................................................50 Generate Sample Data......................................................................50 Design a Crystal Report....................................................................50 Add a Report Table...........................................................................51 Workshop - Create a Manufactured Parts Listing Report.................................52 Insert and Resize Fields....................................................................52 Rearrange the Fields........................................................................53 Enter Report Groups.........................................................................53 Modify the Group Header Preview.......................................................54 Insert Summary for a Numeric Field...................................................54 Insert Summary for a Text Field.........................................................55 Deploy the Report............................................................................55

Add Presentation Quality to Custom Reports.............................56


Workshop - Add Presentation Quality Formatting to Custom Reports...............56 Format Total Borders........................................................................56 Format the Subtotal Borders..............................................................56 Copy Field Format............................................................................57 Insert Text Objects...........................................................................57 Format the Report Title.....................................................................57 Resize Text Objects..........................................................................58 Insert Group Footer Text Objects........................................................58

Crystal Reports Course | TOC | v

Rename Column Headers..................................................................58 Format Column Headers...................................................................58 Insert Special Fields.........................................................................59 Resize and Format Special Fields........................................................60 Perform Additional Report Formatting.................................................60 Insert a Line...................................................................................60 Add Boxes......................................................................................60 Insert Company Logo.......................................................................61 Workshop - Defining Options for Manufactured Parts Listing...........................61 Add an Option.................................................................................62 Add a Filter.....................................................................................62 Add a Sort......................................................................................62 Test and Preview the Report..............................................................62

Create a Direct Labor Report.....................................................64


Workshop - Define the Direct Labor Report..................................................65 Add a Report...................................................................................65 Test and Preview the Report..............................................................65 Generate Sample Data......................................................................65 Workshop - Prepare for Crystal Formatting..................................................65 Select Data Sources.........................................................................66 Add the Report Result Table...............................................................66 Review the Links..............................................................................66 Workshop - Create a Direct Labor Report.....................................................66 Re-arrange Default Fields..................................................................67 Add a Formula.................................................................................67 Insert Fields....................................................................................68 Format the Column Headings.............................................................68 Insert Groups..................................................................................68 Insert Group Summaries and Grand Totals..........................................69 Insert Text Objects...........................................................................69 Insert Presentation Quality Detail.......................................................70 Save and Exit the Report..................................................................70 Workshop - Defining Options for Direct Labor Report.....................................70 Add Options....................................................................................70 Add a Filter.....................................................................................71 Add a Sort......................................................................................71

Deploy the BAQ Report..............................................................72


Workshop - Deploy and Publish a Report.....................................................72 Deploy the Report............................................................................72 Add the Report to Menu....................................................................72 Test the Report From the Menu..........................................................73

Modify Existing Crystal Reports Forms......................................75


Workshop - Modify the Purchase Order Form................................................76 Add a PO Form................................................................................76

vi | Crystal Reports Course | TOC

Add a Report Definition.....................................................................76 Add a Report Style...........................................................................77 Create the XML File..........................................................................77 Set the Database Location.................................................................77 Insert a Company Logo.....................................................................78 Suppress Closed Lines on the PO Form...............................................79 Establish the Modified Form as the System Default.......................................80 Workshop - Establish the New Purchase Order Form as the System Default.80

Independent Workshop: Create a Booked Orders Report..........81


Workshop - Define the Booked Orders Report...............................................81 Add a Report...................................................................................81 Test and Preview the Report..............................................................81 Generate Sample Data......................................................................81 Workshop - Prepare for Crystal Formatting..................................................82 Select Data Sources.........................................................................82 Add the Report Result Table...............................................................82 Review the Links..............................................................................83 Independent Workshop - Create a Booked Orders Report...............................83 Delete the Default Fields...................................................................83 Add a Formula.................................................................................83 Insert Fields....................................................................................84 Insert Groups..................................................................................84 Add Subtotals and a Grand Total........................................................85 Add a Page Header Section...............................................................85 Insert a Report Title.........................................................................85 Format Column Headers...................................................................86 Edit the Column Header Field Names..................................................86 Insert a Line...................................................................................87 Insert a Company Logo.....................................................................87 Insert Descriptive Text......................................................................87 Workshop - Defining Options for Booked Order Report...................................88 Add Options....................................................................................88 Add Filters......................................................................................88 Add Sorts.......................................................................................89 Deploy the Report............................................................................89 Test the Report................................................................................89

Miscellaneous Reporting Activities............................................90


Conditional Formatting Formulas................................................................90 Workshop - Use Conditional Formatting in Crystal Reports.....................90 Conditionally Format Fields Using the Highlighting Tool..................................91 Workshop - Use the Highlight Expert in Crystal Reports.........................92 Format Report Sections Using the Section Expert Tool...................................92 Workshop - Use the Section Expert Tool in Crystal Reports....................93 Group Sort Expert Tool..............................................................................94

Crystal Reports Course | TOC | vii

Workshop - Use the Group Sort Expert Tool.........................................94 Running Totals.........................................................................................96 Workshop - Create a Running Total ....................................................96 Export Reports into Different Formats for Purposes of Report Distribution........97 Workshop - Export Reports................................................................97

Conclusion................................................................................98 Appendix...................................................................................99
Group Sort Expert Tool..............................................................................99 Workshop - Use the Group Sort Expert Tool.........................................99 Crystal Reports Frequently Asked Questions about Formulas........................100

8 | Crystal Reports Course | Crystal Reports Course

Crystal Reports Course


This course is designed as an introduction to Crystal Reports writing. The student will learn to design and create new reports using both Crystal Reports and the system's BAQ Report Designer, as well as modify existing Crystal forms. In addition, fundamentals of relational database concepts such as tables, table relationships, records and field types will be discussed. Crystal Reports is a powerful reporting tool that helps you design flexible, high-quality reports, virtually from any data source including XML and OLAP. Extensive formatting options means complete control over how data is presented. These design and formatting options include grouping, sorting, field highlighting, and field summarization. Epicor 9 has an integral relationship with Crystal Reports through its Business Activity Query (BAQ) technology. The data that is to be pulled into a Crystal Report is gathered using a BAQ. The BAQs for this course are pre-defined and therefore there will be no discussion on how to build a BAQ. Upon successful completion of this course, you will be able to: Name the components of the Crystal Reports Designer main menu. List the attributes of the Design and Preview screens. Set Crystal Report defaults. Gain a basic understanding of how to use an existing BAQ as the data source. Review the purpose of the BAQ Report Designer and how you create a report's user interface. Become familiar with the design functionality available in the BAQ Report Designer. Understand the steps to transfer your BAQ Report Designer report into Crystal Reports Understand ways to identify tables and field names. Describe the usage of the data dictionary viewer and the dataset relationship dashboard. Identify the different types of joins. Design Crystal Reports using the Standard Report Wizard. Design reports using Custom Design tools. Group report data. Set up subtotals and grand totals. Use the Formula Editor to create calculated fields. Format reports for presentation. Attach a completed report to the Vantage menu system. Create conditional formatting. Export reports and attach a report to a system menu. Modify the standard Crystal Report forms.

Epicor Software

Crystal Reports Course | Crystal Reports Course | 9

Instructor Note Introductions Introduce yourself to the group and have students introduce themselves to the group. Review housekeeping items (location of restrooms, break/lunch arrangements, etc.). Explain that the course is informal, however, cell phones should be shut off and IM communication is only permitted during scheduled breaks and the lunch hour. Stress importance of asking questions, stopping instructor when something is unclear, and taking notes. Expectations Review any expectations students submitted prior to class. Ask students if they have any additional expectations and list them on the flipchart/whiteboard. Identify any expectations that are covered in another course or discuss them off-line. Learning Roadblocks Ask students what roadblocks can get in the way of meeting the learning objectives and record these on the whiteboard/flipchart. Explain that both the facilitator and students must try to avoid learning roadblocks and to tell each other when they arise. Ask students if they have questions about the learning roadblocks.

Epicor Software

10 | Crystal Reports Course | Before You Begin

Before You Begin


Read this topic for information you should know in order to successfully complete this course.

Audience
Specific audiences will benefit from this course. System Administrator IT/Technical Staff

Prerequisites
Before you begin this course, be sure you understand the prerequisite knowledge contained in other valuable courses. Navigation Course - This course introduces the navigational aspects of the system's user interface. Designed for a hands-on environment, general navigation principles and techniques are available at each of the interface levels of system, module, and program within the application. Workshops focus on each of these levels and guide you through each navigational principle introduced. BAQ and Advanced Dashboard Course - The Business Activity Query (BAQ) program allows the user to create personalized queries and copy standard queries so they can be modified. Once a query is created, it can be viewed through the Dashboard interface. The queries can also be exported as .xml or ASCII files which allow the user to view and edit third party applications. Queries can be created that are only available for the user, or they can be shared queries available to everyone in the company. Recommended Industry Knowledge: Exposure to other database report generator programs Fundamental knowledge of relational database concepts such as table relationships, records, and field types. Understanding of the functionality of the current release of the business software application

Setup
Setup is required before you begin this course. The Epicor 9 release must be installed and operational in a training environment. The workshops contained in this course were written using the Education Database Epicor USA (EPIC03) company. To ensure successful results, you must complete all workshops logged into the same database and company. You may need to contact a manager for help to ensure the database is properly installed. Determine if the database is installed on the client server ("networked-environment") or installed locally.

Epicor Software

Crystal Reports Course | Before You Begin | 11

A networked-environment exists when one education database is installed on the client server and all trainees are accessing that server at the same time. Some issues can arise during application training within a networked-environment. Successive Self-Paced Training: Because some courses share the same data requirements (part numbers, inventory transactions, and group IDs), a clean or restored copy of the data is required after each time a student completes a course. The education database can easily be restored at any time to provide fresh data for subsequent training sessions. Concurrent Self-Paced or Classroom Training: Sometimes more than one student is training on the same course at the same time. If these multiple users have access to a single installation of the same education data, any data that is created or updated during this training may affect on-going training efforts. Instructor Note The following setup is needed to instruct this course: Use the following settings for this course: Database Login Password Company Default Epicor900 manager manager EPIC03 - Epicor USA

Depending on what phase this course is taught (implementation, upgrade, refresher), some of the above setup may not be necessary. If teaching this session during the implementation phase, you may wish to add codes applicable to the company's business when demoing or ask students to add codes applicable to their company's business as they complete the workshops. It is highly recommended to review the account that will be used for training to verify all codes and constants are appropriate based on the workshops and to familiarize yourself with the course. At times the Facilitator Notes suggest the instructor complete each workshop, and then ask students to complete the workshop. If a small number of students are in class, you may prefer to do the workshops together. Open a system session to navigate to programs within the course. Use the Alt + Tab keys to navigate between the course and system session. Verify documentation (e.g., program and field help) execute on your PC and the student's PC's. If training in a networked environment, please read the Networked Environment Guidelines document prior to training. This document is available as a Shared Document on the EPICweb.

Epicor Software

12 | Crystal Reports Course | Crystal Reports Overview

Crystal Reports Overview


Crystal Reports delivers tools for integrating dynamic content from the system database into powerful reports. This section focuses on the components found in the Crystal Reports' windows - addressing the features and functionalities of these components. Crystal Reports Main Screen Instructor Note Navigate to the Crystal Reports main screen. Demonstrate and discuss the various elements of the Crystal Reports main screen. Menu Bar The Crystal Reports menu bar options depend upon whether you are at the main screen or have started to design a new report. File, View and Help are available from the main screen. Other menu selections become available in the design phase of a custom report, such as Edit, Insert and Format. Standard Toolbar Many of the commands frequently accessed from the menu have been conveniently grouped on the Standard toolbar. The toolbar remains on the screen and can be turned off using the Toolbars command on the View menu. Note Tool tips appear if the mouse hovers over any icon on the toolbar. These tips provide a brief description of the icon's function. Formatting Toolbar The Formatting toolbar is below the Standard toolbar, and it enables you to format one or more selected objects on a report. Simply select the object(s), and then select one or more of the format options from that toolbar. Insert Toolbar The Insert toolbar provides easy access to the Crystal Report functions that insert new items into the report. These include: Text Objects, Groups, Summaries, Sub-reports Lines, Boxes, Pictures and more. Expert Toolbar Crystal Reports provides a number of advanced functionalities via the expert tools or wizards. These include the following experts: Database, Group, Sort, Section, Formula Workshop, Select Expert and more. Print Preview Window The components of this window work much the same way as any Windows print preview mode. The specifics of each of the following components will be discussed later in this course, but are listed here for purposes of recognition and discussion. Design and preview tabs Close Preview Window button Beginning of Report and Page Back buttons Page Forward and End of Report buttons Group Tree display area

Epicor Software

Crystal Reports Course | Crystal Reports Overview | 13

Report Sections display area Actual report preview area Instructor Note 1. Navigate to a sample report. C:\Program Files\Business Objects\Crystal Reports 11.5\Samples\en\Reports\Feature Examples\Running Totals Group.rpt. 2. Open the report in a Print Preview window. 3. Explain to students that components of this window are discussed in detail later as reports are written. Report Design Window The components of this window are related primarily to the textual elements of a report - the headers, footers and details. Instructor Note 1. Click the Design tab to open the Report Design window. 2. Tell students that the components of this window will be described at this time, but will be discussed in greater detail later in the course when designing a report. Report Header Any object that is placed in the Report Header prints only on the first page of a report. This is often where the report date and the company logo are placed. Additional special fields such as Report Comments, File Path and Name may also be printed here. Page Header Data or objects that are placed in the Page Header print at the top of every page. Column headings print in this section by default. Details When selecting the data fields to be included in the report, place them in the Details area. The size of these fields may be adjusted as needed for the report. Keep in mind, if there are 1,000 records on your report, there will be 1,000 detail sections. Report Footer Data such as grand totals are typically placed in the Report Footer as items in this section print one time on the last page of the report. Page Footer If items need to print or appear at the bottom of every page, place it in the Page Footer. This may be another place to put page numbers and information such as the company address and phone number. Field and Report Explorer The Field Explorer and Report Explorer are combined in a window docked by default to the right side of the report area. This explorer tool can be undocked to float or closed and opened via the Menu bar or the Field or Report Explorer buttons on the Standard toolbar.

Epicor Software

14 | Crystal Reports Course | Crystal Reports Overview

Instructor Note Navigate to the Field Explorer window and then the Report Explorer and demonstrate the components outlined for each below. Field Explorer The Field Explorer is used to insert, delete, or modify fields for your report and is available on both the Design and Preview tabs. It displays a tree view of Database fields and Special fields that can be added to a report as well as Formula, Parameter, and Group Name fields that are defined for use in the report. A toolbar is available on the Field Explorer to insert, delete, edit, and rename existing fields. Report Explorer The Report Explorer displays a tree view of the sections in your report and lists the report objects contained in each section. Within each section, the report's fields and objects are listed. Any item selected in the tree view will be selected in the report (in either Design or Preview modes). Report fields and objects can be modified by selecting them in the Report Explorer. When you right-click on an item, a menu that contains the actions that can be carried out on the item displays. For example, if you right-click on a text object, the menu will contain the options to edit the text, to format its font or color, and so forth. Note You cannot add additional fields or report objects when using the Report Explorer, but you can delete them.

Epicor Software

Crystal Reports Course | Setup Review | 15

Setup Review
Before designing a Crystal Report in this course, several Crystal Reports' defaults must first be set. Some of these defaults change the layout and operation of Crystal Reports. Others change the formatting of some fields in the rest of your reports. Instructor Note This workshop has to be completed once you have opened Crystal - with no report in focus. Explain that this is to lay the default look and feel of Crystal - most of the same options are available at the report level as well. Some are best left to the field level, like can grow.

Workshop - Access Crystal Reports and Define Report Defaults


This workshop demonstrates how to access Crystal Reports and define report defaults.

Open Crystal Report Options


1. From the Start menu, navigate to Crystal Reports. Open Crystal Reports for Epicor. 2. From the File menu, select Options. The Options window is used to modify settings that apply to the reporting environment creating system defaults that can be overridden on a report by report basis.

Set up Layout
1. Verify you are on the Layout sheet. 2. Set up the Design View section. Select the check boxes: Guidelines Grid 3. In the Grid options section, verify the Snap to Grid check option is selected.

Set up Reporting
1. Select the Reporting sheet. 2. Clear the Save Data with Report check box. By default, Crystal Reports has the Save Data With Report options enabled. The purpose of this is to execute, or refresh, the query inside of Crystal on demand while formatting the report. This course uses the BAQ Report Designer to define the Crystal Reports and therefore, the query execution is controlled at the BAQ Report Designer level.

Set up Numbers
The numbers sheet is used to customize how numbers display on the report.

Epicor Software

16 | Crystal Reports Course | Setup Review

1. Select the Fields sheet. 2. Click Number. The Format Editor opens. 3. Select the Number sheet. The Custom Style window opens. 4. On the lower left of the screen, click Customize 5. Select the Use Accounting Format check box, then clear it. Negatives will now display as (123) rather than -123. You could also change such formatting features as the number of decimal places to display, and how many decimal places to round to. 6. Verify the Allow Field Clipping check box is cleared. The #### will be printed when a column is not set wide enough to print an entire value. If it selected, this feature would only print as many digits as the field width would allow, starting from the right side of the field. Thus 1,010,000 might display as 10,000, for example. 7. To customize the currency symbol., select the Currency Symbol sheet. 8. Verify the Enable Currency Symbol check box is selected. When you select the Use Accounting Format check box on the Number sheet, the Enable Currency Symbol check box and Floating option is selected automatically. Floating options positions the symbol to the left of the number value displayed. Fixed option positions the symbol at the far left side of each number displayed. 9. 10. 11. 12. In the Currency Symbol field, enter a dollar sign. Clear the Enable Currency Symbol check box Click OK once to exit the Custom Style window. In the Format Editor window, click OK to save the new default Number field format and close the window.

Set up Dates
1. On the Fields sheet, click Date. The Format Editor opens. 2. To Customize dates, select the Date sheet. 3. On the lower left of the screen, click Customize The Custom Style window opens. 4. In the Month field, select 03 5. In the Day field, select 01 6. Click OK once to exit the Custom Style window. 7. In the Format Editor window, click OK to save the new default Date field format and close the window.

Sort Fields and Tables


1. Select the Database sheet. 2. In the Tables and Fields section, select Sort Tables Alphabetically and Sort Fields Alphabetically. This action simplifies the table and field selection process. 3. Click OK to save new defaults.

Epicor Software

Crystal Reports Course | Setup Review | 17

The option changes take effect when the next time a report is designed, or if a report is currently being designed. Some of them might take effect when the next field is inserted. There is no effect on any work that you have already done.

Epicor Software

18 | Crystal Reports Course | Overview

Overview
The BAQ Report Designer enables you to turn a Business Activity Query (BAQ) into a Crystal Report. You create these personalized queries through Business Activity Query; you design each query to pull in a customized set of information from your database. Before you create the BAQ report, you must first create the Business Activity Query. This BAQ must contain the Company column within its table; if the Company column is not present, the BAQ report will not work properly. After you finish creating the BAQ, you will then select it on your report. The BAQ Report Designer is the intermediary step between creating BAQ and formatting finalized Crystal Report. The purpose of the BAQ Report Designer is to allow you to design a BAQ Report user interface directly from your Business Activity Queries. Important In order to effectively use the BAQ Report Designer, you should have solid knowledge of both Business Activity Queries and Crystal Reports. The reports you create through this tool are flat reports; they are restricted to only pulling data from the table defined on their selected BAQs. Note The selected BAQ can be new, a standard BAQ that has been modified, or simply, a standard BAQ. In addition, each BAQ used in the BAQ Report Designer must have a Company column. This course uses a standard BAQ to complete the workshops. Process Flow for BAQ Report Designer The process flow of the BAQ Report Designer is comprised of: Creating a BAQ, whether from a standard BAQ, BAQ you create, or modified BAQ Pulling your BAQ into the BAQ Report Designer, designing the report's interface, and sending it to Crystal Reports Working on the report layout in Crystal Reports Placing BAQ Report interface on the Main Menu for others to access

Epicor Software

Crystal Reports Course | Overview | 19

BAQ Report Examples There are several standard BAQ reports already in the system:

Epicor Software

20 | Crystal Reports Course | Overview

Employee Efficiency Report Rebate Transactions Resource Group Efficiency Rebate Contract Summary Note These reports were created using the BAQ Report Designer, so you have the ability to customize them as needed. You can link to user defined fields in the Report Parameters table as well. This allows you to pass additional information to Crystal Reports, expanding the power of Crystal when you are designing report layouts.

The standard BAQ Report interface for the Employee Efficiency Report is a good example to reference as you progress through the course, as this report was created using the BAQ Report Designer. The Employee Efficiency report is located under the following: Menu Path: Production Management Job Management Reports Employee Efficiency The Employee Efficiency report summarizes labor details. You can filter this report by departments, employees, or both. Also note this report only displays labor data for the dates you select.

Create a BAQ Report


You must first define your directory paths and review the key menu features available when designing a report's user interface. Then use the BAQ Report Designer to select the Business Activity Query (BAQ) as the base for a report. Also define the option fields, filters, and sort by options to appear on the report interface. Menu Path: Executive Analysis Business Activity Management General Operations BAQ Report Designer Note The reports you create using the BAQ Report Designer tool are flat reports, which means they are restricted to only pulling data from the table(s) defined on their selected BAQs.

BAQ Report File Locations


Before you create reports with the BAQ Report Designer, you must define the local paths to use with this tool. The BAQ Report Options ensure the report exports to Crystal Reports, is saved locally for easy retrieval, and generates sample data for testing prior to completion. You need to define the local paths that will be used to save the report files. You must define three paths -- the Crystal Reports Executable, the Sample Data Directory, and the Local Reports Directory. When you first create a report, the BAQ report designer will automatically place the .rpt report file within the Local Reports Directory.

Epicor Software

Crystal Reports Course | Overview | 21

Instructor Note Review the help information for these fields: Crystal Reports Executable Sample Data Directory Local Reports Directory Examples of paths are: C:\Program Files\Business Objects\Crystal Reports 11.5\crw32.exe for Crystal Reports Executable C:\Documents and Settings\All Users\Application Data\Epicor\Vantage\8.03.304\VN10T\shared\Reports\SampleData for Sample Data Directory C:\Documents and Settings\All Users\Application Data\Epicor\Vantage\8.03.304\VN10T\shared\Reports for Local Reports Directory Note The path statements above should not be considered recommended path statements as they are only examples. Be sure to select the Copy Report Locally check box so the BAQ Report Designer creates a duplicate copy of each BAQ report as a backup. Instructor Note Review the help information for the Copy Report Locally check box. Additional Information There are also read-only fields for the Server Reports Directory and the BAQ Report Template. Instructor Note Review the help information for these fields: Server Reports Directory BAQ Report Template

Workshop - Define BAQ Report Paths


Path locations are usually defined once for all BAQ Report Designer reports. The paths indicated below are examples; you may wish to organize your BAQ reports differently.

Set up BAQ Crystal Reports


Note The instructor will lead you to the correct path, if not already identified. The BAQ Report Designer is used in future workshops and can be minimized. , so keep this program open; your Report Options are the same as you define them here. 1. Click the Actions menu and select the BAQ Report Options command. 2. In the Crystal Report Executable field, enter the path for Crystal Report Designer. a) Click the Browse (...) button. b) Browse for the executable file for Crystal Report Designer. Usually it is crw32.exe.

Epicor Software

22 | Crystal Reports Course | Overview

Instructor Note The classroom machines should all be set up with this Crystal Report Executable path: C:\Program Files\Business Objects\Crystal Reports 11.5\crw32.exe. These paths are per User ID, so the directories and the Crystal paths may vary for each user. c) Click Apply. 3. From the Actions menu, select the Design Crystal Report option to verify that the Crystal Report Executable path is correct. If the path is correct, Crystal Reports opens. 4. Exit Crystal Reports.

Set up BAQ Reports Options


The Report Options defined guide the system through the interaction between Epicor and Crystal Reports. The paths defined in this workshop represent the paths used in a classroom environment. These paths may be modified to the local workstation environment as necessary. 1. Click the Actions menu and select the BAQ Report Options command. 2. In the Sample Data Directory path field, click the Ellipsis (...) button. . In the classroom, browse for the path c:\_BAQReports\Sample Data. It is recommend the same directory be created on the workstation. 3. Click the Actions menu and select the BAQ Report Options command. 4. In the Local Reports Directory path field, click the Ellipsis (...) button. In the classroom, browse for the path c:\_BAQReports\Reports. It is recommend the same directory be created on the workstation. 5. Verify that the Copy Report Locally check box is selected. Note that this copies the .rpt file to the local machine when it is first created. To copy locally once the report is defined and deployed to the server, modify the Form Title; the report will copy locally again. 6. Click Apply. Instructor Note The classroom machines should all be set up with these paths: Sample Data Directory C:\_BAQReports\Sample Data. Local Reports Directory C:\_BAQReports\Reports. In a network environment, these paths should be entered by User ID.

BAQ Report Header Detail


Use the BAQ Report Designer - Detail sheet to define the primary details of your BAQ report. This sheet allows you to set up the report's identifier and description. Also select the Business Activity Query (BAQ) that will be used as the base query for this report.

Epicor Software

Crystal Reports Course | Overview | 23

From the New menu, use the New Report Definition option to create a new BAQ report. The BAQ ID is the name of the BAQ being used as the basis for creating a new report. Report ID is the identifier for the BAQ report. The Report ID will become your Crystal Report (.rpt) file name. Instructor Note Review the help information for these fields: BAQ ID Report ID Description Form Title Example In the Employee Efficiency Report, the BAQ ID is zEmployeeEfficiency, the Report ID and the Crystal Report file are EmplEff, and the Description and the Form Title are Employee Efficiency Report. Instructor Note Explain that the Employee Efficiency Report will be used as the basis for set up discussions. Each report in this course requires the same setup. Demo Point out the fields as they are discussed. 1. 2. 3. 4. 5. From the New menu, select New Report Definition to create a new BAQ report. In the Report ID field, enter EmplEff. Note that this populates the Crystal Report field. In the BAQ ID field, search for and select zEmployeeEfficiency. Enter Employee Efficiency Report as the Description and the Form Title. Click Clear.

Explain that you will go through these in further detail in a later workshop.

Workshop - Define Report Header Detail


This workshop demonstrates how to define Report Header Detail. If you closed the program, navigate to BAQ Report Designer. Menu Path: Executive Analysis Business Activity Management General Operations BAQ Report Designer 1. Click New and select New Report Definition. 2. On the Detail sheet, enter the BAQ Report Header information. 3. In the Report ID field, enter APInvOpen and press Tab The Crystal Reports (.rpt) field is automatically populated. 4. In the Description field, enter Open AP Invoice Report 5. In the BAQ ID field, enter or browse for the standard report Open AP Invoice Report (zAPInvHeadOpen). 6. In the Form Title field, enter Labor Hours Report. 7. Click Save. The steps completed to this point include the path locations and the report definition. These steps will always have to be completed before you begin any BAQ Report Designer/Crystal Report. Other field definitions (Options, Sorts, and Filters) should always be part of your

Epicor Software

24 | Crystal Reports Course | Overview

report plan; however, they may be defined before the report is formatted using Crystal Reports, or after. Refer to the Strategy Sheets in the Appendix for planning guidelines. Instructor Note Note that students should be able to use the standard report zAPInvHeadOpen to complete this workshop.

Optional Fields
The BAQ Report Options enable you to set up the main user input fields for the report. These fields allow users to define the BAQ data that will display when the report is generated. For example, you can use this sheet to define the From and To date range fields users can select. Use the New Option Field option from the New menu to add new user input fields to the BAQ report. When you have selected the query on the BAQ Report Designer - Detail sheet, use the Option Fields sheet to turn any field on the selected BAQ into an input field. You can then enter the Field Label for the option field and the Compare Operator that defines what data will be displayed in the report. Instructor Note Review the help information for these fields: Option Field Field Label Compare Operator Data Type Default Order Example In the Employee Efficiency Report, the To and From date range fields are option fields. Instructor Note Demo Bring the Employee Efficiency Report interface up and point out the To and From fields in the Report Options section as examples of option fields. In the BAQ Report Designer, click Report ID and click Search. Select EmplEff. This brings up the standard BAQ for the Employee Efficiency Report. Point out the columns as they are discussed. 1. Click the Option Fields sheet and compare what is seen here to what appears on the actual report interface as To and From. 2. From the New menu, select New Option Field to create a new option field. 3. Click Option Field to show the available options. Explain that you will go through these in further detail in a later workshop.

Epicor Software

Crystal Reports Course | Overview | 25

Workshop - Add Option Fields


This workshop shows how to turn fields on the selected BAQ into an input field for report criteria. If you closed the program, navigate to BAQ Report Designer. Menu Path: Executive Analysis Business Activity Management General Operations BAQ Report Designer Note Any field in the BAQ is available as an Option Field.

Instructor Note Note that students should be able to use the standard report zAPInvHedOpen to complete this workshop. 1. Select the Option Fields sheet. 2. Enter an option field. a) Click New and select New Option Field. b) Point the cursor to the empty cell of the Option Field column. The down arrow of the drop down menu appears. c) In the Option Field field, select APInvHed.InvoiceDate. d) e) f) g) h) Click the empty cell of the Field Label column to populate it. Change the Field Label from Invoice Date to Enter Start Date. In the Compare Operator field, select the Greater Than or Equal To option (>=). Verify the Data Type is date. In the Order field (last column of the grid), enter 1.

3. Enter another option field. a) Click New and select New Option Field. b) Point the cursor to the empty cell of the Option Field column. The down arrow of the drop down menu appears. c) Click the empty cell of the Field Label column to populate it. d) In the Option Field field, select APInvHed.InvoiceDate. e) Change the Field Label from Invoice Date to Enter End Date. f) In the Compare Operator field, select the Less Than or Equal To option (<=). g) Verify the Data Type is date. h) In the Order field (last column of the grid), enter 2. 4. Click Save.

Filters
The Filters sheet enables you to define the various filters that will be available on the BAQ report's Filter tab. These items restrict the records that will print on a report. Filters can limit reports to only display items related to a single record or a range of records. Use the New Filter option from the New icon to add new filters to the report.

Epicor Software

26 | Crystal Reports Course | Overview

Instructor Note Review the help information for these fields: Filter Filter Label Tab Label Example In the Employee Efficiency Report, the Employee and Dept options are filters.

Instructor Note Demo Bring the Employee Efficiency interface up and point out the Employee and Dept options on the Filter tab as examples of filters. Point out the columns as you discuss them. 1. Click on the Filters sheet and compare what you see here to what appears on the actual report interface as Type Code. 2. From the New menu, select New Filter to create a new filter (using the zEmployeeEfficiency BAQ from the previous demonstration). You can also demonstrate adding new filters by pressing Enter at the end of the last line. 3. Type a slightly different Filter Label and Tab Label to show how these can be changed. Explain that you will go through these in further detail in a later workshop.

Workshop - Define Filters


This workshop demonstrates how to define filters. If you closed the program, navigate to BAQ Report Designer. Menu Path: Executive Analysis Business Activity Management General Operations BAQ Report Designer Any indexed field in the BAQ will be available as a filter. Instructor Note Note that students should be able to use the standard report zAPInvHedOpen to complete this workshop. 1. Select the Filters sheet. 2. Add a new filter. a) Click New and select New Filter. b) Point the cursor to the empty cell of the Filter column. The down arrow of the drop down menu appears. c) In the Filter field, select APInvHed.VendorNum. d) Click the empty cell of the Filter Label column to populate it. e) For the Filter Label and Tab Label, accept the default values. 3. Add another filter. a) Click New and select New Filter. b) Point the cursor to the empty cell of the Filter column. The down arrow of the drop down menu appears.

Epicor Software

Crystal Reports Course | Overview | 27

c) Click the empty cell of the Filter Label column to populate it. d) In the Filter field, select APInvHed.CurrencyCode. e) For the Filter Label and Tab Label, accept the default values. 4. Click Save.

Sorts
Use the Sorts sheet to design the sort orders that can by used with the current BAQ report. Sort orders indicate the sequence in which the records will be displayed on the report. These sort orders will then be displayed on the Sort By list on the report interface. Use the New Sort option from the New menu to add a sort to the report. Note Sorts created here are used by the application to limit the data passed to Crystal Reports. Remember that grouping inside Crystal is the first sort in Crystal. There may be times when you want to handle the sort options within Crystal, rather than limit the raw data coming from the application into Crystal. Instructor Note Review the help information for these fields: Name Sort Field Order Ascending Example In the Employee Efficiency Report, the Employee\JC Department and JCDepartment\Employee options in the Sort By field are sorts. Instructor Note Demo Point out the fields as you discuss them. 1. From the New menu, select New Sort to create a new sort field (using the Employee\JCDepartment BAQ from the previous demonstration). To demonstrate how to add either new sort options or sort fields, press Enter after the last entry in the section with the same title. 2. Under Sort Options in the Name field, enter Employee\JCDepartment. 3. Under Sort Fields, click the New icon and point out that users can designate the Sort Fields, Order, and whether or not to use an Ascending or Descending sequence for each sort. Explain that you will go through these in further detail in a later workshop.

Workshop - Label Sorts


This workshop demonstrates how to design sort orders for use in the BAQ report. If you closed the program, navigate to BAQ Report Designer. Menu Path: Executive Analysis Business Activity Management General Operations BAQ Report Designer

Epicor Software

28 | Crystal Reports Course | Overview

Instructor Note Note that students should be able to use the standard report zAPInvHedOpen to complete this workshop. 1. Select the Sorts sheet. 2. Enter a new sort. a) Click New and select New Sort. b) Under Sort Options in the Name field, enter Supplier\Date. 3. Enter another sort. a) Click New and select New Sort. b) Under Sort Options in the Name field, enter Date\Supplier. 4. Click Save.

The BAQ Report Designer Actions Menu


Once the report has been defined and "registered" with Epicor 9, it is time to gather the data. A BAQ is used as the data foundation and has to be executed, or "Tested", within the Business Activity Query creation program to populate initially. When the BAQ is linked to the report using the BAQ Report Designer definition we just discussed, it is then "executed" based on the report criteria when the sample data is created. This section will explain how to test the BAQ for accuracy and then how to generate the sample data. Once you have data, the newly defined report is passed to Crystal Reports for further formatting. Design Crystal Report The Design Crystal Report feature allows you to launch the current BAQ Report in the Crystal Report application. When selected, this command searches for the Crystal Report .exe file in the Crystal Report Executable path, pulls it into Crystal Reports, and launches the application. Deploy BAQ Report The Deploy BAQ Report command copies the current report in focus from your local reports directory as defined earlier up to the Server\Reports\ directory. After this has been done, the report can be deployed to a menu or executed using the Report Definition screen. Download Report This option is used when a copy of the deployed report is to be brought back down to the local reports directory. A selection screen comes up to allow choice of report to bring down. Copy BAQ Report This option allows you to create a duplicate of the current BAQ Report (.rpt file). The new copy is saved to the local reports directory as defined in the Report Locations. You would use this selection when you want to begin modification directly inside Crystal. Export BAQ Report This option copies the current .rpt file and exports an exact copy to another location. It is important to remember to export the BAQ being used for the report as the query is not be copied as part of the report.

Epicor Software

Crystal Reports Course | Overview | 29

Import BAQ Report Use this program to move a BAQ report back into the manufacturing system. This option requires the creation of a new identifier for the report. You will also indicate whether or not this report can be edited within the BAQ Report Designer.

Test the BAQ Report


After you design your report, you need to test the user interface. Use the Test Report Form command to display the interface for the current BAQ report. You can then test the option fields, filters, and sort orders defined for the report. On the BAQ report interface, option fields are displayed in the Report Options section. Use the filters by clicking the Filters tab and selecting the records you need; the filter options you select are then displayed in the Filter Summary section. All the sorts can be selected from the Sort By list.

Workshop - Test the BAQ Report


Test the BAQ report's user interface for the report created earlier. If you closed the program, navigate to BAQ Report Designer. Menu Path: Executive Analysis Business Activity Management General Operations BAQ Report Designer Instructor Note Note that students should be able to use the standard report zAPInvHedOpen to complete this workshop. 1. Click the Actions menu and select the Test Report Form command. This opens the standard report parameter selection options as determined by settings created in the above steps. This function actually generates an .xml file that is used later in as the datasource within Crystal Reports. 2. Review the Selection sheet information for report options (Option Fields) and sorts and review the Filter sheet for available filters. 3. Close the Report Form. Once the print screen has opened, Epicor creates a new datasource .xml file in the Mfgsysdata\Reports\username directory which may also be used if the report requires the full data rather than the sample data created in the next step.

Generate Sample Data


The Generate Sample Data command enables you to create data you can use to test the current report. It runs the BAQ selected on the current report to generate data. This data is saved to the Sample Data Directory. The data can help to design the final layout of the report within Crystal Reports.

Workshop - Generate Sample Data


Generate sample data to use when designing the layout in Crystal Reports. If you close the program, navigate to BAQ Report Designer. Menu Path: Executive Analysis Business Activity Management General Operations BAQ Report Designer 1. Click the Actions menu and select the Generate Sample Data command.

Epicor Software

30 | Crystal Reports Course | Overview

The interface between Epicor and Crystal requires that a background "temp" .xml file is created. Once created, it becomes the datasource for the Crystal Report. The Generate Sample Data function creates that xml file. After the data is generated, a Sample data was successfully created. dialog box appears. 2. In the dialog box, note the path and the name of the data file (an .xml file). 3. Click OK to confirm that the sample data was created successfully. At this point, you have actually run the BAQ and the data that is generated into the xml file is available for Crystal to use. The sample data is designed to present a subset of the actual data - just enough for you to format the Crysal Report. It is always a good idea to check the number of records that were pulled by the initiall execution of the BAQ. The full amount of data will be displayed once the report has been deployed.

Design Crystal Report


After you define the report using BAQ Report Designer, you are ready to design the report's layout using the Crystal Reports application. You can launch this application from the Actions menu. The Design Crystal Report command enables you to launch the current BAQ report within the Crystal Report application. This command causes the program to search for the Crystal Report .exe in the Crystal Report Executable path. When it finds this file, Crystal Reports launches. Before you open your BAQ report in Crystal Reports, run the Generate Sample Data command from the Actions menu to generate some sample data you can use with the report.

Workshop - Design the Crystal Report


This workshop demonstrates the Crystal Report design function. If you closed the program, navigate to BAQ Report Designer. Menu Path: Executive Analysis Business Activity Management General Operations BAQ Report Designer Note This command is run only to demonstrate the Crystal Report design function. In this course, we focus on designing the BAQ Report interface in the system. For additional information, refer to the Crystal Reports course. 1. Click the Actions menu and select the Design Crystal Report command. Crystal Report launches. 2. In the Crystal Report application from the File menu, select Exit to close the report window.

Deploy the BAQ Report


After you design the report, you can place it on the Main Menu. Use the Deploy BAQ Report command to move the current BAQ report to the network. The program moves the report from the Local Reports Directory to the Server Reports Directory on the server. When you save a new BAQ report, the tool automatically creates a style and a data definition for the report. The style defines how this report will appear when it is displayed and printed. You can edit these styles in Report Style Maintenance. Both Report Style and Report Data Definition are located under System Management - Company Maintenance.

Epicor Software

Crystal Reports Course | Overview | 31

Workshop - Deploy the BAQ Report


This workshop shows how to use the Deploy BAQ Report functionality. If you close the program, navigate to the BAQ Report Designer program. Menu Path: Executive Analysis Business Activity Management General Operations BAQ Report Designer 1. Click the Actions menu and select the Deploy BAQ Report command. If necessary, confirm all your actions in the appearing dialog boxes. The .rpt file is placed in the Server Reports Directory on your server. You can now make this BAQ report available to other users within your company by placing it on the Main Menu. 2. Verify that the report exists in Report Style Maintenance. Menu Path: System Management Company Maintenance Report Style 3. Exit BAQ Report Designer.

Epicor Software

32 | Crystal Reports Course | Crystal Standard Report Wizard

Crystal Standard Report Wizard


Crystal Reports comes with several Report Creation Wizards that will walk you through the steps to build a report. Our focus will be on the using the Standard Report Wizard as it relates to building reports inside of Epicor. Reports may be deployed by attaching to Epicor menu which will be discussed in a future workshop. Instructor Note Review the business case before completing the workshop. If the class size is small, complete the workshop before asking students to complete the workshop. If the class size is large, ask students to complete the workshop as you complete the workshop. In either case, fully discuss the steps as they are completed. Standard Report Wizard Standard Report Wizard will step you through the various decisions required to lay the foundation of a basic report. The steps included are table selection, linking, selection criteria, grouping and template usage. BAQ Report Designer reports are not a good candidate for the standard wizard as most of the steps are pre-defined by the BAQ Report Designer program. Cross-Tab Report Wizard Cross-Tab Report Wizard is used to define a report that takes a row of data and makes it a column. As an example, this type of report would be used to create a sales report that shows total sales by Region - all the data comes from row information. More information is available in Crystal Reports Help for this type of report which is beyond the scope of this course. Mailing Labels Report Wizard Mailing Labels Report Wizard is used to create a report that is printed on labels. OLAP (Online Analytical Processing) OLAP (Online Analytical Processing) is a data-mining type function. This type of report requires data built using the Crystal Enterprise OLAP features and is beyond the scope of this course.

Workshop - Define Early-Late Job Report


Even though we plan to generate this report using the Crystal Report Standard Wizard, the datasource has to be created first. Each report requires a new report definition inside the BAQ Report Designer. This workshop shows how to define BAQ Report Definitions for the new report.

Verify the Report Option Paths


Navigate to BAQ Report Designer. Menu Path: Executive Analysis Business Activity Management General Operations BAQ Report Designer 1. Verify the report paths are correct.

Epicor Software

Crystal Reports Course | Crystal Standard Report Wizard | 33

Verify the paths are correct for: Crystal Report Executiable Sample Data Local Reports Directory 2. Verify the Sample Data path is correct. 3. Verify the Copy Report Locally check box is selected.

Enter the BAQ Report Header


1. Click New and select New Report Definition. 2. In the Report ID field, enter EarlyLate (no spaces). This automatically populates the Crystal Reports (.rpt) field. 3. 4. 5. 6. In the Description field, enter Early-Late Jobs Report. In the BAQ ID field, serach for and select EPIC03-EarlyLate. In the Form Title field, enter Early-Late Jobs Report. Click Save.

Establish an Option Field


This report is to display records for incomplete jobs. An option field is used to limit the job selection to those that are not flagged as complete. 1. 2. 3. 4. 5. 6. 7. Click New and select New Option Field. In the Option Field field, select JobHead.JobComplete and press Tab. In the Field Label field, enter Complete and press Tab. Verify the Compare Operator is =. Accept the default entry in the Data Type field. In the Option Field field, enter False to limit the jobs to those not completed. Click the Save icon.

Test the Report Form


1. Click the Actions menu and select the Test Report Form command. This opens the standard report parameter selection options as determined by settings created in the above steps. This function actually generates an .xml file that is used later in as the datasource within Crystal Reports. 2. Select the Print Preview icon from the Standard Toolbar to view. 3. Review the Selection sheet information for report options (Option Fields) and sorts and review the Filter sheet for available filters. 4. Close the Report form. Once the print screen has opened, Epicor creates a new datasource .xml file in the Mfgsysdata\Reports\username directory which may also be used if the report requires the full data rather than the sample data created in the next step.

Epicor Software

34 | Crystal Reports Course | Crystal Standard Report Wizard

Generate Sample Data


1. Click the Actions menu and select the Generate Sample Data command. The interface between Epicor and Crystal requires that a background temp .xml file is created. Once created, it becomes the datasource for the Crystal Report. The Generate Sample Data function creates that xml file. You do not see the full record count when the report is first previewed inside Crystal Reports. This datasource is then used inside Crystal Reports to pull tables and fields for the report. After the data is generated, a Sample data was successfully created. dialog box appears. 2. In the dialog box, note the path and the name of the data file (an .xml file). 3. Click OK to confirm that the sample data was created successfully. At this point, you have actually run the BAQ and the data that is generated into the xml file is available for Crystal to use. This is a good time to glance at the data being presented to make sure it has pulled the query data you expected it to pull.

Design a Crystal Report


Note In order to demonstrate the Crystal Wizard, we will not use this feature at this time. We will access the sample data file as a datasource within the wizard. 1. Click the Actions menu and select the Design Crystal Report command. Crystal Report launches. 2. In the Crystal Report application from the File menu, select Exit to close the report window. 3. Click Save and exit the program.

Workshop -Create a Report Using the Crystal Report Wizard


This workshop shows how to design reports using the Crystal Report Wizard. BUSINESS CASE: Your Production Manager would like to have a report that shows the early or late status in days of all released production jobs currently scheduled. The report needs to show any linked customer orders and the part they are ordering.

Access the Standard Report Wizard


1. From the Start menu, navigate to Crystal Reports. 2. In the New Reports section of the Start Page, click Standard Report Wizard. If the Crystal Reports Start Page does not come up when entering Crystal Reports, simply click on the New icon from the Standard Toolbar to begin the Standard Report Wizard.

Select Data Sources


1. In the Available Data Sources section, navigate to Create New Connection > ADO.Net (xml) and double-click it. The datasource file path window will open. 2. In the File path field, browse to the Sample Data folder. 3. Select just created EarlyLate_Date.xml file and click Open.

Epicor Software

Crystal Reports Course | Crystal Standard Report Wizard | 35

4. In the File Path window, click Finish.

Select the Tables


1. In the Available Data Sources section, navigate to Create New Connection > ADO.Net (xml) > ReportDataSet. Since we did not use the Design Crystal Report feature, the Crystal Standard Report Wizard requires us to select the tables for the report. 2. Double-click BAQReportParameter, Company, and BAQReportResult tables to move them to the Selected Tables section. The Data screen displays the table(s) required for the report in alphabetical order. 3. Click Next to continue.

Review the Links


The relationship between the BAQReport Results and the other tables is not obvious to Crystal as there are few indentical fields. We will have to create our own links. 1. Arrange the tables so that BAQReportResult is under the Company table and the BAQReportParameter is on the right of the Company table. 2. In the BAQReportParameter table, find the Company field. 3. Verify the Company field of the Company table has an link line (arrow) to the JobHead.Company field in the BAQReportResults table 4. In the Company table, click the Company field and drag and drop it on top of the Company field in the BAQReportParameter table. You should see a line created between the two tables to indicate a link has been made. 5. Double click on the link between Company and BAQReportParameters table to change the join options. 6. From the Join Types section, select Left Outer Join and click OK. Note that a left outer join is needed here because all BAQReportParameter fields will be used regardless of matches found from the other tables. 7. Click Next.

Review the Fields


1. In the Available Fields section, select the BAQReportResult table. 2. Move the fields to the Fields to Diplay section. Double-click all these fields: JobHead.DueDate JobHead.JobNum JobHead.PartNum JobHead.ReqDueDate JobProd.OrderLine JobProd.OrderNum JobProd.OrderRelNum

Epicor Software

36 | Crystal Reports Course | Crystal Standard Report Wizard

Reorder the fields using the up and down arrows above the Fields to Display box if necessary. 3. Click Next.

Review the Optional Choices


The Crystal Reports Wizard provides three other choice screens which do not apply to our report. The are described below: Instructor Note Explain to the students that no action is required on these next screens. Advance through each by pressing the Next key after a short discussion of each. Grouping The group selection screen of the wizard allows the data to be grouped by a specific field, or fields. Each group can then be summarized to provide a sub-total by the group as well as provide a grand total. Any available field can be totaled by Crystal Reports. Also, many summary types are offered, depending upon the type of field being summarized. A later workshop addresses how to do this manually. Record Selection Record selection is used to limit the records coming into the report. The Filter field of the BAQ Report Design definition is also used to limit the record. The report definition has declares the data is to be limited by the company and to select incomplete jobs. Additional record selections may be made from the fields in the BAQReportResult table, however we will not do that at this time. Report Templates Crystal Reports provides pre-defined templates for use as formatting options. A template can also be created from a customer made report file. No template is to be used for this report.

Save the Report


1. Click Finish to display the report. 2. Save the report as EarlyLateJob.rpt in the Reports folder. Note Crystal Reports will Save Data with Report unless that option is turned off. You may do so for this report only from the File menu under Report Options, disable Save Data With Report. To disable this feature for all future reports, open the File menu, select Options and then select Reporting. Turn off Save data with report.

Resize Field Lengths


The JobNum and PartNum fields are quite long and room is needed to enter a calculated field showing early/late days. Also, there is no report title. We will focus on making these changes, although many other adjustments could be applied as well. The next portion of this workshop is report adjustments. 1. Navigate to the Design sheet. 2. Press the Ctrl key and click the JobHead.JobNum field in the Detail section and the JobHead.JobN field in the Page Header section.

Epicor Software

Crystal Reports Course | Crystal Standard Report Wizard | 37

Both fields will now have a border around them. 3. Click and hold the right border and move it to the right to shorten the length of both fields. 4. Repeat the process with the JobHead.PartNum field. Notice that there is now additional room to the right of each of the fields adjusted.

Move the Fields


1. Select the guideline arrow in the ruler attached to the JobHead.PartNum field and left-click the mouse. 2. Move the PartNum fields to the left while staying within the ruler. Leave at least one grid of space between the JobHead.JobNum and JobHead.PartNum fields. 3. Repeat the process for the JobHead.DueDate and JobHead.ReqDueDate fields. There is now room to insert a calculated field for early/late days.

Insert a Field
Insert a calculated field using the Field Explorer that is usually located on the right side of the screen. 1. In the Field Explorer, right-click the x+1 Formula Fields line and select New. You can alternatively select New from the Button bar tool. 2. In the Name field, enter Early-Late and click OK to open the Formula Workshop Formula Editor screen. a) Under Report Fields, double-click the BAQReportResult.JobHead.DueDate field to select it in the formula. The field appears in the section with the appropriate brackets selected. b) Under Operators > Arithmetic, double-click Subtract. c) Under Report Fields, double-click the BAQReportResult.JobHead.ReqDueDate field. d) Click Save and close. 3. In the Field Explorer > x+1 Formula Fields, select the Early-Late formula field and drag and drop it into the empty area of the Details section. A field header will be created in the Page Header section at the same time. 4. Click Save.

Add a Report Title


When the Report Wizard created the report and found that no data was to be placed in the report header, it automatically suppressed the section. The next steps remove the suppression. 1. On the Design sheet, find the Report Header section on the left-hand side of the screen. 2. To increase the size of the Report Header section drag the bottom border down a bit. 3. Insert a text object. a) On the Insert toolbar, click Insert Text Object. The curser becomes a cross shape. b) Click in the Report Header section. c) Inside the text objects rectangle, type Early Late Jobs Report as the report title when the curser drops inside the text objects rectangle.

Epicor Software

38 | Crystal Reports Course | Crystal Standard Report Wizard

d) Click outside the text object. 4. Move the text object to the left-hand side of the Report Header section. 5. Change the title font. a) Change the font size to 14 point. b) Expand the text object to accommodate a larger font. 6. Save the report. 7. Navigate to the Preview sheet to preview the report. Instructor Note Remind the students that the data displayed is not the complete result set of the BAQ until that BAQ is deployed. All the data will display the next time the report is displayed after deployment. This is meant to be a demo of how a simple report can be made in the Crystal Report Wizard. Other formatting, such as column heading definition, are discussed in future workshops. 8. Exit the program.

Epicor Software

Crystal Reports Course | Database Concepts | 39

Database Concepts
This section introduces database topics related to the custom report generation process. Topics covered will include discussion on the following: Table and field name identification. When writing reports using Crystal Reports, a fundamental requirement is to identify the tables within the database that contain the data required for the report. Additionally, you must identify the field names used to store that data. Data dictionary viewer. This tracker is a source for determining probable join fields based on a dataset definition for directly related tables. Table joining/linking processes. When two or more tables are used to query data, a link has to be defined in order to pull records from both tables. This linking process involves identifying which table is to be the parent and which is to be the child. The Parent/Child relationship is then further defined by finding common fields to use as matching criteria for record selection. This section discusses topics relative to table join concepts, requirements, and the use of indexed fields to create the table link. Join types. Once linking processes are understood, the discussion then turns to the three types of joins that are available for use when writing Crystal Reports or queries. Instructor Note Log on with the username of Manager and password of Manager. This login has permission to use the Customization tool.

Identify Table and Field Names


The first requirement of any report or query is to locate the data. The Epicor 9 database is a relational database and therefore all data is stored in a collection of tables and fields. There is one common question that occurs when writing reports or queries, especially for the report writer who is unfamiliar with the database structure and naming conventions. This question is:I know where the data is entered and located, but where do I find the table and field name? This is a normal question, and the answer becomes easier over time due to exposure to the database. For the purposes of writing a custom report or query, you already know where certain data crucial to the report is entered. What is not necessarily known, however, is the specific database table or field names for the data. There are tools in the system to aid in the table and field identification. Those tools include accessing online field-level help to see technical details, the Customization Tools, and the Data Dictionary Viewer.

Epicor Software

40 | Crystal Reports Course | Database Concepts

Using the Online Technical Field Help


The Field Help feature is a quick reference tool. It provides a brief description of the field and also a technical property reference for the selected field. To begin the field help, select the specific field in the interface and then Field Help from the Help menu of any screen. A tree view appears on the left side of the screen with two headings, Field Help and Technical Details (if you have permission to view technical details), for that specific field. The Field level Help screen is divided into to sections: Field level help is the text description of this field taken from the Help system. The field help can be used as a learning tool, as it helps to get immediate documentation on each field. Technical detail is the field's data dictionary information. You may need the technical specifications of a field for building BAQs, BPM methods, and when using other advanced functions of the application. Note You can view technical details only if you have the permission to access the corresponding business object. This permission is set in the Process Security Maintenance program, for the bo.DataDict business object.

Workshop: Using Online Field Help


When asked to create a query or a report, the type of information needed in the query and a time frame is usually all the information received. Next comes the challenge of determining where the data can be found. It's all about tables and fields. Every user interface (UI) form is a mini database containing a collection of tables and fields to display data. The first thing to determine is how or where the information entered into Epicor. For example, a query or report is to be built to show a parts listing that displays part and part bin information. Ask yourself the following questions: 1. What kind of information might be included in a query or report that is to display parts? Write down the probable fields. 2. Where is information on parts entered? Answer: Part Maintenance screen. 3. What is a part bin? Answer: a place in the warehouse that holds parts. 4. Where is the part bin information entered or displayed? Answer: in the Warehouse Maintneance table or the Warehouse Bin maintenance table. It is viewed on the Plants-Warehouse-Bins sheet of the Part Entry Screen. Use the online field help to find the table and field names. Navigate to the Part Maintenance program Menu Path: Material Management Inventory Management Setup Part 1. Set the cursor in the part number field. Select Field Helpfrom the Help menu . The field help tree opens and positions itself on the left side of the screen. It automatically opens in an undocked position. 2. Dock the Field Help window by moving the cursor to the Field Help tab and then click the push pin icon. This docks the field help tree on the left of the screen, however it can be undocked and positions like any other sheet in the user interface (UI). 3. Click the part number field and then click the Technical Details sheet of the Field Help tree.

Epicor Software

Crystal Reports Course | Database Concepts | 41

The Technical Detail sheet displays the Data Dictionary information for the selected field. The properties that are display are very helpful when creating BAQs. These properties are discussed in the section dedicated to the Data Dictionary Viewer. Of importance to the BAQ writer are: Field Name: This property presents actual name of the field as it is known to Epicor 9. This is the name used in all expessions. Epibinding: This property displays the table and field name of the field in focus. In this case, the field is called Part.PartNum which means the table you want to use is the Part table and the Field you pull in the query is the part num. The syntax is always Tablename.Fieldname. DBField: Indicates the database field property which also displays the table.name. Format: The Progress database format for this field and the the number of characters that field is limited to. In this example it is a character field with and has 50 characters. Like: The like property is for validating a BAQ Search and also to generate Foreign Key Views to indicate the common field between two tables or datasets. 4. Select the Plants sheet , the Warehouses-Detail sheet and then set the cursor in the Primary Bin field. The properties populate with the data on this field. Write down the table and field:_________________________. Some field information can be found in several tables. Is the query going to include warehouses? If so, then perhaps this field is useful. If not, the bin information has to come from another source. Note Often the data is stored in multiple places and the table selection depends on the purpose of the query. This example is to present a parts listing with part bin location. 5. Select the Plants -Warehouse-Bin Information sheet. Set the cursor in the Bin field on this sheet. Write down the table and field information for this field: _____________________ 6. Select Close from the Field Help window. The Technical Details of the field help are quite valuable in helping to understand the table structure of the database. Keep in mind that the data may reside in mutliple tables. The query topic will dictate where the data comes from. The customization feature is another good way to locate table sand fields.

Customization Tools
You can customize nearly every program within the application. A powerful tool, customizations can save you time and money, as these modifications let you directly match the application to your business needs. The application offers you a variety of customization tools. You can add controls like text boxes and lists which are then linked to a data source you can select. You can also create new sheets that you can make available to all users, specific users, and even different companies. You can also activate your own customized code through events or new buttons; this feature lets you run processes that are unique for your company. Within this course the Customization is used as a look-up tool to help identify table and field names that house the data when you want to write a custom report. Example To create a report on shipping activity listing the tracking number assigned to the shipment, use the Customization Tools to locate and identify the table and field names that house this data.

Epicor Software

42 | Crystal Reports Course | Database Concepts

The system runs in two modes - Run Mode and Developer Mode. Normally you use the application in Run Mode. This means the application sheets are used for normal activities like data entry, operation processes, and report generation. Important In order to customize a program, your user record must be set up to allow customization rights. Your adminstrator assigns you these rights within the User Account Maintenance program.

Workshop - Reference Customization Tools


This workshop demonstrates how to reference Customization Tools.

Activate the Developer Mode


Important Developer Mode will not be available unless the user has Customization permission. This is given by selecting the Customize Privileges check box on the Security sheet of the User Account Maintenance program. Menu Path: System Management Company Maintenance User With this permission, any sheet or window is modifiable, so use caution when granting these priviliges. From the Options menu, select Developer Mode.

Identify Table and Field Names


Navigate to Customer Shipment Entry. Menu Path: Material Management Shipping / Receiving General Operations Customer Shipment Entry 1. Select the Header sheet. 2. If asked to clear this form, click Yes. 3. Verify the Tracking Number field is in view. Move the Customization Tools Dialog (default) window to a location that does not block visibility of the field used to hold tracking number information. 4. Identify table and field names. a) In the Customer Shipment Entry window, click the Tracking Number field. b) In the Customization Tools Dialogue (default) window, view the table and field names in the DataSource and DataField fields. The DataSource field indicates that the Tracking Number field is located on the ShipHead table. The DataField field indicates that the field name for the Tracking Number field is TrackingNumber. So, the full identifier for this Tracking Number field is ShipHead.TrackingNumber. c) On the Customer Shipment Entry window, navigate to other fields to view the DataSource (table) and DataField (field) values for these fields. 5. Experiment with a few other screens such as the Parts Maintenance or Order Entry screens 6. Exit the programs. Once the table candidates have been selected for the query, the the Data Dictionary Viewer is a good tool to help understand what the tables are and any possible join fields.

Activate the Run Mode


1. From the Options menu, select Developer Mode.

Epicor Software

Crystal Reports Course | Database Concepts | 43

2. To verify that you are in this mode, click on the Options menu again. The Developer Mode command is not selected now.

Data Dictionary Viewer


The Data Dictionary Viewer lets you find and review details of each field and table within the database. It helps you better understand the purpose and data values of every field. Menu Path: System Management Data Dictionary Viewer Use the Data Dictionary Viewer program, for example, to identify the fields and tables you want for a customization or a custom report. This program is also an aid during upgrades, as you can view the current database structure to compare it against a previous database version. Note To access this report, select Print Field Definitions from the Data Dictionary Viewer's Actions menu and define the report parameters on the Data Dictionary Field Report window. Table Sheet Use the Tables sheet to find and select the database table you wish to review. The Data Dictionary is organized by tables. A table is a set of fields that contain related information. Example The Customer table is used to store all your customer records. The OrderHed table is the table that records your Order Header records. Instructor Note Review the help descriptions for these fields: Table Description Indexes Grid IndexName IndexFields Display VB Fields Display Format

Fields Sheet The Fields sheet displays specific information on each selected field. All the values for a selected field like format, label, and description are displayed on this sheet. Each table is made up of various fields. These items are the individual pieces of information associated with that table. Each field has a unique name. Example The customer table includes the customer's identifying code (CustNum), the customer's name (Name), and other specific details about the customer.

Epicor Software

44 | Crystal Reports Course | Database Concepts

Instructor Note Review the help descriptions for these fields: Field Name Format Decimals Extent Type Description Initial Value Column Label Label Mandatory Case Sensitive Display VB Fields Display Format Instructor Note Tell students that the Data Dictionary Viewer is a supplemental form of online help because of the data detail and definition it provides.

Workshop - Use the Data Dictionary Viewer


This workshop demonstrates how to use the Data Dictionary Viewer program. Navigate to the Data Dictionary Viewer. Menu Path: System Management Data Dictionary Viewer 1. In the Table field, enter OrderHed, and press Tab. The information is populated on the Fields sheet and Tree view. 2. View the table details. a) Verify you are on the Tables sheet. b) In the Description field, read the table description. c) In the Indexes grid, view the IndexFields column. d) In the Display Format section, select Alphabetic. 3. View the field details. a) Navigate to the Fields > Detail sheet. b) In the Field Name field, select DiscountPercent. c) View the information and answer the question: Can this field be left as zero? 4. Click Clear. 5. Repeat steps for the Customer.CreditLimit table and field. 6. Exit the program.

Table Linking
One necessary step in the table selection process is to link tables together. Links are created using one or more common fields to aid in the by selection of field data from multiple tables.

Epicor Software

Crystal Reports Course | Database Concepts | 45

Table Links In general, table linking is matching related records from one table to another table's records. This linking process involves using a common field between the selected tables. For example, if linking a Quote table and a Customer table, connect the tables so that each quote is matched up with the customer on the quote. Reporting or Querying tools use this connection to identify related records from one table with those from the other. With regard to the above example, the linking process ensures that the data in each line of the report refers to the same quote. Table Link Requirements Table link requirements involve a process of linking from one table to another. In this scenario, the primary table is the from table, whereas the to table is used as a reference for the primary table to lookup specific records. For example, if the Quote was the primary table, the querying or reporting tool chronologically goes field by field through the Quote table and searches for matching records in the second table, which may be Customers, until all fields are evaluated. Link Types The major link types used are one table to another, or one table to multiple other tables. One table to another This link type involves the primary table and lookup table having a one-to-one relationship between their records. One table to multiple others This link type involves the primary table and lookup table having a one-to-many relationship between their records. Indexed Fields An index field points to the location of the data. It is a named path designed within the database to quickly locate and store data, or easily retrieve it in a table. The index name and path, or index order, are identified in Data Dictionary and in the online Field Help-Technical Details window. Note Always use the Company field as it is the FIRST indexed field, and because it is at the top of the system table hierarchy. Each companys data is stored and separated from other company data by using the Company ID field. Since each and every table uses the Company field, it is an indexed field and must be selected as one of the fields to use in a join. Instructor Note Tell students that there are no exceptions to this rule! The Company field must be selected as a join field pair when linking tables, because Company is at the top for table hierarchy in the system. Your report will not give the correct results when the field is not used in a join.

Dataset Relationships Tracker


The Dataset Relationships Tracker displays the relationships between the system's datasets within a dashboard format. Use this table if you are creating custom reports and queries, as it can help you create joins between the tables within the query or report. This dashboard is similar to the Related Tables functionality that was available in previous versions. Menu Path: System Management Dataset Relationships

Epicor Software

46 | Crystal Reports Course | Database Concepts

Unlike other dashboard trackers, the Dataset Relationships Tracker automatically groups its grid by Dataset ID, Parent Table, and lastly, by Child. The Parent-Child table then displays the Parent field, its related Child field, and its Sequence. This helps illustrate the hierarchy within your database. Example The OrderHead table is the parent table to the OrderDtl table, or the Part table is the parent table to the PartPlant table. Advanced Search Sheet The Advanced Search feature is used to locate specific field data. Enter a value for the DataSet ID field, Parent Data Table field, or Child Data Table field. Click the Refresh button to search for the specific value(s). r. Dataset Relationships Sheet To display the data for all records linked to this tracker, click the Refresh All button. The tracker retrieves all records linked, starting with the first record, and displays the datasets in the Dataset Relationships Grid. Instructor Note Provide the following exercise to test understanding: For purposes of writing a custom Crystal parts report, most of the data required is from the Part table with some data required from the PartLot table. The two tables: Part to PartLot require linking. What are the fields pairs used to join the tables?

Workshop - Display the Dataset Relationships Tracker


Complete the steps below to display the Dataset Relationships Tracker. Navigate to Dataset Relationships. Menu Path: System Management Dataset Relationships 1. Determine the fields to use in a join. Note The Dataset Relationships program includes only tables directly related to each other. a) b) c) d) Select the Advanced Search sheet. In the Parent Data Table field, enter Part, and press Tab. In the Child Data Table field, enter PartLot, and press Tab. Click Refresh to display the part Dataset ID. When the green Refresh All button is selected, any indicated search criteria is erased, and all related tables will populate on the Dataset Relationships sheet. e) Select the Dataset Relationships sheet to view the relationship between the Part and PartLot tables. Two sequenced lines display on the Dataset Relationships Grid indicating that the two fields of Company and PartNum must be used in the join to link these tables. The fields appear in the Parent field and Child field columns. 2. Repeat the process.

Epicor Software

Crystal Reports Course | Database Concepts | 47

a) Determine the fields for the OrderDtl parent data table and the OrderRel child data table. b) List the join fields on a separate piece of paper to compare with the class. Instructor Note 1. Explain that the Dataset Relationships Tracker covers directly related tables. 2. This leaves room for discussions on how to join tables not directly related to each other. When the Dataset Relationships Tracker returns no records, the table join must be manually determined. If an Advanced Search returns no dataset it means the tables are not directly related. It does not mean they can't be joined. The Data Dictionary Viewer can be consulted to determine the probable join fields.

Join Types
This section defines the three available types of joins, and in the process identifies when each type is used during the report creation process. The common types of joins are Inner Joins, Left Outer Joins, and Right Outer Joins. Inner Joins An inner join, also known as an equal join, is the standard type of join. The report output from an inner join includes all the records in which the linked field value in both tables is an exact match. Records from either table that do not have a match in the other table are excluded from the report. The following diagram shows this relationship:

One example is joining the Customer table to the OrderDtl table, to create a view of customers and the orders they have placed. In this case, only customers with placed orders will be included in the report. Records for any customers who have not placed orders will be excluded. This join is typically used when the report needs to display only matching records between the primary table and the lookup table. Left Outer Joins The report output from a left outer join includes all the records in which the linked field value in both tables is an exact match. It also includes a row for every record in the primary, or left, table in which the linked field value has no match in the lookup table. Crystal Reports fills in the record fields with empty values when there is no exact match. The following diagram shows this relationship:

Epicor Software

48 | Crystal Reports Course | Database Concepts

For example, when using a left outer join to view all customers and the orders they have placed, you also get a row for every customer who has not placed any orders. These customers appear with blanks in the fields that would otherwise hold order information. Right Outer Joins In general, a right outer join works exactly the same as a left outer join but in reverse. The report output from a right outer join includes all the records in which the linked field value in both tables is an exact match. It also includes a row for every record in the lookup, or right, table in which the linked field value has no match in the primary table. Here again, Crystal Reports fills in the record fields with empty values when there is no match. The following diagram shows this relationship:

So, in the example, when using a right outer join to view all customers and the orders they have placed, you also get a row for every order without an assigned customer. These orders appear with blanks in the fields that would otherwise hold order information. The use of right outer joins should be discouraged, as your report may always be rewritten to use left outer joins, which tend to be more portable and easier to read and use.

Epicor Software

Crystal Reports Course | Custom Report Design Tools | 49

Custom Report Design Tools


To illustrate use of the custom report design tools, a Manufactured Parts Listing report will be created. The report must first be defined in the BAQ Report Designer as a new Report Definition. Once defined, the BAQ Report Designer Action Menu is used to transfer the data to the Crystal Report. At that time, the datasource is connected and the report is formatted. Once formatted, exiting Crystal Reportsreturns to the BAQ Report Designer for further deployment and testing. Although Crystal has selection critera, prompts, and filters, these actions are created inside the BAQ Report Designer. This report example creates Report Option field, Sorts, and Filters that are required after the report has been formatted using Crystal Reports XIR2. This workshop introduces elements such as manual insertion of fields, using multiple groups, subtotals and grand totals. When this workshop is completed, users are able to design reports from the Blank Design tab more quickly than the Wizard tool allows. Students decide for themselves when to manually create reports versus using the Standard Report Wizard, and how to blend the two approaches. Instructor Note Review the business case before completing the workshop. If the class size is small, complete the workshop before asking students to complete the workshop. If the class size is large, ask students to complete the workshop as you complete the workshop. In either case, fully discuss the steps as they are completed.

Workshop - Define Manufactured Parts Report in Vantage


This workshop shows how to define BAQ Report Definitions for the new report.

Verify the Report Option Paths


Navigate to BAQ Report Designer. Menu Path: Executive Analysis Business Activity Management General Operations BAQ Report Designer 1. Verify the report paths are correct. Verify the paths are correct for: Crystal Report Executiable Sample Data Local Reports Directory 2. Verify the Sample Data path is correct. 3. Verify the Copy Report Locally check box is selected.

Enter the BAQ Report Header


1. Click New and select New Report Definition. 2. In the Report ID field, enter MfgParts (no spaces).

Epicor Software

50 | Crystal Reports Course | Custom Report Design Tools

This automatically populates the Crystal Reports (.rpt) field. 3. In the Description field, enter Manufacturing Parts Listing. 4. In the BAQ ID field, enter or browse for the EPIC03-MfgParts query. 5. In the Form Title field, enter Manufacturing Parts Listing.

Test the Report Form


1. Click the Actions menu and select the Test Report Form command. This opens the standard report parameter selection options as determined by settings created in the above steps. This function actually generates an .xml file that is used later in as the datasource within Crystal Reports. 2. Select the Print Preview icon from the Standard Toolbar to view. 3. Review the Selection sheet information for report options (Option Fields) and sorts and review the Filter sheet for available filters. 4. Close the Report form. Once the print screen has opened, Epicor creates a new datasource .xml file in the Mfgsysdata\Reports\username directory which may also be used if the report requires the full data rather than the sample data created in the next step.

Generate Sample Data


1. Click the Actions menu and select the Generate Sample Data command. The interface between Epicor and Crystal requires that a background temp .xml file is created. Once created, it becomes the datasource for the Crystal Report. The Generate Sample Data function creates that xml file. You do not see the full record count when the report is first previewed inside Crystal Reports. This datasource is then used inside Crystal Reports to pull tables and fields for the report. After the data is generated, a Sample data was successfully created. dialog box appears. 2. In the dialog box, note the path and the name of the data file (an .xml file). 3. Click OK to confirm that the sample data was created successfully. At this point, you have actually run the BAQ and the data that is generated into the xml file is available for Crystal to use. This is a good time to glance at the data being presented to make sure it has pulled the query data you expected it to pull.

Design a Crystal Report


1. Click the Actions menu and select the Design Crystal Report command. Crystal Reports launches. 2. From the Database menu, select Set Datasource Location. 3. In the Replace with section, navigate to Create New Connection > ADO.Net (XML) and select it. 4. Select the Ellipsis (...) to browse for the xml report using the path to MFGSYSDATA\Reports\MANAGER\BAQ Report - MfgParts-XXXXX.xml. 5. Select the BAQ Report - MfgParts-XXXXX.xml file to open. XXXXX is a unique number. Using this .xml file displays all the records returned by the BAQ, rather than a sampling as seen when using the Sample Data .xml file.

Epicor Software

Crystal Reports Course | Custom Report Design Tools | 51

Everytime the Test Report function is run, a new .xml file is created in this directory. If there are more than one choices, then select the most recent date. 6. Click Finish. 7. Update information. a) In the Current Data Source section, highlight the ReportDataSet. b) In the Replace with section, highlight the DynamicReportDataSet. c) Click Update. d) In the Map Fields window, click OK. 8. In the Set Datasource Location window, click Close.

Add a Report Table


Add the BAQReportResult table to the report tables. We just connected the datasource to the Crystal Report. The datasource becomes a mini-database of information and will include three tables: Company, BAQParameters and BAQReportResult. Specific tables of the BAQ (like Part, Part Bin and Warehouse) are not displayed, but are incorporated into the BAQReportResult table. Crystal Reports reads the datasource and then provides access to the tables and fields inside the datasource for additional functionality in the Report. Every table and field is fair game for use in sorting, formulas/functions and other functions such as parameters directly inside of Crystal Reports. Following is a brief explanation of the purpose of each of the three tables: Company Table: Company is the highest level in the hierarchy of the Vantage Database. The Company table includes the Company field, the Company Name and the language used in the BAQ. Fields from this table are rarely used in Crystal reports, however they are imperative to the foundation of the BAQ table joins. BAQReportParameter Table: This table is populated with the Options, Sorts, and Filters that you defined inside the BAQ Report Designer. As an example, there are five fields inside this database that actually populate with the Filter data data (filter1 through filter5) and are therefore available to use inside Crystal reports for formulas, parameters etc. Also, like all Epicor tables it includes many user defined fields. BAQReportResults Table: This table populates with the results of the BAQ itself once it has been executed. Crystal reads this table and then all the fields w are displayed using the syntax of table. For example, Part.PartNum; PartBin.BinNum. Once the datasource is connected, only the Company and the BAQParameter tables are included in the available tables.Use the Database Expert to bring in the BAQReportResults table. 1. From the Database menu, select Database Expert. 2. Enter data information. a) Verify the Data sheet is opened. b) In the Available Data Sources section, select Create New Connection > ADO.Net (XML) > BAQReportResult. c) Click the right arrow to move the selected item to the Selected Tables section. 3. Enter link information. a) Select the Links sheet. b) Double-click the link line between the Company table and BAQReportParameter table. c) In the Join Types section, select Left Outer Join, then click OK twice to return to the BAQ Report Designer. The left outer join is needed here because all BAQReportParameter fields are used regardless of matches found from the other tables.

Epicor Software

52 | Crystal Reports Course | Custom Report Design Tools

d) Click OK to accept the links. 4. Save and ensure the name of the report is MfgParts.rpt. You are now ready to format the report using Crystal Reports.

Workshop - Create a Manufactured Parts Listing Report


A new report definition must be defined in the BAQ Report Designer and connected to an existing BAQ before you begin this workshop. In this workshop, the Manufactured Parts Listing report is designed using custom design tools. Many of the same screens used with the Standard Report Wizard will be encountered; however, the main focus in this workshop is to create the report manually in the Design window. BUSINESS CASE: You need to create a report that displays your manufactured parts listing the on-hand quantities. The report should group the parts by warehouse and part numbers.

Insert and Resize Fields


This step illustrates how to insert and resize fields, their column headers and other objects using the Design window. When Crystal first opens after connecting to the datasource several fields will appear in the Page Header section, however they are not necessary for this report. 1. In the Page Header section, hold Ctrl and click Print Date, Page N of M, and Report Titlespecial fields to select them. By default Crystal Reports generates special field that are replaced with variables. These fields are part of the base template for a blank report and are not required for this report. 2. From the menu bar, open Field Explorer. 3. Use Field Explorer to insert the fields from the BAQReportResult table. For these fields select the field name, drag it to the Design area and drop it within the Details section of the screen spacing them as necessary: Instructor Note Note that there are two ways to insert fields: The first one is: 1. Select the field name and click the Insert button. 2. Move the mouse pointer to the desired location. 3. Left-click to position the field where desired within the Details section. The second one is to: 1. Select the field name. 2. Drag it to the Design area and drop it within the Details section of the screen. Part.PartNum Part.PartDescription Part.MfgComment PartBin.BinNum PartBin.OnHandQty

4. Click Print Preview to view the field The data displayed within the report is minimal if the datasource is the sample data generated in the BAQ Report Designer definition stage. The record count that in the sample

Epicor Software

Crystal Reports Course | Custom Report Design Tools | 53

datat is minimal, however, once deployed the report will show all the data you expect.. You only need a subset to format the report, however, if you need to see all the data, applies will be smaller than the true datasaet when then If the .xml datasource is used from the MFGSYSDATA\Reports\MANAGER\ directory then the full set of data is displayed in Preview Mode. Note that the OnHandQty field may not be wide enough to display all the data. This is evidenced by the cross-hatching that appears when not wide enough. 5. 6. 7. 8. Select the Design sheet to return to the Design window for field resizing. Shorten the BinNum column header and field width. Widen the PartBin.OnHandQty column header and field width. Click Save.

Rearrange the Fields


Since the report is sorted by part number, there is no need to move this field. However, we want the part description to display next, followed by bin number, quantity and finally the comment field. There are a number of ways you can rearrange these fields. The steps below illustrate one efficient way to accomplish these moves. 1. Click on the guideline attached to the left side of the Part.MfgComment field and its column header. Drag and drop this tab as far to the right as possible. It will overlap other fields while making the other changes. 2. Drag and drop the guideline attached to Part.PartDescription to the left until it is almost touching the Part.PartNum field. 3. Drag and drop the guideline attached to PartBin.BinNum to the left until it is almost touching the Part.PartDescription field. 4. Drag and drop the guideline attached to PartBin.OnhandQty to the left until it is almost touching the PartBin.BinNum field. 5. Drag and drop the Part.MfgComment guideline from the end of the report to the left to position it beside PartBin.OnhandQty. 6. Reduce the width of the PartNum field and column header and move the other three fields farther to the left. 7. Click Save.

Enter Report Groups


The report has been sorted by part number and quantity on hand; however, a quick preview of the report may show that all of the numbers run together on each page. Further, it cannot easily be determined how many of each part number is on hand. In other words, the report is merely a nicely sorted listing of database records. There is no useful information for the reader yet. Creating groups based on the warehouse and part number field automatically creates a separate grouping of records for each part number with a heading for each group and a space between the groups making the report easier to read. In addition, once the report has one or more groups inserted, summaries can be added to generate useful information. 1. Click Insert Group. 2. On the Common sheet, select the BAQReportResult.Warehse.Description field.

Epicor Software

54 | Crystal Reports Course | Custom Report Design Tools

This should be located toward the bottom of the list under the BAQReportResult.Whse section. When the report is printed, the records are sorted and grouped by this selection. 3. On the Options sheet, select the Customize the Group Name Field check box. 4. Click the Choose From Existing Field option and find the Warehse.Description field. 5. Select both the Keep Group Together and Repeat Group Header on Each Page check boxes. The Keep Group Together option can be considered optional if it fragments the report. Simply click the Group Expert icon and deselect this field. 6. Click OK to save the group and return to the Design window. 7. Repeat the process for the second group of BAQReportResult.Part.PartNum. 8. Click Save and preview the report.

Modify the Group Header Preview


A group header is automatically generated for each grouping created. 1. To resize the group header, press Shift and then the left arrow key repeatedly until the field has been sized as desired. You can also grab the middle handle and stretch the column out with the mouse 2. Select the Preview sheet to view the report with the new group headings. To the far left of the Preview window, note the Group Tree. The Group Tree shows all groups that have been established for the report in a Windows Explorer type format. 3. Within the Group Tree window, click any particular warehouse or part number. 4. To turn the Group Tree on and off, either click the Toggle Group Tree icon on the Standard toolbar, or select Group Tree from the View menu. The report section identifications such as RH (for Report Header) and GH1 (for Group Header 1) in the gray area to the left of the Preview window. Right-click an ID to view the available functions for these sections.

Insert Summary for a Numeric Field


1. Select the Preview sheet. 2. Scroll over to the PartBin.OnhandQty column. 3. Right-click any value in that column and select Insert > Summary. The Insert Summary window displays. 4. Verify that PartBin.OnHandQty is in the Choose the field to summarize field, and Sum is in the Calculate this summary field. 5. Select the Add to All Group Levels check box. 6. Click OK to insert the summaries into the report. 7. Scroll through the Preview screen and examine the subtotals for the various part numbers (Group #1 and #2 values) The column may not appear wide enough to fit all of the quantity amounts or the subtotals. If the PartBin.OnhandQty field and column header have not been resized, this may be done now 8. Click Save.

Epicor Software

Crystal Reports Course | Custom Report Design Tools | 55

Insert Summary for a Text Field


The subtotals inserted so far are just a special type of summary. However, any field can be summarized in various ways based on the field type. In this step, you will summarize a text field, Part.PartNum with a Distinct Count. 1. Right-click any value in the Part.PartNum column and select Insert > Summary. 2. Verify that Part.PartNum is in the Choose the field to summarize field, and Distinct count is in the Calculate this summary field. 3. Select the Add to All Group Levels check box. 4. Click OK to insert the summaries into the report. 5. Click Save. 6. Preview the new report, save, and exit Crystal Reports. This returns you to the BAQ Report Designer.

Deploy the Report


1. Click the Actions menu and select the Deploy BAQ Report command. If necessary, confirm all your actions in the appearing dialog boxes. 2. Record path where the report was placed ______________________. This path would be important if this report was going to be published to the Main Menu.

Epicor Software

56 | Crystal Reports Course | Add Presentation Quality to Custom Reports

Add Presentation Quality to Custom Reports


There are certain elements that may be added to a report to give it presentation quality, thus making the report more readable. Using Crystal Report's custom report design tools, the presentation-enhancing elements include: formatting total fields with borders, text objects, special fields, graphic images (for example, company logo), lines and boxes.

Workshop - Add Presentation Quality Formatting to Custom Reports


This workshop shows how to add borders to Subtotal and Grand Total fields and to insert text objects, such as labels, to clarify the reports data for the user. Crystal Reports also has a number of predefined fields, called Special Fields, available for the purpose of report management. Formatting a report ensures the user(s) can read and interpret your report. The audience for the report dictates how much time you spend in formatting.Formatting includes the usage of Graphic Images, Charts, as well as the use of Lines and Boxes to clearly define important data. Instructor Note Explain charts are not discussed as part of this course.

Format Total Borders


1. In the BAQ Report Designer, select the MfgParts report file created in a previous workshop. 2. Click the Actions menu and select the Design Crystal Report command. You could also open the MfgPartList.rpt report directly from Crystal Report at this point. 3. Click Print Preview. 4. Move to the last page of the report, and scroll down to display the subtotals by part number in the Group Footer #2 (GF2) sections and the subtotals by warehouse name in the Group Footer #1 (GF1) sections. The Group Header #2 (GH2) sections contain the various Part.PartNum values while the Group Header #1 (GH1) sections contain the various Warehse.Description values. The Grand Total values appear in the Report Footer (RF) section.

Format the Subtotal Borders


Format the subtotals with single borders to increase readability. 1. To format the first subtota, tight-click on a bolded subtotal in one of the GF2 (Part.PartNum) sections. 2. On the Expert Tools bar, click Format and navigate to the Border sheet. 3. For the Top and Bottom fields in the Line Style section, select Single 4. Select the Tight Horizontal check box. 5. Click OK to return to the Preview screen. 6. Format in the same way a bolded subtotal in one of the GF1 (Warehse.Description) sections.

Epicor Software

Crystal Reports Course | Add Presentation Quality to Custom Reports | 57

7. To format the third subtotal, right-click on a bolded Grand Total in one of the RF (Report Footer) sections. 8. On the Expert Tools bar, click Format and navigate to the Border sheet. 9. For the Bottom field in the Line Style section, select Double. 10. Select the Tight Horizontal check box. 11. Click OK to return to the Preview screen. 12. Click Save and preview the report.

Copy Field Format


Copy formats from one field to another using the Format Painter feature. 1. Right-click the field that contains a particular format and select Format Painter. The cursor now appears as a paint brush as it hovers over the field to be format painted. 2. Click the Distinct Count - Grand Total field to apply the new format. You cannot apply formatting to read only objects and fields.

Insert Text Objects


While in the Design window, text objects can be inserted via the Insert menu or by using the ab Insert Text Object button on the Insert toolbar. There are many ways to use text objects in a report. Some examples include, but are not limited to the following: Report Title, Comments, Special Column Headings, Report Selection Formula, Print Date and Time. 1. On the Insert toolbar, click ab. To insert a text object you can alternatively select Text Object from the Insert menu . 2. Left-click to place the empty text box in the Report Header section of the Design window above the PartNum field. 3. Type Report Title - XXX's Manufactured Parts Listing, where XXX is your name or initials. 4. Click outside of the object to lock in the text.

Format the Report Title


1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. Right-click the title text object and select Format Text to access the Format Editor. To set up paragraph details, select the Paragraph sheet.. Navigate to the horizontal alignment section. Select Centered to center the title in the text object To set up border details, select the Border sheet.. For the left, right, top, and bottom borders, select Single. Select the Drop Shadow check box and then select any border color. Select the Background check box and select any background color. To set up font details,select the Font sheet. In the Style field ,select Bold. In the Size field, select 12. Click OK to complete the text object formatting.

Epicor Software

58 | Crystal Reports Course | Add Presentation Quality to Custom Reports

Resize Text Objects


Text may no longer fit in the Text Object box. It can be resized on the Design sheet in the same manner in which the report fields were resized. 1. Click the title text object and press Shift. 2. Use the right arrow key to lengthen the text object until it is centered over the whole report. 3. Press the down arrow key to heighten the text object to fit the 12 point font. 4. Click Save and preview the report.

Insert Group Footer Text Objects


The Group Footer sections need identifying information to properly identify the summaries/subtotals added earlier. 1. Select the Design sheet. 2. In the Group Footer #1 section and in the Report Footer section, move both summary fields for Distinct Count to the right of values in the center of the report. 3. In the Group Footer #1 section below the PartNum field, add a text object Warehouse Totals:. 4. In the Group Footer #2 section below the PartNum field, add a text object Part Totals:. 5. In the Report Footer section below the PartNum field, add a text object Grand Total:.

Rename Column Headers


Column headers are also text objects, so they can be edited on the Design sheet as if they had been inserted as Text Objects on the report. 1. In the Page Header section, right-click PartNum and select Edit Text. Alternatively you can double-click a text object field to move the curser into the field for editing. a) Change the header title to be Part Number. b) Click outside of the object to lock in the text. 2. Edit the remaining column header fields. The new column header titles should be: Part Description On-Hand Quantity Manufacturing Comment

Format Column Headers


Execute the function called Group Select to collect all the column headers and apply some basic formatting to all of them at the same time. The Multiple Selection feature is a time-saving device that allows the simultaneous formatting of many text objects. This function is used to apply the same font, borders, text alignment, etc., to more than one text object, and to avoid formatting each text object separately. Of course once a group of objects have been selected in this manner, they can also be deleted, moved, resized, etc. 1. To select all column headers, place the cursor above the Part Number column header.

Epicor Software

Crystal Reports Course | Add Presentation Quality to Custom Reports | 59

2. Left-click and drag the box to the right and down to encompass or lasso all column headers. 3. On the Formatting toolbar, click B to bold all column headers. Verify that all column headers are still selected. 4. On the Formatting toolbar, click U to turn off the underline attribute for the headers. 5. Keep all column headers selected and right-click the Part Number column header, then select Format Objects. 6. Navigate to the Font sheet and set the color of the text (darker colors are better). 7. Click OK and Save. You may need to adjust the column headers' text alignment because they adopt the alignment given to the column headers in the Format Objects step.

Insert Special Fields


The next steps demonstrate the utilization of the special fields supported by Crystal Reports and better describes the report for the reader. A few of these special fields are: Report Author, Free-form Report Comments, Report Title, Print Date, File Path and Name, Record Selection Formula and Page N of M. 1. 2. 3. 4. 5. To enter summary information, from the File menu, select Summary Info. In the Title field, enter Parts On-Hand - Custom. In the Comment field, enter Manufactured parts with on-hand quantity. Click OK. On the Field Explorer, expand the Special Fields node to list and utilize these and other fields. Insert the Total Page Count or Page N of M fields only when the design is complete. Page on Demand, which Crystal Reports uses to present Page 1 very quickly, is disabled when these are added. This causes Crystal to rerun the entire report to recalculate the total page count every time any modification is made to the design, slowing the report preview process dramatically. 6. Select the Design sheet. 7. Expand the bottom boundary of the Report Header section for several lines. In the steps that follow, several special fields will be inserted in the Report Header section of the report. In order to do this, the size of that section must be increased in the Design window. 8. From the Special Fields list, insert the fields into the Report Header section. Insert these fields: Print Date File Author File Path and Name Report Title Record Selection Formula Report Comments

9. Click Save.

Epicor Software

60 | Crystal Reports Course | Add Presentation Quality to Custom Reports

Resize and Format Special Fields


1. Right-click the Report Comments field and select Format Field. 2. On the Common sheet, select the Can Grow check box. 3. For the File Path and Name and Record Selection Formula fields, select the Can Grow check box. 4. Select the Preview sheet to review the display of these special fields. 5. If necessary, increase the width of the fields. 6. Click Save.

Perform Additional Report Formatting


1. Select the Design sheet. 2. Insert the special field Page N of M to the center of the Page Footer section. If necessary, move and resize. 3. Edit the Print Date field to display with a leading day name, a month name instead of number, and a four-digit year. Use appropriate separators when formatting this field. 4. For all special fields, change the font style to bold.

Insert a Line
1. Select the Design sheet. 2. Drag and drop the bottom boundary of the Page Header section to leave space for a line to be inserted. 3. On the Insert toolbar, click Insert Line. 4. Position the resulting pencil cursor above the Page Header bottom boundary marker, but just below the Part Number column header. 5. Left-click and drag to the right, drawing a line below all column headers. 6. Right-click the line and select Format Line. 7. Accept the Line Style as Single and click OK Dashed or dotted lines do not allow for width modification, but single line style allows both for width and color modification. 8. Click Save and preview the report.

Add Boxes
1. Select the Design sheet. 2. Adjust the elements. a) Drag and drop the bottom boundary of the Group Header #1 section to add more space for the group boxes. b) Select the Group #1 Name header and move it down two grid lines. c) Drag and drop the bottom boundary of the Group Footer #1 section. 3. Insert a box. a) On the Insert toolbar, click Insert Box.

Epicor Software

Crystal Reports Course | Add Presentation Quality to Custom Reports | 61

b) Position the pencil cursor in the upper left-hand corner of the Group Header #1 section. c) Left-click and drag down and to the right to enclose all of the Group #1 sections (down to the lower, right-hand corner of the Group Footer #1 section). 4. Format the box. a) Right-click the selected box and select Format Box. b) Accept the Box Style as Single, but feel free to experiment with the width, color, drop shadow, and fill color. 5. Click OK. 6. Perform additional activities. a) Move all Group Name fields to the right for better readability. b) Add a border and drop shadow around the Group #2 Name for more impact. c) Insert text objects or copy the Group Names into your various Group Footer sections to describe the totals. 7. Click Save and preview the report

Insert Company Logo


Insert company logo into the page header section. 1. Select the Design sheet. 2. Drag and drop the bottom boundary of the Page Header section down far enough to be able to move the column headers down and position the company logo above them. 3. On the Insert toolbar, click Insert Picture. 4. Browse to the Sample Data folder, select Epicor-Logo.bmp, and click Open. You may optionally use your company logo here. Go to your company Website and copy your company logo. Instructor Note The Epicor-Logo.bmp should be located in the Report folder on the training machines. It can be copied from the course map in the tree to a workstation. 5. Drag and drop the resulting outline so that the top edge is positioned at the top of the Page Header section close to the left margin. 6. Click Save and preview the report. 7. Exit Crystal Reports and return to BAQ Report Designer.

Workshop - Defining Options for Manufactured Parts Listing


Options, such as sorting, selection criteria and prompting for data may be set up inside of Crystal Reports. The BAQ Report Designer handles the optional criteria when a BAQ has been used for the report itself. Options may be designed at the time you are creating the report definition or at the end of the formatting phase inside Crystal. This workshop shows how to limit the data in the Manufactured Parts Listing report to the Part Type of M; establish sort criteria for the report and provide filtering choices of Part Number or Warehouse.

Epicor Software

62 | Crystal Reports Course | Add Presentation Quality to Custom Reports

Add an Option
1. Click New and select New Option Field. 2. In the Option Field column, select Part.TypeCode and press Tab. 3. In the Field Label column, enter Type and press Tab. The field label does not have to match the field name from the table. 4. 5. 6. 7. In the Compare Operator field, select =. In the Default field, select M . In the Order field, enter 1. Click Save.

Add a Filter
Any indexed field in the BAQ is available to use as a filter. This provides an option when the report is printed. 1. Click New and select New Filter. 2. In the Filter column, select Part.PartNum and press Tab. 3. In the Filter Label field, accept the default Part. The filter label does not have to match the field name from the table. 4. Repeat to enter a second filter for the Warehse.WarehouseCode. 5. Click Save.

Add a Sort
1. Click New and select New Sort. 2. In the Name field of the Sort Options section, type Part Number\On Hand Quantity. 3. In the Sort Fields section, click New. The Part Number\On Hand Quantity sort line should be selected. 4. 5. 6. 7. In the Sort Field field, select Part.PartNum. In the Order field, enter 10 to make this the primary sort. Verify the Ascending check box is selected. Add one more sort field. a) In the Sort Fields section, click New. The Part Number\On Hand Quantity sort line should be selected. b) In the Sort Field field, select PartBin.OnHandQty. c) In the Order field, enter 20 to make this the primary sort. d) Clear the Ascending check box. This is a quantity field so you want to see the highest Part Bin On Hand Quantity first. 8. Click Save.

Test and Preview the Report


1. Click the Actions menu and select the Test Report Form command.

Epicor Software

Crystal Reports Course | Add Presentation Quality to Custom Reports | 63

2. Preview the report. 3. Close the report and the report form.

Epicor Software

64 | Crystal Reports Course | Create a Direct Labor Report

Create a Direct Labor Report


This section reinforces some of the features discussed in the previous sections. In addition, new report writing features will be reviewed, such as calculated fields and parameters to determine what information displays on a report. You will build the Direct Labor report manually. Crystal Formula Editor The Crystal Formula Editor is designed for end-users and is a point and click tool used to build formulas quickly and easily. Syntax rules for writing formulas in Crystal are listed below. SYMBOL {} [] () Text or Text 30000 // <Enter> <Tab> RULE French brackets or braces enclose fields or formulas. Square brackets enclose subscripts or arrays. Standard parentheses enclose arguments (sometimes called parameters) to a Crystal function. Quotation marks tell Crystal to treat the contents between the marks as text or a literal string. Enter numbers with no punctuation. The .00 is assumed. Lines of comment need to be preceded by two forward slashes. Make it a habit to comment your formulas. Press the Enter key to break your formula into sentences. Press the Tab key to indent your formula to make later analysis easier.

Additional rules include: Upper and lower case letters are optional when typing functions, color names, etc. However, when entering text or literal strings in your formulas, you should enter the exact upper and lower case letter as needed. Spaces before and after operators such as + and * are optional. If you point and click on an operator in the editor (instead of typing it), Crystal will insert spaces before and after the operator for readability. If you are using Crystal Reports XI Enterprise, Crystal formulas may be centrally stored using the Crystal Enterprise Repository (outside the scope of this course). Otherwise, the formulas may shared using copy and paste into a text file. The table and field names must be the same in the two reports for the formula to work in the report containing any copied data. Instructor Note Explain the Crystal Formula Editor will be used multiple times in the remaining workshops in this course.

Epicor Software

Crystal Reports Course | Create a Direct Labor Report | 65

Workshop - Define the Direct Labor Report


The first step in completing any report is to design it inside the BAQ Report Designer. This workshop shows how to create the Report definition for the Direct Labor Report.

Add a Report
Navigate to BAQ Report Designer. Menu Path: Executive Analysis Business Activity Management General Operations BAQ Report Designer 1. 2. 3. 4. 5. 6. Click New and select New Report Definition. In the Report ID field, enter DirectLbr (no spaces). In the Description field, enter Direct Labor Report. In the BAQ ID field, serach for and select EPIC03-DirectLbr. In the Form Title field, enter Direct Labor Report. Click Save.

Test and Preview the Report


1. Click the Actions menu and select the Test Report Form command. 2. Preview the report. 3. Close the report and the report form.

Generate Sample Data


1. Click the Actions menu and select the Generate Sample Data command. The interface between Epicor and Crystal requires that a background temp .xml file is created. Once created, it becomes the datasource for the Crystal Report. The Generate Sample Data function creates that xml file. You do not see the full record count when the report is first previewed inside Crystal Reports. This datasource is then used inside Crystal Reports to pull tables and fields for the report. After the data is generated, a Sample data was successfully created. dialog box appears. 2. In the dialog box, note the path and the name of the data file (an .xml file). 3. Click OK to confirm that the sample data was created successfully. At this point, you have actually run the BAQ and the data that is generated into the xml file is available for Crystal to use. This is a good time to glance at the data being presented to make sure it has pulled the query data you expected it to pull.

Workshop - Prepare for Crystal Formatting


The Report Definition must be in place prior to completing this workshop. When you select Design Crystal Report from the BAQ Report Designer Action Menu the report becomes available for formatting. When the sample data .xml file was created it was linked to a datasource that is unknown to Crystal. The datasource must be selected and the BAQReportResult table must also be brought into the report file before you can format the report using Crystal Reports.

Epicor Software

66 | Crystal Reports Course | Create a Direct Labor Report

Select Data Sources


1. Click the Actions menu and select the Design Crystal Report command. Crystal Report launches. 2. From the Database menu, select Set Datsource Location. 3. In the Available Data Sources section, navigate to Create New Connection > ADO.Net (xml) and double-click it. The datasource file path window will open. 4. In the File path field, browse to the Sample Data folder. 5. Select just created DirectLabor_Date.xml file and click Open. The data that is returned inside this report will only be a sampling of the data if the datasource is set to the sample .xml file. You may also select the datasource from the Mfgsysdata\Reports\<username> location, which displas all the data returned by the BAQ. 6. In the File Path window, click Finish. 7. In the Current Data Sourcesection and in the ADO.Net (xml) folder, highlight Report Dataset. 8. Click Update to synchronize to the same .xml datasource. 9. Click Close to accept the datasource changes.

Add the Report Result Table


1. From the Database menu, select the Database Expert. 2. Double-click the BAQReportResult table to add it to the already selected tables.

Review the Links


1. Select the Links sheet. 2. Double click on the link between Company and BAQReportParameters to change the join options. 3. In the Join Types section, select Left Outer Join and click OK. 4. Click OK to close the Databasae Expert window. You are now ready to format the report using Crystal Reports. 5. Click Save.

Workshop - Create a Direct Labor Report


The Report Definition must be in place prior to completing this workshop. This workshop shows how to create a direct labor report. BUSINESS CASE: Your controller wants to know the hours and dollars charged to jobs (labor and burden) by department per week for a given time period. Your tasks in this workshop are: Create formula-based fields. Group and summarize data by department per week. Build and use report options through the BAQ Report Designer to limit the scope of the report. Deploy the report as custom menu link on the Vantage Main Menu.

Epicor Software

Crystal Reports Course | Create a Direct Labor Report | 67

Re-arrange Default Fields


When a BAQ Report Designer report opens inside the Crystal Reports three fields are automatically created and placed in the Page Header section of the report. Complete the following to move these fields. 1. Select the border of the Report Header section and drag it down to make more room in the section. 2. Click the Report Title field and drag it into the Report Header section. 3. Click the Print Date field and drag it into the Report Header section, placing it to the left side. 4. Click the Page N of M field, move it to the Page Footer and place it to the right side.

Add a Formula
Add a formula to calculate labor and burden cost. Formulas may be created before the detail section is populated with fields, or afterward. The formula is a unique field that begins with the @ sign in the title. Some formulas are very complicated and would benefit from the addition of extra spacing in the formula. Crystal Reports ignores the spacing in a formula definition. 1. Select the Design sheet. 2. From the Field Explorer list, select Formula Fields. 3. Add new formula. a) Right-click and select New to create a new formula. b) In the Name field of the Formula Name window, enter Labor Cost and click OK. 4. Add new formula details. a) Select the second column of the Formula Editor screen. b) Expand the ReportDataSet (ADO.NET(XML)) > BAQReportResult . c) Double-click LaborDtl.LaborHrs. The field name, {BAQReportResult.LaborDtl.LaborHrs}, properly formatted, drops into the bottom box. The cursor should be positioned in that box behind the field name. d) From the Operators and Arithmetic listings in the fourth column of the Formula Editor screen, select an asterisk. You can alternately select Multiply. e) Find and double-click the LaborDtl.LaborRate field. It will appear next to the asterisk, and this completes the Labor Cost formula. 5. Click the Save and close button The Formula Editor will check syntax and provide an error message, if needed. 6. Repeat these steps to create a formula called Burden Cost. The formula is: {BAQReportResult.LaborDtl.BurdenHrs} * {BAQReportResult.LaborDtl.BurdenRate}. 7. Click Save and Close.

Epicor Software

68 | Crystal Reports Course | Create a Direct Labor Report

Insert Fields
These fields can be inserted in any order and rearranged as needed. Generally, time is saved when reports are planned in advance, giving direction to the design and report building process. 1. Select the Design sheet. 2. From the Field Explorer, insert the fields into the Details section. From the Database Fields > BAQReportResult list, insert these fields: LaborDtl.PayrollDate LaborDtl.JobNum LaborDtl.AssemblySeq LaborDtl.OprSeq LaborDtl.LaborHrs LaborDtl.BurdenHrs

From the Formula Fields list, insert these fields: BurdenCost LaborCost 3. Click Refresh. Alternatively, clickPrint Preview. 4. Resize and move the fields as necessary It is easier to move and resize report objects in the Design tab. For best results, use the guidelines. Also, the JobNum, AssemblySeq and OprSeq fields use more space than necessary and could be shortened. Their labels could be combined as well. 5. Click Save.

Format the Column Headings


By default Crystal Reports will present the entire field name as the description for column headings. These are just text boxes and can be changed. 1. Double-click in the column heading for LaborDtl.PayrollDate and change the name to Payroll Date. 2. Change the other columns to more descriptive titles.

Insert Groups
Insert groups to make the report more readable. Two groups are inserted into this report. One to group by job costing departments and the other to group by date. 1. From the Report menu, select Group Expert. Alternatively, on the Expert Tools toolbar, click Group Expert. 2. From the BAQReportResults fields section, find and select JCDept.Description. Use the right arrow button to move the item to the Group By list. 3. Repeat the process for the second group of LaborDtl.PayrollDate.

Epicor Software

Crystal Reports Course | Create a Direct Labor Report | 69

4. On the Group By list, highlight JCDept.Description and click Options to open the Change Group Options screen. 5. On the Options sheet, select the Keep Group Together and Repeat Group Header On Each Page check boxes. 6. Click OK. 7. Repeat the process for the second group of LaborDtl.PayrollDate. 8. Click Save and preview the report. The report now has additional report sections identified as Group Headers and Group Footers listed for the groupings defined.

Insert Group Summaries and Grand Totals


Now that the report displays data grouped by payroll date and department, it is appropriate to set up subtotals and grand totals by these groups. The subtotals and grand totals are inserted into the Group Footer and Report Footer Sections. The fields that should be summarized are: LaborHrs, Labor Cost, BurdenHrs and Burden Cost. 1. 2. 3. 4. Select the Preview sheet. In the Details section of the report, highlight LaborHrs. Right-click and select Insert > Summary. Accept the defaults of LaborDtl.LaborHrs in the Choose Field to Summarize field and Sum in the Calculate this Summary field. 5. Select the Add to All Group Levels check box and click OK. 6. Repeat the process for the fields of Labor Cost, BurdenHrs, and Burden Cost. This provides summaries for each group as well as a grand total for LaborHrs. 7. Verify that the columns are wide enough to display all summary data and increase the width of the fields if necessary. 8. Click Save.

Insert Text Objects


Insert text objects for the Group Footer and Report Footer sections. 1. Select the Design sheet. 2. From the Insert Tools toolbar, select Insert Text Object. Alternatively, you can select Text Object from the Insert menu. The cursor becomes a rectangle until it is dropped into the report. 3. Place the text object into the Group Footer #2 section of the report, to the left of the subtotals entered earlier. The field now highlights and the curser jumps inside the field to enable text entry. 4. Type Totals for the Week Beginning: Include a space behind the colon. 5. Leave the cursor inside the field and in the Field Explorer locate and select the group name field Group #2 Name:LaborDtl.PayrollDate. 6. Drag the field inside the text object and drop it behind the colon. The cursor will appear as a page symbol until it is dropped inside the text object. Resize as needed.

Epicor Software

70 | Crystal Reports Course | Create a Direct Labor Report

7. Repeat the process for Group Footer #1 Section using the following text: Totals for: Group #1 Name This will bring in the JCDept.Description Group Name. 8. Insert a text object in the Report Footer section and title it Grand Totals. 9. Click Save and preview the report.

Insert Presentation Quality Detail


Now that the report has proper section labels and is grouped properly, the report at this point may need to be refined by applying Presentation Quality enhancements. Some of the possibilities include: Update the column headers to increase readability Insert a report title in the report or page header section Add special fields to identify report-specific properties Format sub totals and grand totals with lines or borders Insert company logos Enhance group sections of the report using lines and boxes Suppress data as needed Instructor Note Choose which items above students should complete. When choosing special fields, be sure to select Record Selection Formula as we will look at this one later in the course. The other special fields can be the user's choice to select. Save the report after any presentation quality detail adjustments.

Save and Exit the Report


1. Preview the report. 2. Click Save. 3. Exit Crystal and return to BAQ Report Designer.

Workshop - Defining Options for Direct Labor Report


Sorting, record selection criteria and filtering for specific data are considered options. All of these options may be created using the features of Crystal. The BAQ Report Designer handles the optional criteria when a BAQ has been used for the report itself. Options may be designed at the time you are creating the report definition or at the end of the Crystal Report formatting process. As implied by the name of the report, the labor details need to be limited to the labor type of direct. The Controller has requested that the data be available by Job Department as well as Payroll Date. This workshop shows how to establish the options for the Direct Labor Report.

Add Options
1. Enter an option field. a) Click New and select New Option Field. b) In the Option Field column, select LaborDtl.PayrollDate and press Tab. c) In the Field Label column, enter Beginning Payroll Date and press Tab.

Epicor Software

Crystal Reports Course | Create a Direct Labor Report | 71

The field label does not have to match the field name from the table. d) In the Compare Operator field, select >=. e) In the Order field, enter1 and press Tab. 2. Enter one more option field. a) Click New and select New Option Field. b) In the Option Field column, select LaborDtl.PayrollDate and press Tab. c) In the Field Label column, enter Ending Payroll Date and press Tab. The field label does not have to match the field name from the table. d) In the Compare Operator field, select <=. e) In the Order field, enter2 and press Tab. 3. Enter one more option field. a) Click New and select New Option Field. b) In the Option Field column, select LaborDtl.LaborType and press Tab. c) Accept the Field Label of Labor Type and press Tab. The field label does not have to match the field name from the table. d) In the Compare Operator field, select <>. e) In the Default field, enter 1 . f) In the Order field, enter3. 4. Click Save.

Add a Filter
Only indexed fields from the BAQ can be used as a filter. 1. Click New and select New Filter. 2. In the Filter column, select JCDept.JCDept and press Tab. 3. Click Save.

Add a Sort
1. Click New and select New Sort. 2. In the Name field of the Sort Options section, type Job Department. 3. In the Sort Fields section, click New. The Job Department sort line should be selected. 4. In the Sort Field field, select JCDept.Description. 5. In the Order field, enter 10. 6. Click Save.

Epicor Software

72 | Crystal Reports Course | Deploy the BAQ Report

Deploy the BAQ Report


After you design the report, you can place it on the Main Menu. Use the Deploy BAQ Report command to move the current BAQ report to the network. The program moves the report from the Local Reports Directory to the Server Reports Directory on the server. When you save a new BAQ report, the tool automatically creates a style and a data definition for the report. The style defines how this report will appear when it is displayed and printed. You can edit these styles in Report Style Maintenance. Both Report Style and Report Data Definition are located under System Management - Company Maintenance.

Workshop - Deploy and Publish a Report


The objective of this workshop is to make the Direct Labor report available as a menu option in the system. Follow the identified steps below in addition to the Select a Custom Report topic in the online help as a guide to accomplish this task.

Deploy the Report


The Deploy BAQ Report option from the Actions menu makes the new report definition available to the network. It will place a new copy including all the options you have defined into the \Server\Reports\Custom Reports directory on the company server. Once the report is here it can be attached to a menu. Navigate to BAQ Report Designer. Menu Path: Executive Analysis Business Activity Management General Operations BAQ Report Designer 1. Click the Actions menu and select the Deploy BAQ Report command. Note the directory where the report will be placed. Confirm if you need to replace the existing report. 2. Click on OK to accept the deployment.

Add the Report to Menu


Navigate to Menu Maintenance. Menu Path: System Management Utilities Menu Maintenance 1. In the Tree View on the left, navigate to Production Management > Job Management > Reports. 2. Highlight Reports and click New. 3. Enter the fields as follows:

Epicor Software

Crystal Reports Course | Deploy the BAQ Report | 73

Field Menu ID

Value UD 170 Enter a unique ID that begins with UD.

Name

Direct Labor Report This is the report name as it appears on the menu tree.

Security ID

SEC247 This can be a newly created security ID or an existing one. If you select an existing security ID, it should be one already available for at least one other report under the same parent menu.

Order Sequence

170 Order sequences are numbered by 10s. On this menu, 170 places the custom report as the last item on the menu list.

Program Type

BAQ Report Select this from the drop-down selection list.

Icon

Report This selects the standard Report icon used on the menu structure.

Program

Epicor.Mfg.UIRpt.BAQReport.dll This field point to the program needed to run the custom report and will default in.

Report

DirectLbr Press the Report button to browse for your report.

4. Click Save and exit the program.

Test the Report From the Menu


Any time a custom menu options is made, the database needs to be refreshed. You can log out and log back in or optinally change users. 1. From the Options menu of the Main Menu window, select Change User ID. 2. Log in with the username and password of Manager. 3. Navigate to Direct Lober Report and double click it to view the report. The Report Definition screen will appear reflecting the choices you made for Options, Sorts and Filters while in the BAQ Report Designer. 4. Fill in the Beginning Payroll Date and the Ending Payroll Date fields. 5. Select Print preview to see the repoort.

Epicor Software

74 | Crystal Reports Course | Deploy the BAQ Report

6. Exit the report.

Epicor Software

Crystal Reports Course | Modify Existing Crystal Reports Forms | 75

Modify Existing Crystal Reports Forms


Many standard Crystal Reports forms are found in the system's individual modules. These forms, as well as standard Crystal Reports, may be modified with the Crystal Reports program if the forms or reports do not meet the end user's needs. All of the Crystal basics that you learned so far may be utilized and applied when modifying forms. In this section, you learn how to make changes to the standard Crystal Reports Purchase Order form. The principles applied when modifying this form are applicable to modifying any Crystal Report forms in the system. At the end of this section you will be able to: Locate the Crystal Reports forms within the system. Determine where the database files are created. Open and save forms to be modified with new names. Modify selected forms. Attach the modified forms as the system default report format.

Dataset Location When a user runs a Crystal Report form, the system generates a number of XML dataset files and other related files. These files are extracted from the main Progress database tables, and are actually used to produce the desired form. These files are usually generated and located in the C:\...\mfgsysdata\Reports\ folder. The system creates the last segment of the path statement equal to the user that generated or ran the report. Note The location of the XML dataset locations will vary, depending on your unique installation. Please check with your network administrator or IS manager for specific information regarding your system. For purposes of this class, your instructor will confirm the location. When a purchase order is printed, it generates the POHeader, PODetail, PORel, POMisc, SidLabls, and OrMisc tables. These tables contain the data required for the PO just printed. This data is then stored in a uniquely named file in the above mentioned location with an XML extension. For example, PURCHASE_ORDER00XXX.XML. When another PO is printed, another unique XML file is created in the users folder. Before we can modify the Crystal Reports PO form, at least one PO has to be run so that the source files are generated, and so you can preview your work as you proceed. In addition, it is advisable to preview specific PO form(s) to test the impact and accuracy of a desired change. Form File Location In order to modify a form, the standard form itself must be located and opened using Crystal Reports. Again, these forms are stored in a unique location by the system. That location is X:\epicor\MfgSys\Server\Reports where X is the location of your server. For purposes of this class, the location of the server will be the C drive. Note Take care to never modify a standard form. After the appropriate form is located and opened, immediately save it using a unique name. Then modify the newly saved form. The standard form serves as a starting point for modification and something to go back to should you need to restart. If you modify the standard form, subsequent patches or releases could overwrite your modification.

Epicor Software

76 | Crystal Reports Course | Modify Existing Crystal Reports Forms

Report Definition and Report Style Maintenance programs When these XML tables and fields are created by printing the form or report, the system includes fields that are considered the most commonly used fields, but excludes less commonly used fields. These fields exist, but are excluded as they are rarely used and including all of them will hinder printing performance. Most tables in the system allow for custom fields to be added, as needed. These fields are labeled Character01, Character02, etc. These fields will be excluded by default. If a custom or excluded field is needed in the Crystal Report form, then a new Report Definition must be created where the user intentionally includes the field(s) in the definition. This definition must then be defined as an additional report style through the Report Style program. When the report style is defined, it can then be selected when a form or report is printed. This creates the XML file that contains the desired field(s) in the dataset.

Workshop - Modify the Purchase Order Form


There are many ways to modify the standard Purchase Order form. This workshop walks through a sample method that uses the Report Data Definition to add an addfitional database field to the defined dataset.. BUSINESS CASE: Your company wants to modify the existing Purchase Order form to include the company logo. In addition, your company wants to suppress closed lines on updated POs. It is not uncommon in your business to issue blanket orders which are subject to change. When a change does occur, an updated PO using the same PO number must be resubmitted to the supplier. The standard PO form does not suppress closed lines, which confuses some of your suppliers as they have occasionally refilled these lines.

Add a PO Form
1. 2. 3. 4. 5. Navigate to the Crystal Reports application or re-open it. Open the standard PO form under X:\Epicor\MfgSys\Server\Reports\POForm.rpt. From the File menu, select Save As. For the new File name, enter POForm2.rpt . Keep Crystal Reports open, but minimize it and navigate to the system.

Add a Report Definition


By design the, PO form does not include the PODetail.OpenLine field. You will use this field to write a formula to suppress closed lines. Navigate to Report Data Definition Menu Path: System Management Company Maintenance Report Data Definition 1. In the Code field, search for and select the POForm data definition. a) From the Actions menu, select Duplicate Report. Since the POForm is identified as a System Report, it must be duplicated in order to modify the Data Definition. b) In the Report Def ID field, enter POForm2. c) In the Description field, enter Modified Purchase Order. d) Click OK. 2. Include the PODetail.OpenLine field in the report definition.

Epicor Software

Crystal Reports Course | Modify Existing Crystal Reports Forms | 77

a) Select the Report Table Excluded Fields sheet. b) Expand the Tree view until you can highlight the PO Detail table. c) Click Refresh to populate the Included Report Fields and Excluded Report Fields columns for this table. d) In the Excluded Report Fields column, find OpenLine and use the left arrow button to move OpenLineit to the Included Report Fields column. 3. Click Save and exit the program.

Add a Report Style


Navigate to Report Style Menu Path: System Management Company Maintenance Report Style 1. 2. 3. 4. 5. 6. 7. In the Report ID field, search for and select the POForm report. Select the Styles sheet. Click New and select New Report Style. In the Description field, enter Modified Purchase Order. In the Data Definition field, enter POForm2. In the Report Location field, type reports/POForm2.rpt. Accept the remaining defaults. You had to identify a name in the Report Location field, so you must use this as the Report Name in Crystal Reports. 8. Click Save and exit the program.

Create the XML File


Print and print preview a PO to create the XML file. Navigate to the Purchase Order Entry Menu Path: Material Management Purchase Contracts Management General Operations Purchase Order Entry 1. 2. 3. 4. In the PO Number field, enter 4055 and press Tab to open the PO. Click the Print icon on the Standard toolbar to open the Purchase Order Print window. Choose the Modified Purchase Order Report Style. Select Print Preview from the File menu or click the Print Preview icon. Note that lines 9 and 10 show a Closed status on the preview. We will suppress these lines. 5. Close the PO Print Preview window.

Set the Database Location


The new form cannot be previewed yet. The (.rpt) files which generate this report do not point to the correct tables. 1. Maximize Crystal Reports. 2. Select Set Datasource Location from the Database menu to open the Set Datasource Location window. a) In the Current Data Source section, highlight ReportDataSet of the screen.

Epicor Software

78 | Crystal Reports Course | Modify Existing Crystal Reports Forms

b) In the Replace with section, expand Create New Connection and click ADO.NET(XML) to open the Connection window. c) In the File Path field, navigate to C:\.....\mfgsysdata\Reports\MANAGER\Purchase Orderxxxxx.XML to locate the XML file created by the Print/Print Preview step above. Note The xxxxx in the above file name replaces system assigned values. To select the correct one, as there may be many listed, sort the list by date and select the Purchase Orderxxxxx.XML created on the current date. d) Click Finish to return to the Set Datasource Location screen. e) In both the Current Data Source and the Replace with sections, highlight the ReportDataSet option. f) Click Update to synchronize the ReportDataSets. g) Repeat the process if there is a Subreport ReportDataSet section in the Current Data Source section. 3. Verify the properties of each ReportDataSet to validate that both sections are pointing to the above selected XML file. a) In the Current Data Source section, select the Properties line item and verify the path. b) Right-click the Replace with: ReportDataSet item, then select Properties and verify the path. c) Click Close to complete the set datasource location process. 4. From the Database menu, select Verify Database. Click OK to any Crystal messages regarding the database or report. 5. Select Print Preview or Refresh to preview the form to be modified Click Yes or OK to any messages that ask to propagate changes through all of the Dataset tables connected to the report. These messages may or may not appear depending on if a preview occurs before or after a database is verified. The two processes are interchangeable. 6. Click Save and preview the report. The newly included OpenLine field now appears in the Field Explorer as a Database Field under the PODetail table.

Insert a Company Logo


Insert a company logo on the PO form. This is the first change to the PO form. 1. Select the Design sheet. 2. Navigate to any company website, right-click on the logo, and copy it to the clipboard. Paste it into the Page Header b section of the report between the address and phone numbers and preview. 3. Copy the Epicor Logo from the course mapt tree into a location on the workstation. Insert the logo bitmap into the Page Header b section of the report between the address and phone numbers and preview. 4. Click Save.

Epicor Software

Crystal Reports Course | Modify Existing Crystal Reports Forms | 79

Suppress Closed Lines on the PO Form


1. Select the Design sheet. There are multiple Group Header #2 and GroupFooter #2 report sections that are assigned as groups by PODetail.POLine. These are the sections that need to be suppressed when a PO line is closed, as well as the Details section. The system closes a PO line when all releases of a line are received complete, or when it is manually closed. The system then applies a closed status to the release or the line. In the database, the system uses the logical fields called PORel.OpenRelease and PODetail.OpenLine to indicate this status. If a PO release is open, then OpenRelease = True. If the PO release is closed, then OpenRelease = False. If a PO line is Closed then PODetail.OpenLine = False otherwise PODetail.OpenLine = True if it is still open. Although we could use either the PODetail.OpenLine or the PORel.OpenRelease fields to suppress the line, use the PODetail.OpenLine field as a closed line, unless it is suppressed, so it displays a Closed status. Instructor Note Explain that the Report Data Defintion is the query definition for the report and holds all the tables and fields included in the standard form. This form includes the field PORel.OpenRelease which is already part of the defined tables. Suppression could have been done using this field in the formula as well. Encourage them to always explore the underlying report form for fields AND formulas that may be useful in the new design. 2. On the Expert Tools toolbar, click Section Expert. 3. Select the Group Header #2: PODetail.POLine-A section. 4. On the Common sheet to the right of the Suppress (No Drill-Down) option, click the x+2 formula button. The Format Formula Editor - Suppress (No Drill-Down) window opens. 5. Enter formula. a) Expand the tables below the ReportDataSet(ADO.NET (XML)) listing in the second column. b) Double-click the PODetail.OpenLine field. c) After the field, type = false to finish the formula The formula should read as follows: {PODetail.OpenLine} = false. d) Copy this formula. It will be used to suppress data in other sections. e) Click Save and close to save the formula. The x+2 formula button next to the Suppress (No Drill-Down) option will now appear in red in the Section Expert window. The formula just added to the Group Header #2: PODetail.POLine-A section to suppress data will also suppress data through all of the Group Header #2a fsubsections. 6. Repeat the process for the Details section and the Group Footer #2 PODetail.POLine-A section, pasting the same formula into both Formula Editor windows. 7. Preview the report to verify that the closed lines no longer appear on the report. 8. Click Save.

Epicor Software

80 | Crystal Reports Course | Modify Existing Crystal Reports Forms

Establish the Modified Form as the System Default


Once a form/report has been modified, it can be set up in the system as the default form/report, or at the very least, as an available form for use as needed. Prior to printing a form, the system provides the opportunity to select the form to be used. The form/report defined as the default form will be selected unless another is indicated.

Workshop - Establish the New Purchase Order Form as the System Default
This workshop shows how to establish the new Purchase Order form as the system default. Navigate to Report Style Menu Path: System Management Company Maintenance Report Style 1. 2. 3. 4. Click the Report ID button to search for and select POForm. Move to the Styles sheet and select New Report Style from the New icon menu. Enter POForm Modified in the Description field. Enter the path C:\epicor\MfgSys\Server\Reports\POForm2.rpt in the Report Location field Confirm the path to the location of the saved modified form. Also, the named report will differ from the above saved report name. Be sure to select the correct saved report name as named in the previous workshop. The POForm2.rpt represents the saved POForm name. 5. Select the Company List section. 6. In the Valid column, select the EPIC03 company check box to assure the form is valid for this company. 7. In the Default column next to the same company, select the Default check box. The Valid and Default columns enable you to create forms that are unique to each of your companies. A generic form may be all that is needed. One form could be flagged as Valid and the other form as Default for all companies. 8. Click Save and exit the program. Navigate to the Purchase Order Entry program, print and print preview the PO to assure that the closed lines are now suppressed.

Epicor Software

Crystal Reports Course | Independent Workshop: Create a Booked Orders Report | 81

Independent Workshop: Create a Booked Orders Report


In this section, you will independently finish a workshop that focuses on creating a booked orders report. This project is done as a review for all the BAQ Report Designer details discussed up to this point. The instructor will get you started with this report, but will let you finish it on your own. The report creation activities will resemble activities covered in previous sections of this course. At the end of this section, you will be able to: Better apply the design tools described in previous sections. Insert fields into text objects. Create and move new report sections. Sort records on the report. Instructor Note If students will work through the workshop independently, it is suggested to lead them through steps 1 - 8, and then have them complete the remaining steps on their own.

Workshop - Define the Booked Orders Report


This workshop shows how to create the Report definition for the Booked Orders Report.

Add a Report
Navigate to BAQ Report Designer. Menu Path: Executive Analysis Business Activity Management General Operations BAQ Report Designer 1. 2. 3. 4. 5. 6. Click New and select New Report Definition. In the Report ID field, enter BookedOrder (no spaces). In the Description field, enter Booked Orders Report. In the BAQ ID field, serach for and select EPIC03-BookOrders. In the Form Title field, enter Booked Orders Report. Click Save.

Test and Preview the Report


1. Click the Actions menu and select the Test Report Form command. 2. Preview the report. 3. Close the report and the report form.

Generate Sample Data


1. Click the Actions menu and select the Generate Sample Data command. The interface between Epicor and Crystal requires that a background temp .xml file is created. Once created, it becomes the datasource for the Crystal Report. The Generate

Epicor Software

82 | Crystal Reports Course | Independent Workshop: Create a Booked Orders Report

Sample Data function creates that xml file. You do not see the full record count when the report is first previewed inside Crystal Reports. This datasource is then used inside Crystal Reports to pull tables and fields for the report. After the data is generated, a Sample data was successfully created. dialog box appears. 2. In the dialog box, note the path and the name of the data file (an .xml file). 3. Click OK to confirm that the sample data was created successfully. At this point, you have actually run the BAQ and the data that is generated into the xml file is available for Crystal to use. This is a good time to glance at the data being presented to make sure it has pulled the query data you expected it to pull.

Workshop - Prepare for Crystal Formatting


The Report Definition must be in place prior to completing this workshop. When you select Design Crystal Report from the BAQ Report Designer Action Menu the report becomes available for formatting. When the sample data .xml file was created it was linked to a datasource that is unknown to Crystal and saved into the Sample Reports folder. This xml file will only contain a sampling of the true data from the BAQ. This report demonstrates how to set the datasource and display the full record count. After the test the report function, an .xml file is created in the \server\reports\<username> directory. This is the same directory used by Epicor for the default report definitions. Retrieving the data from this directory will provide an .xml datasource with complete data. Use the .xml file generated here when you need to see the full record count of data in order to design a new Crystal Report from a BAQ.

Select Data Sources


1. Click the Actions menu and select the Design Crystal Report command. Crystal Report launches. 2. From the Database menu, select Set Datsource Location. 3. In the Available Data Sources section, navigate to Create New Connection > ADO.Net (xml) and double-click it. The datasource file path window will open. 4. In the File path field, browse to the Mfgsysdata\Server\Reports\Manager folder. 5. Select the BAQ Report -BookOrder-0000.xml file with the most current date and time and click Open. 6. In the File Path window, click Finish. 7. In the Current Data Sourcesection and in the ADO.Net (xml) folder, highlight Report Dataset. 8. Click on the Report Dataset displayed in the ADO.Net (Xml) folder. 9. Click Update to synchronize to the same .xml datasource. 10. Click Close to accept the datasource changes.

Add the Report Result Table


1. From the Database menu, select the Database Expert. 2. Double-click the BAQReportResult table to add it to the already selected tables.

Epicor Software

Crystal Reports Course | Independent Workshop: Create a Booked Orders Report | 83

Review the Links


1. Select the Links sheet. 2. Double click on the link between Company and BAQReportParameters to change the join options. 3. In the Join Types section, select Left Outer Join and click OK. 4. Click OK to close the Databasae Expert window. You are now ready to format the report using Crystal Reports. 5. Click Save.

Independent Workshop - Create a Booked Orders Report


Complete the steps below to create a booked orders report. BUSINESS CASE: Your objective is to produce a report which shows orders booked within a certain date range, summarized by product group and customer name. Your boss has decided that the report must show an order book date, order and line numbers, book type, selling quantity, customer name, part number and product group description. Knowing this, we can determine the tables that must be used to create and finish the report. The final report also needs a Gross Margin field. This field does not exist in the database and must be calculated and displayed in the report. The gross margin will be assumed at 35%.

Delete the Default Fields.


By Default the interchange between the BAQ Report Designer and Crystal will place a Report Title, Print Date and Page N of M fields into the Report Header. These will be deleted and replaced later in the workshop. 1. Hold down Ctrl and, in the Report Header section, select the Report Title, Print Date and Page N of M fields. 2. Press Delete.

Add a Formula
Add a formula to calculate Gross Margin. 1. Select the Design sheet. 2. From the Field Explorer list, select Formula Fields. 3. Add new formula. a) Right-click and select New to create a new formula. b) In the Name field of the Formula Name window, enter Gross Margin and click OK. 4. Add new formula details. a) Navigate to the second column of the Formula Editor screen. b) Expand the ReportDataSet (ADO.NET(XML)) > BAQReportResult. c) Double-click BookDtl.BookValue. The field name, {BAQReportResult.BookDtl.BookValue}, properly formatted, drops into the bottom box. The cursor should be positioned in that box behind the field name. d) From the Operators and Arithmetic listings in the fourth column of the Formula Editor screen, select an asterisk.

Epicor Software

84 | Crystal Reports Course | Independent Workshop: Create a Booked Orders Report

You can alternately select Multiply. e) After the asterisk, type .35 to finish the formula. 5. Type .35 after the asterisk to finish the formula. 6. Click the Save and close button. The formula name now appears under the Formula Fields section of the Field Explorer. 7. Click Save.

Insert Fields
1. Select the Design sheet. 2. Insert the fields from the Field Explorer into the Details section in this order. From the Database Fields > BAQReportResult list insert these fields: OrderDtl.PartNum BookDtl.BookDate BookDtl.OrderNum BookDtl.OrderLine BookDtl.BookType BookDtl.SellingBookQty BookDtl.BookValue

From the Formula Fields list insert Gross Margin field. 3. Click Refresh or click the Print Preview icon to open the Preview tab. Alternatively, you can click Print Preview to navigate to the Preview sheet. Write down the Record Count _______________. 4. If necessary, resize and move the fields. 5. Click Save.

Insert Groups
Add groups for the ProdGrup.Description and the Customer.Name fields to make the report more readable. 1. From the Report menu, select Group Expert. Alternatively, on the Expert Tools toolbar, click Group Expert. 2. From the BAQReportResults fields section, find and select ProdGrup.Description. Use the right arrow button to move the item to the Group By list. 3. On the Group By list, highlight ProdGrup.Description and click Options to open the Change Group Options screen. 4. On the Options sheet, select the Keep Group Together and Repeat Group Header On Each Page check boxes. 5. Click OK. 6. Repeat the process for the Customer.Name field. 7. Click Save and preview the report. 8. Write down the new Record Count ________________.

Epicor Software

Crystal Reports Course | Independent Workshop: Create a Booked Orders Report | 85

Instructor Note Comment for the workshop on Booked Order Report in the Appendix: The record count lowered because some of the records originally brought into the report could not be associated to a Product Group. These records were not included in the report after the group was added. Parts that were ordered that do not have a corresponding Part record would not appear once the group was added. These records will be returned to the report by changing the Links between BookDtl and the ProdGrup tables to a Left Outer Join.

Add Subtotals and a Grand Total


Add subtotals and a grand total for the BookDtl.BookValue and Gross Margin columns. 1. 2. 3. 4. 5. 6. 7. Navigate to the Preview sheet. In the Details section of the report, highlight BookDtl.BookValue. Highlight any BookDtl.BookValue field in the Detail section. Right-click and select Insert > Summary. Select the Add to All Group Levels check box and click OK. Repeat the process for the Gross Margin field. Verify that the columns are wide enough to display all summary data and increase the width of the fields if necessary. 8. Click Save.

Add a Page Header Section


The current page header is split to hold more data, as space is needed for a special field(s) and a company logo. Currently, the page header holds only column header information. 1. 2. 3. 4. Select the Design sheet. Right-click in the Page Header section and select Section Expert. Select the Page Header section if not already selected. At the top of the display, click Insert to add Page Header b, then click OK The newly created Page Header b appears below the column header items. The next step allows you to change this without having to individually move the column header fields. 5. Use the upward arrow on the top of the screen to move Header b into the Header a position and click OK. You will not see the Page Headers listed as B and A as you would expenct. Crystal simply rearranges the information from Header B to A. you will note the column header labels now appear in the Header b section, directly above the group header and detail sections of the report.

Insert a Report Title


Insert a report title in Page Header a. 1. From the File menu, select Summary Info. 2. In the Title field, enter Booked Order List. 3. Click OK to return to the Preview sheet.

Epicor Software

86 | Crystal Reports Course | Independent Workshop: Create a Booked Orders Report

The window's title bar now reads Crystal Reports - [Booked Order List] reflecting the Report Title field contents instead of the saved file name. 4. Select the Design sheet. 5. Add a Report Title field. a) In the Field Explorer, expand Special Fields. b) Drag and drop the Report Title field into the Page Header a section, near the top left margin. 6. Increase the font to 14 point and, on the Standard toolbar, click B to bold the title. 7. Drag the bottom boundary of the Page Header a section down to accommodate the report title or any other special fields inserted here. 8. Fotmat the Report Title field. a) Right-click in the Report Title field and select Format Field from the menu. b) Add a single border, a drop shadow, and background color to the Report Title field. 9. Click Save.

Format Column Headers


1. Navigate to the Design sheet. 2. Drag the bottom boundary of the Page Header b section and move it down to create space for column headers expanding from one to two rows. 3. Select all the column header fields. 4. To remove the underline for all column headers, on the Standard toolbar, click U . 5. To bold the column header fields, on the Standard toolbar, click the B. 6. Change the column header field font color as desired.

Edit the Column Header Field Names


1. On the Design sheet, double-click each column header and edit by adding spaces or adjusting text. The possible header titles are: Part Number Book Date Order Number Order Line Book Type Selling Book Quantity Book Value Gross Margin

2. Expand the column header from a single line to a double line. Verify that the field is selected, hold down Shift and press the down arrow once or twice. When expanding the column header by using the down arrow, the lines will break at the spaces between the words. This minimizes the need to expand the width of the field. 3. Align the bottoms of the column headers. 4. Select all the column header fields. 5. Right-click one of the column headers and select Align > Bottoms.

Epicor Software

Crystal Reports Course | Independent Workshop: Create a Booked Orders Report | 87

6. Click Save and preview the report.

Insert a Line
Insert a solid line below the column headers and change the width and color. 1. On the Insert toolbar, click Insert Line. The cursor becomes a pencil. 2. 3. 4. 5. Draw a line below all of the column headers. Right-click on the line and select Format Line. Select the desired line width and color. Click Save.

Insert a Company Logo


1. On the Insert toolbar, click Insert Picture. 2. Browse to: C:\epicor\MfgSys\server\UD\Test This location is for purposes of the Crystal Reports course only. If the location is different, the instructor will tell you. You decide where to store the logos and other auxiliary files. 3. Select the Epicor-Logo.bmp file and click Open The cursor becomes a rectangle. 4. Drop the Epicor-Logo.bmp into the Page Header a section and size the logo as desired. 5. Format the image. a) Right-click the logo and select Format Graphic. b) In the Scaling section of the Picture sheet, enter the width and height. c) Click Save.

Insert Descriptive Text


1. On the Insert toolbar, click Insert Text Object. 2. Drop the text object into the Group Footer #2 section and position it to the left of the subtotal fields. 3. In the text object, type Totals for: including a space at the end. 4. Add group name fields. a) Select the Field Explorer. b) In the Group Name Fields list, select Group #2 Name: Customer.Name. c) Drag and drop the field into the text object. The group name will appear after the entered text. A symbol that looks like a piece of paper with a plus sign on it appears. d) Resize the field as necessary. e) Repeat the process for Group Footer #1 and the Group #1 Name: ProdGrup.Description field. 5. In the Report Footer section, iInsert a new text object Grand Totals. 6. Format the Grand Totals field. a) Right-click the Grand Totals field and select Format Field. b) Add double borders and bold the font for the Grand Totals field.

Epicor Software

88 | Crystal Reports Course | Independent Workshop: Create a Booked Orders Report

7. Save and preview the report. a) Click Save. b) Select Use Saved Data to preview the report. 8. Exit the program.

Workshop - Defining Options for Booked Order Report


Sorting, record selection criteria and prompting for data are considered options. If a report is generated directly inside Crystal Reports, the options are created using the features of Crystal. The BAQ Report Designer handles the optional criteria when a BAQ has been used for the report itself. Options may be designed at the time you are creating the report definition or at the end of the Crystal Report formatting phase. The Booked Order Report is to show orders booked within a certain date range and is to be sorted by Order Number, Order Line, and Booked Type.

Add Options
1. Enter an option field. a) Click New and select New Option Field. b) In the Option Field column, select BookDtl.BookDate and press Tab. c) In the Field Label column, enter Beginning Book Date and press Tab. The field label does not have to match the field name from the table. d) In the Compare Operator field, select >=. e) In the Order field, enter1 and press Tab. 2. Enter one more option field. a) Click New and select New Option Field. b) In the Option Field column, select LBookDtl.BookDateDate and press Tab. c) In the Field Label column, enter Ending Book Date and press Tab. The field label does not have to match the field name from the table. d) In the Compare Operator field, select <=. e) In the Order field, enter2. 3. Click Save.

Add Filters
Only indexed fields from the BAQ can be usaed as a filter. We will filter by the Customer Number and the Product Group 1. 2. 3. 4. 5. Click New and select In the Filter column, Click New and select In the Filter column, Click Save. New Filter. select Customer.CustNum and press Tab. New Filter. select BookDtl.ProdCode and press Tab.

Epicor Software

Crystal Reports Course | Independent Workshop: Create a Booked Orders Report | 89

Add Sorts
1. Enter the first sort. a) Click New and select New Sort. b) In the Name field of the Sort Options section, type Order Number. c) In the Sort Fields section, click New. The Order Number sort line should be selected. d) e) f) g) In the Sort Field field, select BookDtl.OrderNum. In the Order field, enter 10. Verify the Ascending check box is selected. Click Save.

2. Enter the second sort. a) Click New and select New Sort. b) In the Name field of the Sort Options section, type Order Number. c) In the Sort Fields section, click New. The Order Line sort line should be selected. d) e) f) g) In the Sort Field field, select BookDtl.OrderLine. In the Order field, enter 20. Verify the Ascending check box is selected. Click Save.

3. Enter the third sort. a) Click New and select New Sort. b) In the Name field of the Sort Options section, type Booking Type. c) In the Sort Fields section, click New. The Order Line sort line should be selected. d) e) f) g) In the Sort Field field, select BookDtl.BookType. In the Order field, enter 30. Verify the Ascending check box is cleared. Click Save.

Deploy the Report


1. Click the Actions menu and select the Deploy BAQ Report command. If necessary, confirm all your actions in the appearing dialog boxes. 2. Record path where the report was placed ______________________. This path would be important if this report was going to be published to the Main Menu.

Test the Report


1. 2. 3. 4. 5. 6. Click the Actions menu and select the Test Report Form command. Enter a booking date range for the last 2 years. Select the Filter > Group sheet. Click Group, search for and select Fabricated. Click Print Preview to review the report. Close the report and remain in the BAQ Report Designer.

Epicor Software

90 | Crystal Reports Course | Miscellaneous Reporting Activities

Miscellaneous Reporting Activities


This section addresses a number of additional reporting functions using the system and the Crystal Reports application. At the end of this section, you will be able to: Create and use conditional formatting formulas. Conditionally format fields using the Highlighting tool. Format report sections using the Section Expert tool. Use the Group Sort Expert feature. Export reports into different formats for purposes of report distribution.

Conditional Formatting Formulas


In this section, you continue designing the Booked Order List report. While formatting various objects on the report, many of the properties shown on the various tabs of the Format Editor have blue x+2 icons beside them. If a property has such an icon beside it, then that property can be conditionally formatted. Conditional Formatting is the use of a formula to format a field based on a specified condition. The condition can be based on the field being formatted or on any other available field.

Workshop - Use Conditional Formatting in Crystal Reports


We will add some conditional formatting to the existing Booked Orders Report. This workshop shows how to apply conditional formatting to the Booked Order List report. The objective of this workshop is to enable the Booked Order List report to display a customers booked orders over a period of time in purple, if the total exceeds $50,000.00, and in red if the total is less than $1000.00. To do this, you must perform conditional formatting on the Group #2 Name: Customer.Name field in Group Header #2. This will be based on values in the SUM of the BookDtl.BookValue field in Group footer #2.

Open Crystal Reports


You should be able to access the existing report either through the BAQ Report Designer or through the Crystal Report Open File function. If you closed, navigate to BAQ Report Designer. Menu Path: Executive Analysis Business Activity Management General Operations BAQ Report Designer 1. On the Details sheet, verify the Booked Orders Report is selected. 2. Click the Actions menu and select the Design Crystal Report command. Crystal Report launches.

Add a Colored Formula


1. Select the Preview sheet. 2. Locate the customer Edwards International in the Fabrication product group. 3. Add a formula.

Epicor Software

Crystal Reports Course | Miscellaneous Reporting Activities | 91

a) Right-click the customers name in Group Header #2 and select Format Field. b) On the Font sheet next to the Color field, click the x+2 formula button. The Format Formula Editor - Font Color window opens. 4. Add the first formula condition. a) In the formula window, type If. If there is text in the window, delete it. b) Double-click the Group #2: Customer.Name-A:Sum of BookDtl.BookValue field under the Report Fields listing in the second column. c) Enter a greater than sign, or select it from the Operations and Comparisons listings in the fourth column. d) Type 50000 after the greater than sign (without any commas or decimal points). e) Press Enter twice, then optionally Tab to indent. 5. Add formula result for the first condition. a) Type Then to begin this line. b) Select Purple from the Functions and Color Constants listings in the third column. c) Press Enter twice, then optionally Tab to indent. 6. Enter the second formula condition. a) Type Else if to begin this line. b) Choose Group #2: Customer.Name-A:Sum of BookDtl.BookValue again under the Report Fields listing in the second column. c) Enter a less than (<) sign, then type 1000. d) Press Enter twice, then optionally Tab. 7. Add formula result for the second condition. a) Type Then to begin this line. b) Select Red from the Functions and Color Constants listings in the third column. 8. Verify the formula. If Sum ({BookDtl.BookValue}, {Customer.Name}) > 50000 Then crPurple Else if Sum ({BookDtl.BookValue}, {Customer.Name}) < 1000 Then crred. 9. Click the Save and close button Note that when the x+2 formula button has a formula behind it, its color changes from blue to red. 10. Click OK, then click Save. You have conditionally formatted an attribute property that can be set many different ways. Formatting an attribute property requires an if-then-else formula: if something is true, then a format is applied, else some other format (or none) is applied.

Conditionally Format Fields Using the Highlighting Tool


Highlighting is an alternative to Conditional Formatting. The following are considerations to be aware of when deciding between Highlighting and Conditional Formatting: Highlighting overrides both absolute formatting and conditional formatting. It allows you to set font color, background color and border style all in one place. You can only apply Highlighting to number or currency fields, and it only reflects the performance of the field being selected.

Epicor Software

92 | Crystal Reports Course | Miscellaneous Reporting Activities

Highlighting can be undone using the Undo button on the Standard toolbar. The Highlighting tool uses a simple fill-in-the-blank tab instead of writing a formula.

Workshop - Use the Highlight Expert in Crystal Reports


This workshop shows how to use the Highlighting Expert in Crystal Reports as an alternative to Conditional Formatting. Use the Highlighting Expert to format the Sum of BookDtl.BookValue field in Group Footer #2 with similar parameters used to conditionally format the Group #2 Name field. Any Sum of BookDtl.BookValue that is greater than $100,000.00 will have a double box around it, any Sum of BookDtl.BookValue that is greater than $50,000.00 will have a font color of purple, and any Sum of BookDtl.BookValue that is less than $100.00 will have a font color of red. Navigate to the Booked Order List report, or re-open it. 1. Select the Preview sheet. 2. In the Group Footer #2 (GF2) section for Edwards International, right-click the Sum of BookDtl. BookValue field and select Highlighting Expert. 3. Add double box highlight condition. a) On the left-hand side of the window, click New. b) In the Item editor section in the Value of: field, enter this field is greater than or equal to 100000. c) In the Border field, select Double box. 4. Add font color highlight condition. a) On the left-hand side of the window, click New. b) In the Item editor section in the Value of: field, enter this field is greater than 50000. c) In the Font color field, select Purple. 5. Add one more font color highlight condition. a) On the left-hand side of the window, click New. b) In the Item editor section in the Value of: field, enter this field is less than or equal to .001. c) In the Font color field, select Red. 6. Click OK to finish. 7. Click Save and preview the report.

Format Report Sections Using the Section Expert Tool


The Section Expert is a powerful and flexible tool for formatting different sections of your report. Some of the options available in the Section Expert window under the Common tab include: Free-Form Placement - This option allows you to place objects anywhere on your report without having to adhere to the grid layout, subject to the effect of the Snap to Grid option. Hide (Drill-Down OK) - If you wish to prevent an area/section of your report from printing, but you still wish to allow the user to double click on a summary field to show the underlying data, enable this option. Suppress (No Drill-Down) - Enable this option to prevent a section of your report from printing and to disallow drill-down capability on the summary field. You may write a Boolean (on or off) formula to make this command conditional.

Epicor Software

Crystal Reports Course | Miscellaneous Reporting Activities | 93

Print at Bottom of Page - To force whatever is in a section to print as low on the page as possible, enable this option. It can also be made conditional via a Boolean formula. New Page Before and New Page After - You may also make these settings conditional with a Boolean formula. Use these options with Group Headers and Group Footers to force a page break just before or just after entering the section to which this setting was applied. Reset Page Number After - This features is typically applied to a Group Footer, and it causes the page number to return to 1 after the section is complete. This command can also be made conditional with a formula. Keep Together - This option prevents data from a single record from spreading over two pages. Write a Boolean formula to make this option conditional. Suppress Blank Section - If this option is enabled, it will prevent the printing of a section of the report if all the fields in that section are blank. Underlay Following Sections - This command is typically used when you wish to use a company logo as a watermark. It allows any objects that are in a section to flow into the next while allowing objects from the next section to print on top of the first. Format with Multiple Columns - This option is displayed only if you highlight Details in the Sections area of this window, or if in Preview or Design mode, you right click on D or Details in the grey area to the left of your report. It allows you to create a report that shows the details in columnar format, which works well when creating a simple phone list, for example. The option available in the Section Expert window under the Color tab allows a color to be selected as a background for any of the report sections.

Workshop - Use the Section Expert Tool in Crystal Reports


This workshop shows how to use the Section Expert tool in Crystal Reports.

Add Page Breaks


Insert a report break so that each Product Groups data starts on a separate page. 1. Select the Preview sheet. 2. On the Expert Tools toolbar, click Group Expert. a) In the Group By section, select ProdGrup.Description A. b) To open the Change Group Options window, click Options. c) Select the Options sheet and clear the Keep Group Together check box. d) Repeat the process for the Customer.Name A group. e) Click OK twice to return to the report. 3. Create the page break after each Product Group section. a) On the Expert Tools toolbar, click Section Expert. b) In the Sections area, select Group Footer #1: ProdGrup.Description A. c) On the Common sheet, select the New Page After option. See also the Formula FAQs in the course Appendix for an option to write a conditional formula to prevent Grand Totals from printing on a page by themselves. d) Click OK to return to the report. 4. Click Save and preview the report.

Color Odd Numbered Lines


Set the background color on each odd numbered Detail section of the report. This process can make a report easier to read as each detail line will have alternating background colors. 1. Click the Preview tab.

Epicor Software

94 | Crystal Reports Course | Miscellaneous Reporting Activities

2. Open the background color editor. a) To the left of the report, right-click one of the Ds in the grey area and select Section Expert. b) Select the Color sheet. c) Next to the Background Color field, click the x+2 formula button to open the Format Formula Editor Background Color window. 3. Enter the formula condition. a) In the formula window, type If. If there is text in the window, delete it. b) In the third column from the Functions and Math list, select Remainder. c) In the third column from the Functions and Print State list, between the parentheses, but before the comma, insert RecordNumber. This creates the required Numerator argument for the Remainder function. d) After the comma, enter 2, the required Denominator argument for the function and position the cursor outside the parentheses. e) In the fourth column from the Operators and Comparisons list, select Not equal (x<>Y). f) After the <> sign, enter 0 (zero). g) Press Enter twice, then optionally Tab. 4. Enter the formula result if the condition is true. a) Enter Then to begin this line. b) In the third column from the Functions and Color Constants list, select Aqua. c) Press Enter twice, then optionally Tab. 5. Enter the formula result if the condition is false. a) Enter Else to begin this line. b) In the third column from the Functions and Color Constants list, select NoColor. 6. Verify the formula. If Remainder (RecordNumber,2) <>0 Then crAqua Else crNoColor 7. Click Save and close, then OK. 8. Click Save and preview the report.

Group Sort Expert Tool


This Expert tool allows you to sort the groups within a report based on a measure of performance. With the Group Sort Expert, you can easily create these reports: Top N (top specified number of groups shown individually, listed from highest to lowest). Bottom N (bottom specified number of groups shown individually, listed from lowest to highest). Sort All (sorts all groups in the report in ascending or descending order as specified).

Workshop - Use the Group Sort Expert Tool


This workshop shows how to use the Group Sort Expert Tool in Crystal Reports. In this workshop, you will do the following: Sort the totals of all product groups.

Epicor Software

Crystal Reports Course | Miscellaneous Reporting Activities | 95

Highlight only the total of the top 2 product groups. All other product group's data will be combined into a group labeled as Other Groups. Report on only the top 2 product groups. All other product group's data will be excluded from displaying on the report.

Copy Booked Order List Report


1. From the File menu, select Save As, and enter BookOrdrTopN.rpt as the file name. 2. Select the Preview sheet.

Sort the Totals


Sort the totals of all product groups. 1. 2. 3. 4. 5. 6. 7. Select the Preview sheet. On the Expert Tools toolbar, click Group Sort Expert. Select the ProdGrup.Description sheet. In the For this group field, select All. In the based on field, select Sum of BookDtl.BookValue. Select the Descending check box and click OK. Click Save and preview the report.

Format Product Groups


Highlight only the total of the top 2 product groups. All other product group's data will be combined into a group labeled as Other Groups. The reports Grand Totals will not change with this Top N/Group Sort. 1. 2. 3. 4. 5. 6. 7. On the Expert Tools toolbar, click Group Sort Expert. Select the ProdGrup.Description sheet. In the For this group field, select Top N. In the Where N is field, enter 2. Select the Include Others, with the name check box. Click OK. Click Save and preview the report.

Report Product Groups


Report on only the top 2 product groups. All other product group's data will be excluded from displaying on the report. 1. 2. 3. 4. On the Expert Tools toolbar, click Group Sort Expert. Clear the Include Others, with the name check box. Click OK. Preview the report and save it using the Top N option of your choice. Your grand totals have not changed, even though you have excluded all other customer groups from your report. This is because Crystal makes two passes through the data and calculates and saves totals as it reads each record on the first pass through the data. The current grand total is saved with each record. Thus the automatic grand total displayed in the Report Footer reflects the records selected and read, not the groups which are actually displayed.

Epicor Software

96 | Crystal Reports Course | Miscellaneous Reporting Activities

Your choices at this point would be to: Suppress the grand totals and avoid the inevitable questions. Describe the grand totals more fully ( they include order amounts from customer groups not shown). Make use of Running Totals, which are calculated when the report is printed rather than when the records selected are read. Running Totals are discussed in the next section.

Running Totals
It is a simple matter to create three running totals to solve the problem of incorrect grand totals that was encountered in the Group Sort Expert workshop. Although this process can be accomplished in other ways, we will build the running totals using the Field Explorer tool and by inserting the field in the appropriate report section and column. Instructor Note Explain there are additional ways to enter running totals to a report. The steps identified in the workshop are the suggested steps.

Workshop - Create a Running Total


This workshop demonstrates how to create a running total on the BookDtl.BookValue field and other fields. Navigate to the Booked Order List report, or re-open it. 1. Select the Preview sheet. 2. Create a new running total field. a) In the Field Explorer, right-click the Running Total Fields item and select New. b) In the Available Tables and Fields area, select BookDtl.BookValue. c) Click the right arrow button to move it to the Field to summarize field. d) For the Type of summary field, enter sum. e) In the Evaluate section, select For each record. f) In the Reset section, select Never. g) Click OK. 3. Repeat the process for the Gross Margin Formula Field and the BookDtl.OrderNum field. For the Type of summary for the BookDtl.OrderNum running total, enter Distinct Count. 4. Insert the running total fields into the report. a) Select the Design sheet. b) Right-click on each running total field respectively and insert it into the Report Footer section, below the Grand Total Fields and under the appropriate column. 5. Assign a descriptive label such as Running Totals. 6. Click Save.

Epicor Software

Crystal Reports Course | Miscellaneous Reporting Activities | 97

Export Reports into Different Formats for Purposes of Report Distribution


To export is to distribute a report to a disk file or through email. Crystal Reports allows the export of reports in many popular spreadsheet, database, word processor, HTML, and data interchange formats. The following workshop illustrates file export capabilities in Crystal Reports. Students may export the Booked Order List report from the previous workshops, if desired.

Workshop - Export Reports


This workshop shows how to export reports from Crystal Reports. Navigate to the Booked Order List report, or re-open it. 1. Export the report. a) From the File menu, select Export > Export Report. b) In the Format field, select Microsoft Excel. c) Select Application for the Destination field and click OK. d) Accept the default prompts and click OK to export the report to Excel. 2. Repeat the process to export to other applications like Microsoft Word, Adobe Acrobat, and HTML 4.0. The specific applications are not as important as repeating this process. 3. Export to a Report Definition. a) From the File menu, select Export > Export Report. b) In the Format field, select Report Definition. c) In the Destination field, select Application and click OK. d) Accept the default prompts and click OK to export the report. This produces a Notepad document that describes the various formulas included in the report and each and every object inserted into the report sections. It becomes a very long report but some useful information is available to the current designer or anyone else who is trying to analyze the report design.

Epicor Software

98 | Crystal Reports Course | Conclusion

Conclusion
Congratulations! You have completed the Crystal Reports course. Please take a moment to let Epicor know how to serve you better by completing a course evaluation at http://www.keysurvey.com/survey/191084/2e21/. Your feedback provides the guidelines for the future direction of Epicor education. Instructor Note Ask students the following: Have the objectives for this course been met? Have the expectations for this course been met? What questions do you have? Refer students to other courses for those questions that cannot be answered in this course. Ask students to complete the evaluation.

Epicor Software

Crystal Reports Course | Appendix | 99

Appendix
This section contains the following documentation: Crystal Report Strategy Sheet for the following reports: Early Late Job Report Manufactured Parts Listing Report On-Hand Quantity Report - ALL Parts Direct Labor Report by Department Booked Order Report

Crystal Reports Formula Frequently Asked Questions

Group Sort Expert Tool


This Expert tool allows you to sort the groups within a report based on a measure of performance. With the Group Sort Expert, you can easily create these reports: Top N (top specified number of groups shown individually, listed from highest to lowest). Bottom N (bottom specified number of groups shown individually, listed from lowest to highest). Sort All (sorts all groups in the report in ascending or descending order as specified).

Workshop - Use the Group Sort Expert Tool


This workshop shows how to use the Group Sort Expert Tool in Crystal Reports. In this workshop, you will do the following: Sort the totals of all product groups. Highlight only the total of the top 2 product groups. All other product group's data will be combined into a group labeled as Other Groups. Report on only the top 2 product groups. All other product group's data will be excluded from displaying on the report.

Sort the Totals


Sort the totals of all product groups. 1. 2. 3. 4. 5. 6. 7. Select the Preview sheet. On the Expert Tools toolbar, click Group Sort Expert. Select the ProdGrup.Description sheet. In the For this group field, select All. In the based on field, select Sum of BookDtl.BookValue. Select the Descending check box and click OK. Click Save and preview the report.

Format Product Groups


Highlight only the total of the top 2 product groups. All other product group's data will be combined into a group labeled as Other Groups.

Epicor Software

100 | Crystal Reports Course | Appendix

The reports Grand Totals will not change with this Top N/Group Sort. 1. 2. 3. 4. 5. 6. 7. On the Expert Tools toolbar, click Group Sort Expert. Select the ProdGrup.Description sheet. In the For this group field, select Top N. In the Where N is field, enter 2. Select the Include Others, with the name check box. Click OK. Click Save and preview the report.

Report Product Groups


Report on only the top 2 product groups. All other product group's data will be excluded from displaying on the report. 1. 2. 3. 4. On the Expert Tools toolbar, click Group Sort Expert. Clear the Include Others, with the name check box. Click OK. Preview the report and save it using the Top N option of your choice. Your grand totals have not changed, even though you have excluded all other customer groups from your report. This is because Crystal makes two passes through the data and calculates and saves totals as it reads each record on the first pass through the data. The current grand total is saved with each record. Thus the automatic grand total displayed in the Report Footer reflects the records selected and read, not the groups which are actually displayed. Your choices at this point would be to: Suppress the grand totals and avoid the inevitable questions. Describe the grand totals more fully ( they include order amounts from customer groups not shown). Make use of Running Totals, which are calculated when the report is printed rather than when the records selected are read. Running Totals are discussed in the next section.

Crystal Reports Frequently Asked Questions about Formulas


Adding Crystal Report formulas may enhance the report writing processes. Some questions that are commonly asked are explained below. 1. How do I show a range parameter in my report? Answer: If you have a range parameter, it will not display if you drag it into the report. However, a parameter field can be used in a formula field, which can then be placed on your report. Below are formulas that convert various field types used as range parameters. Date Range "From: " + ToText (Minimum({?DateRange}))+"To: " + ToText(Maximum({?DateRange})) Where ?DateRange is your parameter.

Epicor Software

Crystal Reports Course | Appendix | 101

Number Range

"From: " + ToText (Minimum({?NumberRange}),0,"")+"To: " + ToText(Maximum({?NumberRange}),0,"") Where ?NumberRange is your parameter.

String Range

"From: " + Minimum({?StringRange})+ "To: " + Maximum({?StringRange}) Where ?StringRange is your parameter.

Create a formula thus;- (for Crystal Reports Version 9, you need to substitute Cstr for ToText. ToText and Cstr are interchangeable in Crystal Reports version 10.0). 2. How do I back-fill a field with a comment if a field is empty/null? Example 1: This example assumes that the empty/null field is warehse.description (this can be replaced in the formula with the table.field name that is pertinent to your report). Create a new formula field called WhseDesc. if isnull({warehse.description}) then "Warehouse Code Not Found" else {Warehse.Description} Example 2: Conditional signature lines is an example where this may be used, with an option to also show a generic statement or name when none is available or not needed. One of the things that Crystal does is differentiate between nulls and empty. One of the options in Crystal is to convert nulls to a default value. Under Report Options, verify the Convert option is set. To determine an empty field, the formula would be LENGTH( TRIM( {Field Name} ) ) = 0. Equals EMPTY. This formula is used if the field is empty and a default signature is used. IF LENGTH( TRIM( {Signature Field} ) ) = 0 THEN "Howard Low" ELSE {Signature Field}

Epicor Software

102 | Crystal Reports Course | Appendix

3. How do I convert the LaborHed ClockOutTime and ClockInTime fields, which are numbers (e.g., 1450) to regular time (e.g., 2:30)? Answer: Create a new formula field called ClockOut. To convert ClockInTime, substitute the ClockInTime field in the formula below. NumberVar nbrTime:= IIF(not(IsNull({LaborHed.ActualClockOutTime})) AND {LaborHed.ActualClockOutTime}<25 AND {LaborHed.ActualClockOutTime}>0,{LaborHed.ActualClockOutTime},0); NumberVar nbrHour := nbrTime; NumberVar nbrMinute := Remainder(nbrHour,1) * 60; NumberVar nbrSecond := Remainder(nbrMinute,1) * 60; nbrHour := truncate(nbrHour); nbrMinute := truncate(nbrMinute); nbrSecond := truncate(nbrSecond); nbrHour := IIF(nbrHour<0 OR nbrHour>=24,0,nbrHour); // protect for the 0->24 data in DB, should only be 0.00 -> 23.99 cTime(nbrHour,nbrMinute,nbrSecond); 4. How do I prevent the Grand Totals from printing on a single page of the report when formatting a report with a page break per group? Answer: Write a conditional formula "Not OnLastRecord" on the new page after Property.

Epicor Software

Das könnte Ihnen auch gefallen