Professional Documents
Culture Documents
MAPICS, Inc. 1000 Windward Concourse Parkway Suite 100 Alpharetta, GA 30005-8001 www.mapics.com
TM-SL7-CRYSTAL
SyteLine is a trademark of MAPICS, Inc. All other product names used in this manual are trademarks, registered trademarks, or trade names of their respective companies.
Contents_________________________________________
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Manual Guide .................................................................................................................................. 5 How to Use This Manual ................................................................................................................. 6 Principles of Successful Learning ............................................................................................. 6 Manual Section Structure.......................................................................................................... 8 Feedback .................................................................................................................................. 8 SyteLine Navigation Helps ............................................................................................................ 10 Hot Keys Chart........................................................................................................................ 10 SyteLine's Power Bar ............................................................................................................. 11 Course Objectives & Prerequisites ................................................................................................ 13 Objectives of this Course ........................................................................................................ 13 Prerequisite Courses............................................................................................................... 13 Note to the Instructor............................................................................................................... 13 Navigation for this Course ............................................................................................................. 14
Contents
Applying Special Formatting .......................................................................................................... 44 Date, Time, and Date/Time Field Formatting ......................................................................... 44 Using Special Fields ...................................................................................................................... 46 Inserting Lines and Boxes ............................................................................................................. 47 Inserting a Line....................................................................................................................... 47 Inserting a Box ....................................................................................................................... 47 Inserting a Picture.......................................................................................................................... 49 Exercise......................................................................................................................................... 50
Contents
Section Expert - Common Tab............................................................................................... 83 Section Expert-Color Tab....................................................................................................... 84 Exercise ................................................................................................................................. 85 Creating a Summary Report .......................................................................................................... 86 Exercise ................................................................................................................................. 86
Contents
Preface __________________________________________
Manual Guide
Section Topics
Training Model Principles for Successful Learning Manual Sections Feedback SyteLine Navigation Helps Course Objectives and Prerequisites
Section Objectives
After completing this section, you will be able to: Apply successful learning concepts to this course Recognize basic navigation used in SyteLine
Preface
The training model above applies learning principles. But is that everything the student and instructor do to make sure the maximum amount of learning takes place? That's a topic for a whole book, if not a series. But we can summarize much of that by realizing that learning is a biological process.
Our brain is more like a muscle than a computer. Learning is not something we store in a file; it's something we grow. Just because we see, hear, or even do something doesn't mean we'll remember it. We must exercise our learning consistently. If we only work out during class, we're going to develop our learning like weekend warriors develop their stamina. Here are a few powerful things you can do grow your learning before and after class. BEFORE Get into SyteLine and become familiar with the areas you will be working in during the course. Read SyteLine manual and passages from texts related to the business topics. Answer and preparation questions your instructor might have given you. Write up your own questions. Right after class-create quick review & recall notes Next day-perform detail and big picture activities Next week-perform detail and big picture activities Next month-perform detail and big picture activities
AFTER
Preface
In each of our classes you perform detail and big picture activities. These activities constitute a workout. Your learning will grow through these activities, but just as with muscles, working out once won't produce long-lasting effects. You need to work your neural paths again. When you perform detail and big picture activities you're working out again. Not only will these activities reinforce what you've learned, they will often help you understand more. Big picture activities help you summarize and see relationships between the details of a topic. They help you create a pattern to fit information into. Big picture activities include things like creating mind maps, process flows, relationship diagrams, and outlines. Detail activities help you understand navigation, specific fields, the effect of various parameters, and the steps of each business process--they require you to get into the system. Detail activities include things like setting up a BOM, taking a customer order and shipping it, running reports, and tracing accounting. Again, the first post-class workout you will want to perform is clarifying and consolidating your notes. You will forget. But you can drastically cut the amount you forget and your recall work by taking 10 minutes to create clear notes.
Learning is Growth
A number of studies have confirmed the idea that learning is a biological growth process that requires repetition. RECALL A number of studies have found that: Without review, people forget between 46% to 80% of what they've learned within 24 hours When tested six weeks after a class, students who took a 5-minute review test after their class recalled one and a half times more than the students who had no review test immediately after class. People learn and recall more when they: (1) structure what they've learned in their own words, (2) recite their learning, and (3) distribute practice over many periods versus doing it all at once.
BREAKS Studies have also shown that people recall more if they take breaks every 20-50 minutes. Psychologists believe that it takes neural traces from about five seconds to 15 minutes to jell or consolidate. This is how they explain topics becoming clear during a break or immediately upon returning and why we recall more immediately after a learning period than at the end of a learning period. We really do need to let information "sink in."
Preface
This manual applies the learning principles and the training model explained above. Each major topic should have 3 parts to it--an (1) Introduction, (2) Discovery, and (3) Wrap Up.
Section Part Introduction Discovery Definition A presentation or activity to give students the big picture about topic or hour. Guided Practices A step-by-step guide through the topic. Usually the instructor guides the class through each step; however, students may perform each step on their own or in couples or small groups. Reference Explanation of the key concepts, forms, fields, and processes of the topic. Teachers will draw your attention to key concepts in their introduction and the guided practice, but they may not cover every item in these sections. Exercises Opportunity for the students to explore and practice. Wrap Up An exercise that helps the student structure their knowledge. The wrapups usually take the form of a list of key discussion questions or a mind map. In both cases, the teacher will lead the class through the wrap up. A mind map is a method for taking notes that allows you to show connections between various concepts.
It will be the teacher's responsibility to adapt this manual to each audience by adding or taking away from what is found.
Feedback
As teachers we create lesson plans and handouts and do all sorts of things. But we won't know how successful our efforts are unless we look for feedback. Feedback is simply a statement of the effect our actions have.
Body language and performance measures like the ability to complete an exercise, quizzes, and tests all provide feedback. However, there may not be a direct link between our teaching and a student's performance or body language. Maybe a student has lost interest because they stayed up until 5 a.m. playing computer games on their laptop. Maybe they finished the exercise because they came in early and taught themselves the material. Something that complicates all this is that often what helps one student doesn't help another. We'll never know the direct effect of our teaching if we look only to performance measures and body language for feedback. The most accurate feedback comes from the students themselves-they can tell us what helps and what hinders them. They can tell us what is clear and what is not. The students can tell us exactly when they were bored or confused or spinning their wheels. As a teacher it is my responsibility to welcome and solicit feedback. As a student it is your responsibility to give it. The best way to give feedback is to leave ego and value judgements out of it. Instead of slamming or praising the teacher (you're doing this when you use words like "great," "terrible," "on the ball," etc.), talk about cause and effect. Here are a few examples. "Your MRP handout [cause] really clarified the term 'explosion' for me [effect]."
Preface "At the beginning of the session today you moved fairly quickly through the forms [cause]. I was just trying to keep up with the navigation and couldn't even think about the concepts [effect]." "I liked how Fred taught us [not too useful]. He did a wrap-up [cause] that really brought things together for me [effect]. And he made sure we took regular breaks [cause], and it seemed that I was able to concentrate better in the afternoons because of that [effect] Cause and effect. Helpful feedback focuses on how our teaching affects you. And knowing the effects our teaching produces allows us to modify our efforts to deliver the kind of service that helps you the most.
Preface
10
Preface
Used to open a form Save modified data and close the form Close active form and do not save data New record Filter (similar to QBE, you will query on the form fields and not from a list of fields) Elevator buttons/toggle between records on active form Publish or render form Notes for current record - Empty Notes for current record - Has notes associated About the SyteLine form Display help for a field on a form Enter UDFA/Design Close form and re-open based on changes made in Design
The Help Tip displays in the lower left hand corner of the application (Status bar) even when your selection is not active.
11
Preface
12
Preface
Prerequisite Courses
None.
You are responsible for selecting the topics and activities that meet the needs of your students. Depending on your class, you may not be able to cover all the material in this manual in one day. Make sure you talk to your students when planning the class and carefully select the topics you want to cover. Make sure you assess the speed of the class half way through and then make any necessary adjustments so you cover what you and your students have determined has the highest priority. The exercises for this class have been designed to generate discussion and student involvement. Many of the exercises do not have "check" figures. You are to provide that feedback by doing the exercises along with the students. Then they can check their answers against yours.
13
Preface We caution you not to substitute lectures and presentations for the exercises. Students will learn the most while doing the exercises. A good time ratio for lecture to student work is 30%:70%. Consider using the review exercises found in the appendix as part of your end of class wrap up.
14
15
Another, more common sense approach, may be to copy an existing report that is similar to the end result you are looking to achieve and make modifications where they are needed. In this example we will be creating a blank report. 1. Open Crystal Reports and choose the 'Blank Report' option.
2. Choose where the data will come from. It is important at this point, in order to enable your Crystal Reports software to work with stored procedures, that you make sure your Crystal Reports instance has stored procedures as an option to include as a data source. Click the Options button and select the Stored Procedures checkbox. At first we will work with a direct ODBC connection to a data source and later will work with stored procedures on the SQL Server database. 3. Scroll through the list of ODBC data sources until you find the SyteLine App Database DSN. (if one is not set up on your machine, you will need to do so through Start + Settings + Control Panel + Data Sources (ODBC). Once this is set up, select the SyteLine App DSN from the tree view under the ODBC tree level. (In this instance it has been named SL7App. Yours will most likely be different). 4. Once you have selected the correct DSN, you will then be asked to select the tables you want to work with from that particular database. In this instance, working with the SyteLine 7.0 Application database, you need to select the 'co' table from the list and click the Add button. 5. Click the Close button.
16
Section 1: Report Design 6. The 'Field Explorer' window will then appear.
We will use this window frequently over the course of the training, but for now, click the Database Fields tree level and notice how it shows you the 'co' table. If you expand the co table, you will see all fields in the table. At this point you can begin dragging fields onto the Detail tab of the report. Before we do that, let's look at the Detail tab.
The Detail tab will be covered in much more detail in later sections. Now, continuing our report creation process: 1. With the Field Explorer and the 'co' table fields visible, click the 'co_num' field and drag it into the Details section of the report. Notice how the column name is added automatically to the page header. (In order for the label to appear, make sure that under File + Options, you have Insert Detail Field Titles checked).
2. In order to preview the actual report data, and activate the 'Preview Tab' in Crystal Reports, select the button from the main toolbar. (This button must be selected to run the query against the database). 3. Once you run the query, the Preview tab will be enabled, and you will be able to view your report data on this tab.
17
You can close the Field Explorer window at any time. It is a free-floating modal window. You can open the window at any time as well by clicking the button from the main toolbar. Once you click the Browse button, you will see the first 500 unique fields of data for that column in the table.
This is done by simply selecting the File + Save + Save As option from the main menu button. Save this report as 'CustomerOrders1.rpt' on you local hard
Before we move into positioning and sizing objects, we will need to add more fields to our current report. 1. Drag the following additional fields onto the Details tab of the Crystal Reports workspace: co_num, order_date, ship_code, and price.
2. Next, click the Preview tab to view your report so far. Once you have placed the fields on your report, you may want to reposition or resize them. Because the column title is dropped into the header at the same time the data field is dropped onto the detail section of the report, they default to the same size. Many times, the size may be too small or much too large for the space needed on the overall report. Repositioning and resizing is easier on the Design tab because you are moving only the placeholder rather than the representative data.
18
Using Guidelines
If you want to line objects up with one another, you can insert guidelines and attach objects to them. Then, in one step you can move the guideline to reposition all the objects attached to the guideline. 1. Click the Detail tab. Notice how each field that was dropped on the report has been automatically been given a guideline (in order to view gridlines, make sure that you have checked Show Grid in Design under File + Options).
2. You can remove the guidelines by selecting the gray arrows at the top of the Detail tab by clicking them and dragging them into the report area. In order to add a new guideline, just click anywhere in slide-rule area with the gray boxes. 3. If your fields are not attached to the guidelines, you simply need to click the field and 'wiggle' the field just over the plain of the guideline until it's attached corners of the field turn red. Using the keyboard right and left arrow keys is easier than using the mouse for this action.
Moving Objects
Select an object before you move or resize it. Select an item by clicking the field itself until it is highlighted. Most of the time, you will want to move both the field and its associated label. This can be done in two ways: Select one object and hold down the shift key while selecting the other. They will both be highlighted at this point and can be moved you your mouse or the arrow keys on the keyboard.
Another very easy way to select and move multiple items is the 'Lasso' method. Click and draw an imaginary box around multiple objects that you want to select. Once they are selected, you can move them as a group to the position that you wish.
19
Resizing Objects
In order to resize an object, the object must be selected first. This can be done using one of the two methods mentioned above. 1. When an object is selected, it is highlighted by a box of small diagonal bars. Notice also the small boxes surrounding the field. These are resizing handles.
2. You can resize one or many fields at one time. Once they are selected, just move your mouse over one of the boxes, click and drag to the new size.
Aligning Objects
The main object is the object that you wish to align other objects with. To make an object the main object, click it last when doing a shift-click or control-click action. This is the opposite order than it is done on SyteLine 7.0 form customization.
Once the objects are selected in the correct order, select Format + Align from the main menu. Select the desired alignment from the following list:
To facilitate faster report design, you can copy and paste objects from one section to another area. When you copy an object, you are copying the actual data value of that object as well.
20
Formatting Objects
Once you place fields on your report, you may want to change their appearance. There are many options available to you. To see the options, right-click a label field and select Format Text.
Formatting Appearance
You can change the color, size, or style, as well as add tool-tips, suppress (covered in detail later), and add lines. Take time now to explore the different options available to you on the tabs of the Format Dialog window. 1. In our example, highlight all the column headings and make them Bold Faced.
21
You may want to format the data itself so that it appears differently in the Preview window. This most often used on a numeric field. In order to format a numeric data field, right-click the field on the Detail or the Preview tab and click Format Field.
On the Number tab you are presented with a number of numeric formatting styles.
22
Section 1: Report Design In order to view a number of other options with regard to rounding, negative numbers, currency, suppression, decimal separators and more, click the Customize button.
Take time to explore all of the options available to you, as you will be using them frequently in report building.
You can format the text inside of a label and also add more text objects to your report. In order to modify existing text in a text object, right-click the text object and select Edit Text Object. You can then change the text and individual word and letter formatting within the text object window.
In order to add a new text object, click Insert + Text Object from the main menu, or click the button from the main toolbar. You will then have a text object attached to your cursor. Place your cursor where you wish to have the text object on the report and click once.
23
Exercise
This exercise will combine what you have learned about aligning, resizing, and formatting objects in Crystal Reports. 1. Resize the fields and columns headings to accommodate the data. 2. Format the Price field to print with no decimals and with a floating dollar sign ($). 3. Format the 'co_num' field to be center justified. 4. Change the column headings to be bold and blue. 5. Rearrange the columns to be in co_num, price, ship_code, order_date. 6. Create a report header text box called 'CO Report'. 7. Change the color of the text inside. 8. Make the report header text box a larger font size and different style. 9. Make sure the title will print in the center of the page. 10. Add a border and drop-shadow to the text box. 11. Save the report.
24
25
Your record selection criterion does not have to be based on fields that are in your report. You can choose any fields from the database. In this example we will select the co.co_num field on our Details tab then click the Select Expert button to open the Select Expert.
Since we are looking at the co.co_num field, we can then choose from the drop-down list of options provided by the Select Expert to limit our query results. Take time to explore all of the options available to you in the Select Expert dropdown expression box. You will use these options frequently and should be familiar with them. In this example we will select 'is between.'
The two drop-down boxes are associated with using the 'is between' operator and will list the first 500 unique data items in the table for co_num. You can pick from the list or type in other numbers.
26
By design, Crystal Reports only reads your database when necessary. When you first preview, print, or export a report to a file, the program runs your report and retrieves the required data. Once you are working with the data that has been returned, Crystal Reports retrieves data again only under these conditions: If fields are added to the report If you add a formula that references a field that was not in the report when you ran it the first time. If you modify your record selection criteria in the Select Expert to include more records than when you first ran the report. You will be prompted for "Use Saved Data" or to "Refresh Data."
If you choose "Use Saved Data," Crystal Reports does not make a trip back to the database. To force Crystal Reports to make another trip back to SQL Server, select the "Refresh Data" option. You can always refresh your data by selecting the button.
Exercise
1. Click the Select Expert. 2. Choose to limit your report by ship_codes that are either FED or UPS. 3. Run the report.
27
3. In this example, we will select the co.price field and click OK. 4. Select the selection operator and the amount.
5. The new selection criterion is then saved and the report is rerun with that new selection criterion.
28
By default, Crystal Reports links multiple selection criteria with an 'and' statement. In our last example, Crystal Reports selected records where the ship_code was either 'UPS' or 'FED' and price_code greater than $2000. If you wish to change the 'and' to an 'or,' view the selection formula. To do this, follow these steps: 1. Open the Select Expert. 2. Click the Show Formula button. The formula used then appears.
29
30
Exercise
In the following exercise you will create a new report using the customer and the cust_addr table. There will be some explanation along with exercise steps. You link tables as well as apply what you have learned in this last section on the Select Expert and selection criteria. 1. Click the New Report button .
2. Select the 'As a Blank Report' option. 3. From the list of data sources, select the SyteLine Application database and add the customer table first, then the custaddr table to your report. 4. Close the Table Selection window. 5. You will be presented with the Database Expert window. This window is used when more than one table is added to the report. Crystal Reports uses the Database Expert to figure out how the two tables are related. 6. You will need to draw the correct links between the two tables. In this case the foreign keys are cust_num and cust_seq. Starting with the customer table, select the cust_num field, hold the mouse button down and drag a line to the cust_addr table's cust_num field. You will see a link drawn for you.
31
Section 2: Record Selection 9. Add the following fields to your report and resize them accordingly: customer.cust_num cust_addr.name cust_addr.city cust_addr.state customer.sales_ytd
10. Apply a selection criteria that will retrieve only those records with a customer number between 1 and 25. 11. Apply another record selection criteria that will also grab records with a sales_ytd greater than zero. 12. Once you have run the report a few times, change the 'and' operator to an 'or' and notice the difference in the records being returned. 13. Save your report as 'CustomerSales.rpt'.
32
33
Sorting Records
By default Crystal Reports displays the records in their natural order, as they are stored in the database. To select fields to sort on for your report: 1. Click the button or select Reports + Sort Records from the main menu. You are presented with the following dialog:
2. From this window you can select the fields you wish to sort your result set by. 3. Select one or more fields from the left side. 4. To add that field to the sorted fields, click the Add button .
5. To remove a field from the sort fields click the Remove button. By default, the field you select will be sorted Ascending. You can choose to override that by selecting from the Sort direction radio group and clicking Descending.
34
Grouping Records
You will more than likely want to break your reports into meaningful groups. Grouping your report plays a big role in making your report easy to read, understand, and utilize. Most of the time grouping goes along with summarizing and totals. So when thinking about groups, you are usually thinking about seeing summary-type information on the report by group. When you group records, you add new areas to your report. These new areas are visible on the left margin of the Details tab. Once you have created a group, a Group Header and Group Footer surround the Details area. Each group you create has its own header and footer. Also, when you insert a group, the Group #n Name field is automatically created in the Group Header. To add a group to a report, do the following: 1. To start adding a group, select Insert + Group from the main menu or, on the Insert Tools toolbar click the button. You will be presented with the following dialog:
You can select the field you wish to group by from the first drop-down box. Notice that you can also choose the order in which you wish to sort the particular group. This will pertain only to the sorting within the group. 2. The Keep Group Together check box on the Options tab specifies how the group will be broken across multiple pages when printed. If this is selected, and a particular group takes up more than one page, Crystal Reports will start the next group on a new page.
35
Section 3: Sorting, Grouping, and Summarizing 3. Once the selections are made, you can see the Group Header and Group Footers are added to the report.
If you group on a particular field, it makes sense to remove it from the detail of your report. Otherwise, you will have redundant data fields under each group.
Redundant data
Deleting Groups
In order to delete a group, do the following: 1. Right-click in the left margin on the Detail tab next to the Group Header 2. Select Delete Group from the menu. 3. You will be prompted to verify your actions. Once you choose 'Yes,' the group will be deleted from your report.
If your needs change or if you decide that you have chosen the incorrect field to group your report by, you do not have to delete the group. You can easily change the group. In order to do this, do the following: 1. Right-click in the left margin on the Detail tab next to the Group Header. 2. Select Change Group from the menu.
3. You will be presented with the original Group selection dialog window where you can select a different field to group by.
36
Exercise
In the following exercise you will sort and group the CustomerSales.rpt report. 1. With your CustomerSales report open, sort the report by cust_num ascending. 2. Sort next by co.cust_num descending. 3. Next, group your report by custaddr.state and view your results. 4. Next, change your grouping to group by co.cust_num. 5. Now, group first by state, then by cust_num. Would your report look better if you deleted the cust_num detail? 6. How would you reorder your groups? For example, what if you wanted to sort first by co.cust_num then by state? (Hint: click and drag one above the other on the Detail tab.) 7. Save your report.
37
Summarizing
Your report is now sorted and grouped in a logical manner. In most cases this is done in order to be able to come up with some aggregate number or total by group.
Subtotals, a type of summary, are calculations based on the sum of a group of numerical values. Therefore, subtotals are only available on number or currency fields. A summary, however, is not always a subtotal, nor is it always based on numeric values. A summary can be a total count for entries in a group, or an average of numeric values. It is the value generated as the result of an evaluation, a tally, or a calculation performed on data from a single group. Subtotal or summary information is added to the Group Footer. To insert a summary or subtotal field, do the following: 1. Select Insert + Summary from the main menu or click the button. You can also right-click a field and select Insert Summary or Insert Subtotal, depending on the data type of the field. If you have a field selected when you choose to insert a summary or subtotal, your options will depend on the data type of the field. If you have no data field selected when you choose to insert a summary or subtotal, you will be given the option to choose a field. 2. If no data field is selected, you will then be presented with the following dialog:
3. Choose a field with which to create a summary or subtotal, if one is not already selected. Take time to explore all of the calculation types. You will be creating summaries often in report development. 4. Select the type of calculation you wish to perform for this summary.
38
Section 3: Sorting, Grouping, and Summarizing 5. Click OK. A subtotal field is then added to the report:
You will most likely want to add a text object to describe the summary information.
You can show numbers as a percentage of a group that is a part of a broader-based group. Percentage summary fields support the sum, average, maximum, minimum, count, and distinct count operations. In order to add a percentage summary, do the following: 1. Select Insert + Summary from the main menu or click the button. You can also right-click a field and select Insert Summary or Insert Subtotal, depending on the data type of the field. 2. Once you have made a selection of a field and calculation operator, select the Show as a percentage of checkbox and choose an appropriate higher-level group to use as the denominator.
39
Inserting grand totals is a very common thing to do on a report. They often go on a Report Footer. In order to add a grand total do the following: 1. Select Insert + Summary from the main menu. 2. The Insert Summary dialog box opens:
3. Select the field from which you will be creating a grand total. 4. Select the mathematical operator to apply as the grand total. 5. Click OK. A Grand Total field will automatically be placed on the Report Footer. The report will contain a grand total number on the last page of the report, in the Preview tab.
40
Exercise
In the following exercise you will continue to use the CustomerSales.rpt. You will be adding summary fields, percentage fields and a grand total to the report. 1. With the CustomerSales report open, make sure that you have grouped your report by state then by customer number. 2. Add a field that calculates the total ytd_sales for each state. 3. Add a label to that field. 4. Add a field that shows each state's ytd_sales as a percentage of the grand total. 5. Add a label to this field. 6. Add a grand total to your report and add a label to that field. 7. Save your report.
41
42
43
We will now focus on those options that have not yet been covered. You have already learned how to change the font size, style, and color of the fields and data on your report. You have also learned how to change a numerical or currency field properties such as negative values, decimal operator, currency symbols and others. Now let's look at date and date/time field formatting.
To modify the formatting for a date field, right-click the field and select Format Field. You will be presented with the following dialog:
From this dialog, you can select a date format from the list box. Once you have selected a format, click OK.
44
Section 4: Making Reports Presentation-Quality You will then see the dates formatted for you:
You can also customize the date and time fields by clicking the Customize button. Take time to explore all of the variations for customizing dates and times. These are frequently used in reports.
45
Take time to look over all of the different special fields available to you. Think of different instances where each would be used. To add a special field to a report, do the following: 1. Open the Field Explorer. 2. From the open Field Explorer window, click and drag one of the fields onto the Details or Preview tab of the report. 3. The field is attached to your cursor; just click in the report where you want the special field to appear.
46
Inserting a Line
To draw a line, do the following: 1. Select Insert + Line from the main menu or click the toolbar. Result: A pencil cursor appears on the screen. 2. Position the pencil tip where you wish for the line to start. Click, hold and drag the line to the point where you wish the end of the line to be. Release the mouse button. To format the line: 1. Click the line to activate the handles on each end. 2. Use the four-way cursor to move your line to a new position. You can also resize the line with the resizing handles on either end of the line. button on the Supplementary
Inserting a Box
To insert a box in your report, do the following: 1. Select Insert + Box from the main menu, or click the toolbar. Result: A pencil cursor appears on the screen. 2. Use the tip of the pencil to draw with. Position the pencil where you want one corner of the box and drag your mouse to the opposite corner of the box. Release the mouse button. button on the supplementary
47
Section 4: Making Reports Presentation-Quality To format a box: 1. Right-click the box and choose Format Box. You will be presented with the following dialog:
From here you can change the style, width, color, add drop shadow, and even fill the box with color. Take time to look over all options for coloring, drop shadows, and the check boxes at the bottom of the window. 2. To change the rounding of the corners of your box, click the Rounding tab.
48
Inserting a Picture
Often when developing your reports, you will want to include a picture or graphic - for example, a company logo. You will find it easier to work on the Design tab when inserting pictures and graphics to ensure that it appears in the section that you want. To place a picture on a report, do the following: 1. Select Insert + Picture from the main menu, or click the Supplementary toolbar. button on the
2. Locate the BMP, PCX, TIF, JPG, or TGA graphic file you want to use on the report and click OK. 3. A picture field will be attached to the cursor. Place the upper left corner of the graphic on your report where you wish for it to be placed and click the mouse button to release. 4. You may need to adjust the height of the section you are inserting into. You can do this by dragging the gray section divider lines on the Detail tab, up or down. Hover your mouse over the line until your cursor becomes a horizontal line with two small black arrows, one pointing up, the other pointing down. Click, hold, and drag the gray line up or down to make room. 5. If you want your section to fit perfectly against the bottom-most object, right-click on the left hand margin of that section and select Fit Selection.
49
Exercise
In the following exercise you will continue working with the CustomerSales report. You will add presentation-quality formatting to the report including lines, boxes, color, special fields, and images. 1. With your CustomerSales report open, add a thin blue line beneath the column headers. 2. Draw a box around the state-level group. Rounding the corners is optional. 3. Fill the box with a color of your choice. 4. Draw a drop-shadow box around the Subtotal fields for each state. 5. Change the font for all fields on the report to Arial (Arabic). 6. Change the color of the States to green. 7. Add the file path to your report to the bottom left-hand corner of each page. 8. Add the print date and print time with labels to the top left corner of your report. 9. Add Page N of M to the bottom right corner of each page of the report 10. Add an image to the report header.
50
51
To combine a text box with database field: 1. Create a text object. 2. Open the Field Explorer. 3. Choose the database field you want to add. 4. Drag the field into the text object. You can insert multiple fields by choosing them all at once and dragging them into the text object simultaneously. TIP: Don't let go of the mouse until you see a vertical line in the text object equal to where you want to insert the database fields. EXAMPLE:
Often,adding a database field that has varying field lengths will extend the data in the text object beyond the length that it was drawn on the report. Selecting Can Grow allows Crystal to expand the size of the text object similarly to a word processing "word wrap." The box will grow horizontally to fit all of the data. You will find this option in the Format Editor. Right-click on the field and select Format Text to open the Format Editor. The Can Grow field is on the Common tab.
52
Design
53
54
2. Expand the size of your header to 2". 3. Use the button to add a text box to the report header.
5. Insert the special fields to the right of the text. Only bold the special fields.
When adding text boxes, don't forget to add $, %, spaces or anything else that is needed to make the report look professional.
55
Preview
56
1. Double-click the object to place it into edit mode. 2. Select the element you want to format. Elements can be a selection of text or a field. 3. Right-click the selected element. Result: You'll receive the short cut menu. 4. Click the appropriate menu item from the shortcut menu. For example: Change Font.
To set tabs in a text object: 1. Right-click the text object and click Edit Text Object. Result: The ruler line will appear. 2. Click the ruler at the point where you want the tab.
To move a tab, drag it inside the ruler (horizontally). To remove a tab, drag it off the ruler (vertically).
57
Exercise
1. Change one word in your report title to a different font and color. 2. Customize the date to display MM/DD/YYYY.
58
59
Using Formulas
Components of a formula include: Numbers Operators Functions Summaries Text Other formulas Database fields Create a new formula by clicking the New button or right-clicking + New. Then assign the formula name that will be its column heading. Edit a formula by clicking the Edit button or right clicking + Edit. Rename or delete a formula from the shortcut menu.
60
Formula
Report Fields
Functions
Operators
Report Fields - All database fields and formulas are here and available for selection into the formula. The fields and formulas already in the report are under Report Fields. Functions - All available functions are listed showing their arguments and arranged by their use. If you have created any functions, they will be listed at the end. Operators - Operators are special symbols that represent an action to be taken placed between two or more values. Crystal reads and performs the specified action. Formula - The formula is built in the Formula text box. Fields, functions and operators appear at the position of the cursor as you double-click them in the dialog boxes above. Crystal will place all [ ] () as they are needed. If you double-click the operators and functions, it will not place them when you are typing the formula.
61
7. Set the report to Landscape under File + Printer Setup. 8. Group the report by salesman. (Co.slsmn.) 9. Save the report as formulas.rpt
62
Basic Calculations
Basic calculations can be used to get data out of the database and perform basic functions in order to get the desired output. Often times the database won't include all of the values necessary for detailed reporting.
1. From the Field explorer, highlight Formula Fields, right-click and select New. 2. Name the formula Ext. Cost and click Use Editor to display the Formula Editor. 3. Under Report Fields, double-click coitem.qty-ordered. 4. Press the SPACEBAR and type "*", or select the operator for multiplication (x*y).
5. Double-click coitem.cost. 6. Your expression should look like this: {coitem.qty-ordered} * {coitem.cost}. 7. Click 8. Click to check for errors. to save and close the formula editor.
9. Your formula should appear in the field explorer. Click and drag it to the right of Cost. Your report should be similar to this:
63
1. From the Field Editor, highlight formulas and click New. 2. In the Functions box, under Summary, select Sum (fld, condfld). 3. Inside the brackets and before the comma, select @Ext. Cost. 4. Place your cursor after the comma and select co.slsmn. 5. Your expression should look like this: Sum ({@Ext. Cost}, {co.slsman}) 6. Place this in your group footer under Ext. Cost. 7. Add a text box and place the following text, formulas and database fields in the text object and align the numbers to display under the Ext. cost.
Refer back to the section on text objects if you need assistance with adding db and special fields into a text box. You can place the $ in the text box or select it under Format Field from the shortcut menu.
64
String Manipulation
Next, we'll create a report containing employee information and apply some more formulas. Minimize or save and close the current report. We'll be coming back to it later. 1. Select File + New + As a blank report. 2. Choose the Employee table and Employee Salary table, then click Close. 3. Clear the links and join these tables by emp_num. 4. Select Employee Number and Name from employee. 5. Create the following formula, but do not place it on the report. a. Open the Field Explorer, highlight formulas and click New. b. Double-click employee.phone. c. Under Operators, select String + Subscript. Example: {employee.phone} [5 to 13] e. Check for errors, save and close the formula editor. 6. Add your formula to the details line. 7. Next, add the hire date to the report, but do not add the hire date field. We'll create a formula to demonstrate how to put a date field into a text format. a. Highlight formulas in the field explorer and click New. b. Select ToText (x.y,z,w) under Strings function. c. Create the following expression: ToText ({employee.hire-date}, "ddd, MMMM d, yyyy") 8. Add your formula to the report. d. Type "5 to13" without the quotes. Save and close the formula editor.
65
Formulas used: Days since hire: CurrentDate - {employee.hire-date} Time with company: {@Days since hire} / 365 Save and close this report.
66
67
Preview
68
This formula will display a different message based on the total sales by order:
1. Create a formula called "Sales Rating." 2. Type the following formula: if {@Ext. Cost} > 12000 then 'Outstanding' else if {@Ext. Cost} > 5000 then 'Average' else 'low sale' 3. Place this in the details of your report.
69
This example shows a running total for a SUM other running totals include count, distinct count, average and so on. Running totals are specifically suited for totaling these functions: Show values of a total accumulate as it is calculated record by record Total a value independent of the report's grouping Total a value conditionally Total a value after a group selection formula has been applied Total a value from the driving table in a one to many linking relationship
The Running Total Expert creates the total by asking you to select a field to summarize, the summary operation to use, a condition which to base the evaluation, and a condition on which to reset the evaluation.
Running totals can be used on any database field or formula field, but they cannot be used to calculate the total of a print time formula.
70
The chart below illustrates the behavior of running totals depending on its place within the report.
Placement Report Header Page Header Group Header Details Group Footer Page Footer Report Footer Results Returns first record of the report. Creates running total up to and including the first record of the current page. Creates running total up to and including first record of the current group. Creates running total for every record. Creates a grand total for each group Creates running total up to and including the first record of the next page. Creates a grand total that includes all records
1. Open the formulas report and bring up the Field Explorer. 2. Right-click Running Total Fields and select New to access the Running Total Expert.
3. Type a name for the running total. In this example, we'll keep a running total by line item, so we'll call it Line by Line Total. 4. Place your cursor in the field to summarize and highlight @Ext.Cost and click The default for the Type of Summary is Sum. That is ok. 5. Under Evaluate, choose For each record. 6. Under Reset, choose On change of group. .
71
8. Click OK to accept the running total. 9. Place it in the details of your report.
72
Design
There are two items of note. First, notice the preview where the last line item's running total is equivalent to @Ext. Cost formula. This is a good indication that we have done this correctly. Second, On the Design tab, formulas have an "@" symbol and running totals have a "#" sign in front of them.
73
74
75
Format + Highlight Expert To use the Highlight Expert: 1. Open the Highlight Expert, by clicking Format + Highlight Expert. 2. Select a comparison from the value-is box. 3. Enter a numeric value in the adjacent box. 4. Set the font, color, background and border. 5. Apply new formulas as needed. Use the priority arrow to specify the priority for each formula. 6. Click OK to return to the report or New Item to add another condition.
76
Add highlighting if a line item is less than $500 and make them red. Add another for line items over $10000 and make them blue.
77
Conditional Formatting
Absolute formatting is when every instance of an item or object is the same regardless of its contents. When you need to format objects based on conditions or different situations, you use conditional formatting.
In the Format Editor you can simply check a box to suppress the object all of the time.
To suppress this field only when the value is less than $5000, click the Formula button and type {co.cost} > 5000. Click OK when you are done.
Attribute Properties
These are identical to ON or Off properties except they are truly conditional. Given the previous example, let's add another color: If {co.cost} < 5000 then red else black. OR If {co.cost} < 5000 then red else if {co.cost} < 15000 then black else green.
78
Exercise
Format the fields on your formulas.rpt to display the True in Blue and False in Maroon. Next, make values in your running total (line item sales) to be orange if they are less than $5000, and green if they are higher than $20,000.
79
80
81
You cannot resize the section to be shorter than the lowest object's bottom boundary. You can use the Fit Section command from the area shortcut menu to eliminate any unused white space. It will resize the section automatically.
Exercise
Change the size of your Report Header and insert a graphic of your choice.
82
Section Expert
The Section Expert contains these buttons: Insert - Adds a part to the report, the highlighted section will be added when you click Insert. Delete - Removes the highlighted section from the report. Merge - Combines sections into a single section.
With the exception of Free-Form Placement and Hide, all of the options on this tab can be set conditionally or absolutely. Applying formulas is how you conditionally format the selection. For example, if you want to suppress certain information when a condition is met, you could check the Suppress box, click the Formula button and create a condition as to when that data is suppressed. Most of these options are self-explanatory; however, let's review a couple of the non-intuitive selections:
Select this checkbox to place objects in a free-form environment similar to that of a drawing program. When this checkbox is selected, Crystal keeps all the lines of the section together, either on the current page (if there is room) or on the next (if not).
83
Select this checkbox if you want the selected object to underlay the following section(s) when it prints. For example, you could create a Group #2 and embed an object (graphic, logo, image etc.) and Crystal will use this as a Watermark.
Only available from the Details section, this allows you to display information in a column format as opposed to one after the other. An example of this is mailing labels. The checkboxes and selections available are different for each section of the report. This means that if you want the same results of a specific checkbox in multiple sections, you would have to highlight each section independently and select that box for each section.
On the color tab, you can select different background colors for each section of your report. You can format any section with this tab by selecting the section to the right of the tab. The section expert will display every section as well as newly created sections too.
1. Click the Background Color button for the section that is highlighted and pick a color from the drop down menu. 2. By clicking the Formula button , you can enter a Boolean formula to make the color of the section conditional. If you want more than one color, use an If-Then-Else formula. Or, perhaps you want a green bar report, in which case you could use the following formula: If Remainder (RecordNumber, 2) <> 0 then green else NoColor
84
Exercise
Format each section of your report to have different colors. For the Details section, use the example above to print every other line with a different color.
85
With this parameter selected, the users will receive a magnifying glass indicating that one can drill down on this field into its details.
With this parameter selected, you cannot view the data behind the summarized totals. It is a true summary report and the details are not viewable.
Exercise
Go into the Section Expert. Select the details section and click Hide. View the results and drill into the detail. Next, return back to the section expert and unclick the Hide and choose Suppress instead. Go and view the results. What is different about the two? Discuss this with your neighbor.
86
87
88
Comprehensive Exercise
The following exercise will be a cumulative review of forms creation, customization and Crystal Reports. Upon completion of this exercise, you will have a simple report and a report options form to use in launching a SyteLine report. There will be limited SyteLine report launching architecture discussed during this exercise. After completing this exercise you will have: Created a new 'Build from scratch' form Added two Enhanced combo boxes and one button Added list sources to the combo boxes Added events to the button Named and saved the form Created a Stored Procedure in Query Analyzer Created a Crystal report using the stored procedure
The goal of this exercise is to create the necessary components to allow a user to select a beginning and ending order number and launch a report that shows the order header and line information for those orders, grouped and summarized by salesman.
89
Section 9: Adding a Custom Report to SyteLine 4. Test your stored procedure by using the following information:
90
1. Open up Crystal Reports by selecting Start + Programs + Crystal Reports. 2. Select Using the Report Wizard from the Welcome to Crystal Dialog box.
3. Click OK from the Crystal Report Gallery. 4. Expand Create new Connection + ODBC in the next dialog, then your database, for example: SyteLine_APP. 5. You should have two options once the database is expanded: Tables and Stored Procedures. If Stored Procedures is not a selection, right-click the database and select Options to enter the Options dialog and select Stored Procedures.
6. Now that you have Stored Procedures as a selection, expand that option, find your stored procedure, and move it into the Selected Tables list.
91
Section 9: Adding a Custom Report to SyteLine 7. Set the parameter fields to allow Nulls. This will allow the report to be run "wide-open".
8. Click OK to return to the Data Explorer and then click Close. 9. Click Next and then add all of the fields from the stored procedure.
10. Click Next to advance the Group Dialog. 11. Add Salesman and CoNum to the Group By column. 12. Click Next to advance to Summaries for the report.
92
Section 9: Adding a Custom Report to SyteLine 13. Remove CoLine from the Salesman Tab.
This is done so that you only have totals for the main group on this report, Salesman. You may choose different options during steps 13-15 to provide a different flavor for your report. There is no right or wrong answer for your grouping options, but some options are more intuitive for the end users of this report. Other logical groups would be State, Customer, or Zip Code. 15. We are done with the Report Expert and we now need to put some special touches to the report's formatting. Thus, we will need to click the Design Report button. Our goal here is to "beautify" the output of our report. Take five minutes and format the report. It is easiest to remain on the Design tab while formatting your report. Format changes in the example below include, Font changes to column titles, dollar signs where applicable, green bar (remainder function), adding a title, print date, page numbers, resizing fields, date formatting (to remove the time element), suppressing duplicate values and more.
93
Section 9: Adding a Custom Report to SyteLine Your report may look similar to this:
16. Save your .rpt in the correct folder with a name of xxxOrderByNumber. The location to the folder is c:\program files\ Frontstep\Taskman\Report\Reports (the xxx is your initials).
94
1. Open the Background Task Definition form and start a new record. 2. Give the task a name of xxxOrderByNumber (with xxx being your initials). Remember this name. It will be used as the BGTaskName on the report options form, a variable that we will pass back to Taskman. It must be added to that form just as you type it on this form. Copy it to your clipboard for easy recall.
3. Give the task a description. 4. Enter the name of the report as xxxOrderByNumber (with xxx being your initials. This should be the same exact name as your .rpt file, without the .rpt). 5. Select RPT as the Executable Type. 6. Save the record. Following the same example, here is a sample of how this form should look:
95
Section 9: Adding a Custom Report to SyteLine 6. Once you have a blank form in front of you, you will need to add an Enhanced Combo box. This component will be for the beginning order number. On the General tab of the component property window, select Enhanced Combo from the Type dropdown list.
Change back to run-time mode and see what kind of functionality this provides. 8. Move to the Data tab and click the Binding button. 9. Select Variable out of the dropdown and click Edit. 10. Type StartingOrder in the Variable field.
Click OK to return to the Components Attributes box. It should look like this:
11. Next, you will need to add a static label next to your combo box. 12. Repeat steps 6 through 10 for the ending order number. 13. You will next need to add two variables to the form. 14. While you are in Edit Mode, navigate to Edit + Variable and click New.
96
Section 9: Adding a Custom Report to SyteLine 15. The first variable is BGTaskName, and it should look like this:
The value should be identical to the Task Definition Name. Use copy and paste to guarantee that they are identical. 16. The second variable is BGTaskParms. They are your combo boxes and should look like this:
17. Next, add a Push Button to the form. Give the button the caption Print. 18. Go to the Behavior tab and type Generate Report as the primary event. 19. Click the Primary button, then click the New button to enter a new event handler. 20. Select Run Background Task from the Type dropdown list. 21. Click the Parms button, then click the Type Specific Parameters button and enter the name of the background task from step 1 of the exercise. 22. Enter the following information - these are the parameters that will be passed to the stored procedure that will gather the correct information for your report.
23. Click OK three times to get back out to list of event handlers. 24. Click New once more to add one more event handler. 25. This time, select RunScript from the Type drop-down.
97
Section 9: Adding a Custom Report to SyteLine 26. Next, type ReportSubmitted into the Parms field.
27. Typing ReportSubmitted will place the following text into the script window:
SubMain () MsgBox GetStringValue("sTaskSubmitted"), vbOKOnly, ThisForm.Caption
This will cause a message box to pop up to let the user know that the task has been submitted. 28. Close out of the script window and click the Done button. 29. Arrange and align your components on your form so that they look presentable and save your form definition. Your form may look like the following:
30. Test your work. Enter two order numbers and click Print.
98
Section 9: Adding a Custom Report to SyteLine Background Task History will assign your request a Process ID Number. In this case it is 158 and you can see the parameters passed by the form in the Task Parameters dialog.
Finished!
Above is the output for the cumulative exercise. Your results may vary from this example.
99
100