Crystal Reports V3.0

  • Published on
    24-Nov-2014

  • View
    107

  • Download
    2

Embed Size (px)

Transcript

<p>Crystal ReportsVersion 3.0</p> <p>The New Standard in Quality Education</p> <p>Crystal Reports OverviewPre-requisites Introduction</p> <p>2</p> <p>The New Standard in Quality Education</p> <p>ObjectivesTo enable you to develop your own reporting solutions in Crystal Reports with confidence</p> <p>3</p> <p>The New Standard in Quality Education</p> <p>Course Overview1 2 3 4 Data Structure Simple Report Creation Crystal Report Functions Running Reports</p> <p>4</p> <p>The New Standard in Quality Education</p> <p>Scala Data StructureSection 1</p> <p>The New Standard in Quality Education</p> <p>Section Overview </p> <p>What is a Database? How do we connect to the Database? Scala data file structure</p> <p>6</p> <p>The New Standard in Quality Education</p> <p>How Do We Connect to the DB?Scala Client Win95, 98, NT Web Browser</p> <p>Scala Program Layer</p> <p>Scala5.x Modules</p> <p>Btrieve or SQL data management layer</p> <p>Data Management</p> <p>Database</p> <p>7</p> <p>The New Standard in Quality Education</p> <p>How Do We Connect to the DB?</p> <p>Crystal ReportsDDFs Describe Database (Btrieve) ODBC Connects to Database table SYSOBJECTS</p> <p>Read OnlyDatabase</p> <p>8</p> <p>The New Standard in Quality Education</p> <p>Database Structure</p> <p>So what is ODBC?</p> <p>9</p> <p>The New Standard in Quality Education</p> <p>ODBC ArchitectureApplication (Access / Excel) ODBC Driver Manager (ODBC API connect methods)</p> <p>Driver</p> <p>Driver</p> <p>Driver</p> <p>}</p> <p>= ODBC</p> <p>SQL Server Database</p> <p>Btrieve Database 6.15</p> <p>Pervasive SQL Database 7.x</p> <p>10</p> <p>The New Standard in Quality Education</p> <p>Data File Structure</p> <p>Scala Table Naming Definition</p> <p>MMNNCCYYModule Unique Number Financial Year Company Code</p> <p>11</p> <p>The New Standard in Quality Education</p> <p>Data File Structure</p> <p>Format of Data files</p> <p>12</p> <p>The New Standard in Quality Education</p> <p>Data File Structure</p> <p>Format of Fields</p> <p>13</p> <p>The New Standard in Quality Education</p> <p>Data File Structure</p> <p>Database to Interpret field and file names ScaDBconv.exe Scala5eu.mdb in Scala root directory Table in SQL database SCA_TAB_COLUMNS</p> <p>14</p> <p>The New Standard in Quality Education</p> <p>Data File Structure</p> <p>Scala5eu.mdb welcome screen</p> <p>15</p> <p>The New Standard in Quality Education</p> <p>Data File Structure</p> <p>16</p> <p>The New Standard in Quality Education</p> <p>Break</p> <p>Break</p> <p>17</p> <p>The New Standard in Quality Education</p> <p>Section Review </p> <p>What is a Database? How do we connect to the Database? Scala data file structure</p> <p>18</p> <p>The New Standard in Quality Education</p> <p>Simple Report CreationSection 3</p> <p>The New Standard in Quality Education</p> <p>Section Overview </p> <p>Report Style SQL Data Files Scala Data Files Scala Data Fields Preview Report</p> <p>20</p> <p>The New Standard in Quality Education</p> <p>Report CreationClick</p> <p>21</p> <p>The New Standard in Quality Education</p> <p>Report StyleReport A - Stock Listing Step 1 - Choose report style</p> <p>Click</p> <p>22</p> <p>The New Standard in Quality Education</p> <p>Data SourceStep 2 - Select Data Source</p> <p>Click</p> <p>23</p> <p>The New Standard in Quality Education</p> <p>Data SourceStep 3 - Choose Data Source</p> <p>Note the different database options!!</p> <p>24</p> <p>The New Standard in Quality Education</p> <p>Data Source Step 3 - Choose Data SourceNeed to supply user name and password</p> <p>25</p> <p>The New Standard in Quality Education</p> <p>Scala Data FilesStep 4 - Select Scala Data TablesSelect File(s) Click To Finish</p> <p>Select Single or Multiple Tables26The New Standard in Quality Education</p> <p>Scala Data FilesConfirmation of Selected Files</p> <p>Click Next</p> <p>27</p> <p>The New Standard in Quality Education</p> <p>Scala Data FieldsStep 5 - Select Fields</p> <p>28</p> <p>The New Standard in Quality Education</p> <p>Scala Data Fields</p> <p>Report 1 Stock Listing </p> <p>Stock Code Description Line 1 Price Local Currency Stock Balance</p> <p>SC01001 SC01002 SC01004 SC01042</p> <p>29</p> <p>The New Standard in Quality Education</p> <p>Scala Data Fields</p> <p>Select Fields Choose Add</p> <p>30</p> <p>The New Standard in Quality Education</p> <p>Field Tab</p> <p>31</p> <p>The New Standard in Quality Education</p> <p>Preview ReportWhen all fields are selected choose FINISH</p> <p>Click</p> <p>32</p> <p>The New Standard in Quality Education</p> <p>Report Creation</p> <p>33</p> <p>The New Standard in Quality Education</p> <p>Report Creation</p> <p>You can return to the report expert at any time by using the function Recommend that the report is saved before returning to the expert</p> <p>34</p> <p>The New Standard in Quality Education</p> <p>Break</p> <p>Break</p> <p>35</p> <p>The New Standard in Quality Education</p> <p>Section Review </p> <p>STEP 1 STEP 2 STEP 3 STEP 4 STEP 5</p> <p>- Report Style - SQL Data Source - Scala Data Tables - Scala Data Fields - Preview Report</p> <p>36</p> <p>The New Standard in Quality Education</p> <p>ExerciseExercise 1 Customer Listing</p> <p>The New Standard in Quality Education</p> <p>Crystal ReportsSection 3</p> <p>The New Standard in Quality Education</p> <p>Section Overview </p> <p>Design &amp; Preview Report Options Guidelines Refreshing Data Right Click Sections</p> <p>39</p> <p>The New Standard in Quality Education</p> <p>Design &amp; Preview Tabs</p> <p>40</p> <p>The New Standard in Quality Education</p> <p>Design &amp; Preview Tab</p> <p>41</p> <p>The New Standard in Quality Education</p> <p>Preview Tab</p> <p>42</p> <p>The New Standard in Quality Education</p> <p>Report Options </p> <p>Options Report Options</p> <p>43</p> <p>The New Standard in Quality Education</p> <p>Options</p> <p>44</p> <p>The New Standard in Quality Education</p> <p>Options</p> <p>45</p> <p>The New Standard in Quality Education</p> <p>Options</p> <p>46</p> <p>The New Standard in Quality Education</p> <p>Guidelines</p> <p>47</p> <p>The New Standard in Quality Education</p> <p>Refreshing Data </p> <p>F5 Refreshes Data or Preview Sample</p> <p>48</p> <p>The New Standard in Quality Education</p> <p>Refreshing Data</p> <p>Preview Sample</p> <p>49</p> <p>The New Standard in Quality Education</p> <p>Right Clicking</p> <p>Useful in many areas of Crystal</p> <p>Short Cut to menu optionsThe New Standard in Quality Education</p> <p>50</p> <p>The Magic Button</p> <p>Undo / Redo</p> <p>51</p> <p>The New Standard in Quality Education</p> <p>SectionsLeft-hand side of design tab shows report sections</p> <p>Report Sections</p> <p>52</p> <p>The New Standard in Quality Education</p> <p>Sections</p> <p>Right-hand clicking in the sections area brings up menu Format sections command gives further details of sections. Section can be hidden allowing drill down function or suppressed</p> <p>53</p> <p>The New Standard in Quality Education</p> <p>Sections</p> <p>54</p> <p>The New Standard in Quality Education</p> <p>Section Review </p> <p>Design &amp; Preview Report Options Guidelines Refreshing Data Right Click Sections</p> <p>55</p> <p>The New Standard in Quality Education</p> <p>Formatting</p> <p>The New Standard in Quality Education</p> <p>Section Overview </p> <p>Adjusting Headings Increasing Field Width Adding new fields Adding Special fields Selection Expert Sorting Grouping ParametersThe New Standard in Quality Education</p> <p>57</p> <p>Adjusting Headings </p> <p>Highlight field To rename double click or | edit | text object As with many windows products Crystal Reports supports drag and drop and copy and paste</p> <p>58</p> <p>The New Standard in Quality Education</p> <p>Increasing Field Width</p> <p>Highlight the field</p> <p>Place pointer on blue boxes it changes to arrow Field width and height can be adjusted by dragging arrowThe New Standard in Quality Education</p> <p>59</p> <p>Adding New FieldsText Field</p> <p>Drag And Click to Drop60The New Standard in Quality Education</p> <p>Adding New FieldsField Explorer</p> <p>61</p> <p>The New Standard in Quality Education</p> <p>Adding New Fields</p> <p>Database fields</p> <p>Select field</p> <p>62</p> <p>The New Standard in Quality Education</p> <p>Adding Special Fields</p> <p>63</p> <p>The New Standard in Quality Education</p> <p>Adding Special Fields</p> <p>A number of the special field values are set in Summary info from file menu</p> <p>64</p> <p>The New Standard in Quality Education</p> <p>Selection Expert</p> <p>Choose Select Expert</p> <p>Then choose field to select items from. Report on non-report fieldThe New Standard in Quality Education</p> <p>65</p> <p>Selection Expert</p> <p>Default to AND can change to OR through formula66The New Standard in Quality Education</p> <p>Selection Expert</p> <p>Example of Selection terms</p> <p>New!</p> <p>67</p> <p>The New Standard in Quality Education</p> <p>Sorting Records</p> <p>You can sort by multiple columns.</p> <p>68</p> <p>The New Standard in Quality Education</p> <p>Sort Expert</p> <p>Brings up sort box</p> <p>Sort Fields Report Fields</p> <p>Sort Direction</p> <p>Automatic sort by column 1The New Standard in Quality Education</p> <p>69</p> <p>Grouping </p> <p>Used to group data together Similar to sorting but adds headers and footers</p> <p>70</p> <p>The New Standard in Quality Education</p> <p>Grouping </p> <p>Used in Sub-Totaling User can define the order</p> <p>71</p> <p>The New Standard in Quality Education</p> <p>Grouping</p> <p>Define Order</p> <p>Extra Options on Date field</p> <p>72</p> <p>The New Standard in Quality Education</p> <p>Grouping</p> <p>Specified Grouping User defined order</p> <p>Select Groups</p> <p>73</p> <p>The New Standard in Quality Education</p> <p>Grouping</p> <p>Example of Grouping</p> <p>74</p> <p>The New Standard in Quality Education</p> <p>Parameters </p> <p>Used with selection terms Provides an easy way to change selection terms when a report is refreshed Parameter can be used as a field in the report. For Example in the report title. Compatible with compiled reports or web based reports</p> <p>75</p> <p>The New Standard in Quality Education</p> <p>Parameters</p> <p>Then click icon to create new parameter</p> <p>76</p> <p>The New Standard in Quality Education</p> <p>ParametersText that appears when report is run</p> <p>Type Next Screen</p> <p>Allows parameter to hold single value or multiple values and Ranges. Experiment to see affect77The New Standard in Quality Education</p> <p>ParametersWarning on Usage</p> <p>78</p> <p>The New Standard in Quality Education</p> <p>Parameters</p> <p>Example of Usage</p> <p>79</p> <p>The New Standard in Quality Education</p> <p>Parameters </p> <p>Enter Parameter as selection terms Parameter field denoted as (? Field)</p> <p>Now refresh dataThe New Standard in Quality Education</p> <p>80</p> <p>Parameter</p> <p>81</p> <p>The New Standard in Quality Education</p> <p>Section Review </p> <p>Adjusting Headings Increasing Field Width Adding new fields Adding Special fields Selection Expert Sorting Grouping ParametersThe New Standard in Quality Education</p> <p>82</p> <p>ExerciseExercise 2</p> <p>The New Standard in Quality Education</p> <p>Break</p> <p>Break</p> <p>84</p> <p>The New Standard in Quality Education</p> <p>Totalling and FormulasSection 6</p> <p>The New Standard in Quality Education</p> <p>Section Overview </p> <p>Strings Converting Strings Totalling / subtotalling and summaries Converting Dates</p> <p>86</p> <p>The New Standard in Quality Education</p> <p>Strings</p> <p>Scala 5.1 SQL holds the majority of fields in the correct format. However due to historical reasons some fields will need to be converted Strings are collections of characters alpha and/or numeric Strings need to be converted to numbers for Crystal to perform operationsThe New Standard in Quality Education</p> <p>87</p> <p>Converting Strings to Numbers</p> <p>Create a new formulaClick New</p> <p>88</p> <p>The New Standard in Quality Education</p> <p>Converting Strings to Numbers</p> <p>Give the formula a name</p> <p>Tip - Give your formula name the column nameThe New Standard in Quality Education</p> <p>89</p> <p>Converting Strings to Numbers</p> <p>This then brings up formula editor box</p> <p>Fields</p> <p>Operators</p> <p>Formula Text</p> <p>Functions</p> <p>90</p> <p>The New Standard in Quality Education</p> <p>Converting Strings to Numbers</p> <p>To convert a string to a number typeField</p> <p>Function</p> <p>ToNumber({Field name})</p> <p>Be careful of Brackets </p> <p>(,) = function {,} = field [,] = field value (Seen later)The New Standard in Quality Education</p> <p>91</p> <p>Converting Strings to Numbers</p> <p>92</p> <p>The New Standard in Quality Education</p> <p>Converting Strings to Numbers</p> <p>Unfortunately this formula does not always work. Scala leaves blanks in database instead of zeros. Therefore we need to add to the statementIf {field_name} = Then 0 Else ToNumber({Field_Name})</p> <p>93</p> <p>The New Standard in Quality Education</p> <p>ExerciseExercise 3</p> <p>The New Standard in Quality Education</p> <p>Totalling and Sub-totalling</p> <p>Sub total or grand total fields must be numeric. Highlight the field you require a total for and select totalling from insert drop down menu.</p> <p>95</p> <p>The New Standard in Quality Education</p> <p>Totalling and Sub totalling</p> <p>Right hand clicking on the report field will also bring up a shortcut method to enter totalling.</p> <p>If the options are missing on the menu you have not chosen a numeric fieldThe New Standard in Quality Education</p> <p>96</p> <p>Sub-totalling</p> <p>Entering a sub-total</p> <p>97</p> <p>The New Standard in Quality Education</p> <p>Totalling</p> <p>Insert grand-totals</p> <p>Choice of sum, maximum, minimum, average etc. Field printed in report footerThe New Standard in Quality Education</p> <p>98</p> <p>Summaries</p> <p>Similar to subtotal but will give same totalling options as grand total function</p> <p>99</p> <p>The New Standard in Quality Education</p> <p>Converting Dates</p> <p>Again the majority of dates in Scala database are held as datetime or date fields. However some may need conversion from a string field</p> <p>19980915 YYYYMMDD</p> <p>100</p> <p>The New Standard in Quality Education</p> <p>Converting Dates</p> <p>Conversion requires following formula: </p> <p>If {Field_Name} = then Date(0,0,0) Else Date(ToNumber({field_name}[1 to 4]), ToNumber({field_name}[5 to 6]), ToNumber({field_name}[7 to 8]))</p> <p>101</p> <p>The New Standard in Quality Education</p> <p>Section Review </p> <p>Strings Converting Strings Totalling / subtotalling and summaries Converting Dates</p> <p>102</p> <p>The New Standard in Quality Education</p> <p>ExerciseExercise 4</p> <p>The New Standard in Quality Education</p> <p>Formatting Numbers &amp; DatesSection 7</p> <p>Optional</p> <p>The New Standard in Quality Education</p> <p>Section Overview </p> <p>Formatting Strings Formatting Numbers Formatting Dates Conditional Formatting Highlight Expert Top N Selection Report Alerts Running Totals SQL ExpressionsThe New Standard in Quality Education</p> <p>105</p> <p>Formatting Strings</p> <p>Right-hand click on field or chose format field from format menu</p> <p>106</p> <p>The New Standard in Quality Education</p> <p>Formatting Numbers</p> <p>Extra Format Tab</p> <p>107</p> <p>The New Standard in Quality Education</p> <p>Formatting Numbers</p> <p>108</p> <p>The New Standard in Quality Education</p> <p>Formatting Dates</p> <p>Extra Format Tab Choose Customize</p> <p>109</p> <p>The New Standard in Quality Education</p> <p>Conditional Formatting</p> <p>Conditional Vs Absolute</p> <p>Select a number field for this example</p> <p>110</p> <p>The New Standard in Quality Education</p> <p>Conditional Formatting</p> <p>Brings up the Formula Editor Box</p> <p>111</p> <p>The New Standard in Quality Education</p> <p>Conditional Formatting</p> <p>Button Changes to Red indicating value is controlled conditionally</p> <p>112</p> <p>The New Standard in Quality Education</p> <p>Conditional Formatting</p> <p>Conditional formatting can be used throughout Crystal reports Advanced technique that is particularly useful in dealing with Sections</p> <p>113</p> <p>The New Standard in Quality Education</p> <p>Highlight Expert</p> <p>Works similarly to previous example of conditional formatting Gives a Traffic Light effect to the data</p> <p>114</p> <p>The New Standard in Quality Education</p> <p>Highlight Expert</p> <p>115</p> <p>The New Standard in Quality Education</p> <p>Report Alerts</p> <p>Similar to Highlight expert but a window appears when a report is run to indicate records correspond to a certain set o...</p>