Creating Report Templates


Concept


Steps:

  1. Begin by creating a new report using the New button.

     

    Click the New button.

    Step 1
  2. Use the Crystal Reports Gallery dialog box to select a Report Creation Wizard for step-by-step help in creating a report, or create a report from scratch.

    Step 2
  3. In this example, you will create a new blank report.

     

    Click the As a Blank Report option.

    Step 3
  4. Click the OK button.

    Step 4
  5. Use the Database Expert dialog box to view a list of databases that are available for you to use when creating reports for query data or other applications.

     

    You can select the folder that has the appropriate database.

    Step 5
  6. In most cases, do not associate a template to a data source. Leaving the data source undesigned enables users to select a data source specific to their business requirements.

    Step 6
  7. In this example, you click the Cancel button to bypass the Data Source dialog box.

     

    Click the Cancel button.

    Step 7
  8. Use the Design window to create professional looking reports.

    Step 8
  9. For maximum usability of the template, insert only the objects that are generic to all reports.

     

    If needed, develop multiple templates to accommodate the varying needs of users.

    Step 9
  10. Use the Special Fields folder to view and select informative fields such as Page Numbers, Print Date, Report Comments, and so on.

    Step 10
  11. Click the Special Fields list item.

    Step 11
  12. In this example, you insert the Report Title special field in to the middle of the Report Header section.

     

    Press the left mouse button and drag the mouse to select the desired text.

    Step 12
  13. Release the mouse button.

    Step 13
  14. Click the Bold button.

    Step 14
  15. Click the Align Center button.

    Step 15
  16. Click the Italics button.

    Step 16
  17. Click the down arrow next to the Font Size field.

    Step 17
  18. Click the 16 list item.

    Step 18
  19. You can resize a report section to fit a graphic in two ways:

    •  Click and drag the gray section dividers up or down to manually adjust the section.

    •  Right-click the section name and select an option from the pop-up menu to automatically adjust the section.

    Step 19
  20. In this example, you will resize the Report Header section by clicking and dragging the gray section dividers down to manually adjust the section.

     

    Press the left mouse button and drag the mouse to select the desired text.

    Step 20
  21. Release the mouse button.

    Step 21
  22. Use the Insert Text Object button to insert a text object anywhere on your report.

     

    Alternatively, select Insert, Text Object on the menu bar.

    Step 22
  23. In this example, using the Insert Text Object button, you insert a text object into the Report Header section, above the report title.

     

    Click the Insert Text Object button.

    Step 23
  24. Step 24

  25. Enter the desired information into the Text Object field. Enter

     "Your Company or Department Name"
    .

    Step 25
  26. Click the Align Center button.

    Step 26
  27. In this example, you insert a text object into upper-right of the report.

     

    Click the Insert Text Object button.

    Step 27
  28. Click the desired object.

    Step 28
  29. Enter the desired information into the Text Object field. Enter

     "Run Date:"
    .

    Step 29
  30. Use the Print Date special field to include the current date when the report prints. This field can be placed in any section of your report, depending on how often you want it to print.

    Step 30
  31. In this example, you will drag the Print Date special field to the right of the Run Date: text object.

     

    Press the left mouse button and drag the mouse to select the desired text.

    Step 31
  32. Step 32

  33. In this example, you insert a text object into the middle of the Report Footer section.

     

    Click the Insert Text Object button.

    Step 33
  34. Step 34

  35. Enter the desired information into the Text Object field. Enter

     "End of Report"
    .

    Step 35
  36. Click the Align Center button.

    Step 36
  37. In this example, you will insert a text object into the middle of Page Footer section.

     

    Click the Insert Text Object button.

    Step 37
  38. Step 38

  39. Enter the desired information into the Text Object field. Enter

     "Page:"
    .

    Step 39
  40. Use the Page Number special field to insert a field that prints the current page number.

     

    This field are most often placed in the Page Header or Page Footer sections.

    Step 40
  41. In this example, you will drag Page Number special field into the right of the Page: text object.

     

    Press the left mouse button and drag the mouse to select the desired text.

    Step 41
  42. Step 42

  43. Use the Save button to save reports.

     

    Alternatively, select File, Save As on the menu bar.

    Step 43
  44. In this example, you will save the report using the File, Save As menu.

     

    Click the File menu.

    Step 44
  45. Click the Save As list item.

    Step 45
  46. Use the Save As dialog box to name the report and to navigate to the folder where you want to store the report.

    Step 46
  47. Click in the File Name field.

    Step 47
  48. Enter the desired information into the File name field. Enter

     "TEMPLATE.rpt"
    .

    Step 48
  49. Click the Save button.

    Step 49
  50. Use the Insert Picture button to insert graphics into reports.

     

    Alternatively, select Insert, Picture on the menu bar.

    Step 50
  51. In this example, you will insert a graphic into report using the Insert, Picture menu.

     

    Click the Insert menu.

    Step 51
  52. Click the Picture list item.

    Step 52
  53. Use the Open dialog box to locate the graphic that you want to insert.

    Step 53
  54. In this example, you will insert the infotechlogo.jpg file into the upper-left of the report.

     

    Click the infotechlogo.jpg list item.

    Step 54
  55. Click the Open button.

    Step 55
  56. Note that the outline of the graphic appears when you move the cursor into the design area, and the cursor represents the upper left edge of the graphic.

     

    Step 56

  57. After you position the cursor and click to place the graphic, the graphic displays according to the section in which you place them.

     

    In general, place the graphic in the report header section, and the graphic prints only on the first page of the report.

    Step 57
  58. Use the Format Object button to format the selected object such as field, box, graphic, map, chart, and so on.

     

    Alternatively, select Format, Format Object on the menu bar; or right-click the object and select the Format Object option.

    Step 58
  59. In this example, you will resize the infotechlogo graphic by right-clicking the graphic and select the Format Field option.

     

    Right-click the InfoTech graphic.

    Step 59
  60. Click the Format Graphic list item.

    Step 60
  61. Use the Format Editor to format bitmap graphics in your report.

    Step 61
  62. Click the Picture tab.

    Step 62
  63. Use the Format Editor - Picture dialog box to crop, scale, or resize graphics.

    Step 63
  64. Click in the Width field.

    Step 64
  65. In this example, resize the picture to 90% width.

     

    Enter the desired information into the Width field. Enter

     "90"
    .

    Step 65
  66. Click in the Height field.

    Step 66
  67. In this example, resize the picture to 90% height.

     

    Enter the desired information into the Height field. Enter

     "90"
    .

    Step 67
  68. Click the OK button.

    Step 68
  69. To resize a report section automatically:

    1. Place the cursor in the section name area.

        This is the gray area directly under the Design tab.

    2. Right-click and select a command.

    Step 69
  70. In this example, you will resize the Report Header section using the Fit Section option.

     

    Right-click the Report Header object group.

    Step 70
  71. Use the Fit Section option to move the lower boundary of the section to the baseline of the bottom object in the section.

    Step 71
  72. Click the Fit Section list item.

    Step 72
  73. In this example, set the report to read-only using the File, Report Options menu.

     

    Click the File menu.

    Step 73
  74. Click the Report Options list item.

    Step 74
  75. Use the Report Options dialog box to set a number of technical options that apply only to the active report.

     

    Your specifications are saved with the report and do not affect any other reports. This option is useful when creating reports for distribution.

    Step 75
  76. Select the Read-only check box to make the current report read-only.

     

    After you select this option, you won't be able to change the template formatting in any way; you won't be able to add fields or other report objects, change font sizes or colors, and so on.

    Step 76
  77. In this example, you select the Read-only option to lock layout and formatting.

     

    Click the Read-only option.

    Step 77
  78. Click the OK button.

    Step 78
  79. Click the Save button.

    Step 79

You have successfully created a report template.

Table of Contents  Start Topic