Week2 Crystal Report

download Week2 Crystal Report

of 49

Transcript of Week2 Crystal Report

  • 8/3/2019 Week2 Crystal Report

    1/49

    BIS Crystal Reports 1

    References :

    1) Crystal Reports XI R1/R2

    2) Crystal Reports 9 on Oracle

    Annette Harper

    McGraw- Hill / Osborne

    Application Development

    With

    Crystal Reports

  • 8/3/2019 Week2 Crystal Report

    2/49

    BIS Crystal Reports 2

    Reporting

    Determine the layout and content of a report

    Develop a prototype of a report

    Objectives

    After completing this lesson, you should be able to :

  • 8/3/2019 Week2 Crystal Report

    3/49

    BIS Crystal Reports 3

    What is a report?

    A printed document that displays information from adatabase

    Refer to samples of printed reports

    Are database reports and queries different?

    Both require access to the databaseQueries can be ad-hoc or pre-defined, while reports are

    pre-defined

    Queries are on-line, while reports can be generated on-lineor batch.

    A query set is needed to generate a report.

  • 8/3/2019 Week2 Crystal Report

    4/49

    BIS Crystal Reports 4

    Planning & Developing a report prototype

    Requirements gathering Consists of the report designer asking the report

    requestor a series of targeted questions

    Refer to Report Requirements Checklist

    After determining the outline of the report request,develop the prototype by

    Sketching the report on a blank piece of paper, usuallythe size of the report to be printed on

    Filling in a form (refer to Report Prototype Form)

  • 8/3/2019 Week2 Crystal Report

    5/49

    BIS Crystal Reports 5

    Report Requirements Checklist

    Define the overall purpose of the report (e.g. analysis, recordkeeping)

    Define the readers of the report (top management, middlemanagement, sales staff, general public)

    Define the data used in the report (what type of data sourceneeds to be connected?)

    Determine the report title (start with a title, can be changed later) Define header and footer identifying information

    (company logo, print date, title of report, page numbers)

    Define specific data that should appear in the body ofthe report

    Determine if the data is organized into groups (bycustomer?, date? Or other criteria?)

  • 8/3/2019 Week2 Crystal Report

    6/49

    BIS Crystal Reports 6

    Determine if the data is organized into groups (by category, gender,location)

    Determine if the data is sorted based on record or group

    values

    Determine if the data exists or if it needs to be calculated

    Determine if the report is to contain only specific records or

    groups

    Determine if the data needs to be summarized (total, average, count,max, min, grand total at bottom of selected columns?)

    Define how to identify key information through formatting

    options

    Report Requirements Checklist

  • 8/3/2019 Week2 Crystal Report

    7/49

    BIS Crystal Reports 7

    Developing a report prototype

    See Report Prototype Form handout in file

    Report Prototype Form

  • 8/3/2019 Week2 Crystal Report

    8/49

    BIS Crystal Reports 8

    Planning a report

    Reasons for planning a report

    by taking a systems-oriented approach to reporting, you willproduce clearer & more readable reports

    Its best practices to document processes, esp. if working with aclient

    If a group is working on a project, then the group can see asnapshot or prototype of the report if its been documented

    If someone in the team leaves, it will be easier for the others totake over from where he left off if there is documentation of thereport

    The prototype can flag any problems that may occur(technical, data access, client misunderstanding, etc)

    The prototype can constitute a signoff point

  • 8/3/2019 Week2 Crystal Report

    9/49

    BIS Crystal Reports 9

    Notable Commercial reporting software

    MS reporting Service

    Crystal Reportsthe leading reporting tool

    Cognos BI

    Hyperion

    Oracle BI Publisher

    repro

    SQL Server Reporting Services

    JReports

    Microstrategy

    iReports

    http://en.wikipedia.org/wiki/Oracle_XML_Publisherhttp://en.wikipedia.org/wiki/SQL_Server_Reporting_Serviceshttp://en.wikipedia.org/w/index.php?title=JReports&action=edithttp://en.wikipedia.org/wiki/Microstrategyhttp://en.wikipedia.org/wiki/Microstrategyhttp://en.wikipedia.org/w/index.php?title=JReports&action=edithttp://en.wikipedia.org/wiki/SQL_Server_Reporting_Serviceshttp://en.wikipedia.org/wiki/Oracle_XML_Publisherhttp://en.wikipedia.org/wiki/Oracle_XML_Publisherhttp://en.wikipedia.org/wiki/Oracle_XML_Publisherhttp://en.wikipedia.org/wiki/Oracle_XML_Publisher
  • 8/3/2019 Week2 Crystal Report

    10/49

    BIS Crystal Reports 10

    Notable free or open source

    Reporting software

    Agata Report

    BIRT of Eclipse

    JasperReports LGX_Report by LogiXML

    Pentaho

    http://en.wikipedia.org/wiki/Agata_Reporthttp://en.wikipedia.org/w/index.php?title=BIRT_of_Eclipse&action=edithttp://en.wikipedia.org/w/index.php?title=JasperReports&action=edithttp://en.wikipedia.org/wiki/LGX_Reporthttp://en.wikipedia.org/wiki/Pentahohttp://en.wikipedia.org/wiki/Pentahohttp://en.wikipedia.org/wiki/LGX_Reporthttp://en.wikipedia.org/w/index.php?title=JasperReports&action=edithttp://en.wikipedia.org/w/index.php?title=BIRT_of_Eclipse&action=edithttp://en.wikipedia.org/wiki/Agata_Report
  • 8/3/2019 Week2 Crystal Report

    11/49

    BIS Crystal Reports 11

    Creating a Report using Crystal Reports

    Methods of creating a report Adding tables

    The design environment

    Inserting objects on a report The Field Explorer

    The Report Explorer

    The Repository Explorer

    The Workbench

    Previewing a report

    Saving a report Positioning and sizing objects

    Formatting objects

  • 8/3/2019 Week2 Crystal Report

    12/49

    BIS Crystal Reports 12

    The design environment

    Report Headerused for information that you wantto appear at the beginning of the report. It can be used

    for charts & cross-tabs that include data for the entire

    report, e.g. name of report, print date or company logo

    Page Headerused for information that you want to

    appear at the top of each page, e.g. chapter names,

    name of document, column headings, print dates orpage numbers

  • 8/3/2019 Week2 Crystal Report

    13/49

    BIS Crystal Reports 13

    The design environment

    Detailsused for the body of the report & is printedonce per record. The bulk of the report appears in thissection.

    Report footerused for information you want to

    appear only once at the end of the report & for chartsand cross-tabs that include data for the entire report,e.g. grand totals, total number of pages & othersummary information

    Page footer - used for information you want to appearat the bottom of each page, e.g. page number

  • 8/3/2019 Week2 Crystal Report

    14/49

    BIS Crystal Reports 14

    Steps in creating a report

    1. Methods of creating

    2. Choosing a data source

    3. Adding & linking tables4. Inserting objects on a report

    5. Determining data field types

    6. Previewing a report

    7. Saving a report

  • 8/3/2019 Week2 Crystal Report

    15/49

    BIS Crystal Reports 15

    1. Creating a report

    Methods of creating a report

    Use one of the Report Wizards provided

    Construct the report manually

    Create a report from another report

  • 8/3/2019 Week2 Crystal Report

    16/49

    BIS Crystal Reports 16

    2. Choosing a Data source

    Options of choosing a data sourceCurrent connections (shows all data sources that you

    are currently connected to)

    Favorites (shows the data sources you use frequently)

    History (shows data sources that have been recently

    accessed from Crystal Reports)

    Create New Connection

    Repository (which holds different types of objectscommonly used in report design so that other reports

    can use them without having to recreate them)

  • 8/3/2019 Week2 Crystal Report

    17/49

    BIS Crystal Reports 17

    2. Choosing a Data Source

  • 8/3/2019 Week2 Crystal Report

    18/49

    BIS Crystal Reports 18

    2. Choosing a Data Source

    Click Next. Ignore user ID and password

  • 8/3/2019 Week2 Crystal Report

    19/49

    BIS Crystal Reports 19

    3. Adding tables(after connecting to your data source)

    Select Customer & Orders tables. Click Next

  • 8/3/2019 Week2 Crystal Report

    20/49

    BIS Crystal Reports 20

    3. Linking Tables

    Select Auto-Arrange. Click Next.

  • 8/3/2019 Week2 Crystal Report

    21/49

    BIS Crystal Reports 21

    The Design Environment

    Field Explorer

    Report Explorer

    Repository Explorer

    Workbench

  • 8/3/2019 Week2 Crystal Report

    22/49

    BIS Crystal Reports 22

    The Design Environment

    Report Headerfor info that should appear at the beginning

    of the report (print date, company logo, report title)

    Page Headerfor info that should appear at the top of each

    page (chapter names, name of document, column headings, page numbers, print dates)

    Detailsfor body of the report, & is printed once per record Report Footerfor info that should appear only once at end

    of report (grand totals, tot no of pages & other summary info)

    Page Footerfor info that should appear at the bottom of

    each page (page numbers, company logo)

  • 8/3/2019 Week2 Crystal Report

    23/49

    BIS Crystal Reports 23

    4. Inserting objects on a report

    Tools to use for inserting objects on a reports

    Field explorerused to insert, modify or delete fields on theDesign & Preview tabs

    Report explorerdisplays a tree view of the sections in yourreport & lists the report objects contained in each section & workslike a navigator

    Repository explorerthe central location to store & manage yourreport objects (text objects, bitmaps, custom functions, queries,business views, list of values) in BusinessObjects Enterprise(self-exploration).

    Workbencha folder structure representing the types of projectsyou work on. (needs connection to BusinessObjects Enterprise(self-exploration)

  • 8/3/2019 Week2 Crystal Report

    24/49

    BIS Crystal Reports 24

    4. Inserting objects on a report

  • 8/3/2019 Week2 Crystal Report

    25/49

    BIS Crystal Reports 25

    6. Previewing a report

    Click Preview tag or Print Preview to view your

    report

    S i

  • 8/3/2019 Week2 Crystal Report

    26/49

    BIS Crystal Reports 26

    7. Saving a report

    It is possible to save summary information suchas the report author, report title and comments

    There may be times when you want to includenon-printing comments with a report (a personal

    note to explain more thoroughly the data onwhich the report is based, or a comment aboutsome particular data on the report

    On File menu, clickSummary Info

    O h fi ld

  • 8/3/2019 Week2 Crystal Report

    27/49

    BIS Crystal Reports 27

    Other fields

    On the Standard Toolbar, click Field Explorer,

    expand Special Fields such as date time, time

    zone, page number, etc.

    Drag and drop the required fields

    I i P i D

  • 8/3/2019 Week2 Crystal Report

    28/49

    BIS Crystal Reports 28

    Inserting Print Date, etc

    P iti i bj t

  • 8/3/2019 Week2 Crystal Report

    29/49

    BIS Crystal Reports 29

    Positioning objects

    A Grid is an imaginary series of vertical and horizontal

    lines across the working area.

    Guidelines are vertical markers in the ruler for each

    field which was placed field placed in the Details area.

    To select grid / guidelines Click File -> Options -> Layout

    Select Grid or Guidelines

    For Grid, select Snap to Grid to have objects aligned

    automatically

    L ki bj t iti & i

  • 8/3/2019 Week2 Crystal Report

    30/49

    BIS Crystal Reports 30

    Locking an objects position & size

    To lock an objects size and position so that it

    cant be moved

    Select the object (s) whose size and position you

    want to lock

    On the Formatting toolbar, click

    Lock Size /Position

    E h i th t ti f t

  • 8/3/2019 Week2 Crystal Report

    31/49

    BIS Crystal Reports 31

    Enhancing the presentation of a report

    Charts

    Pictures

    Colours Highlights

    S l ti R d i C t l R t

  • 8/3/2019 Week2 Crystal Report

    32/49

    BIS Crystal Reports 32

    Selecting Records in Crystal Reports

    You can filter or select the records you want to see

    included on your report in the Select Expert.

    Often, we need to restrict the records printed for a

    particular set. For example, in the Xtreme database that ships with

    Crystal Reports, a number of distributors are listed.

    We want to report only those in North America or only

    those who sold more than $30,000 last year.32

  • 8/3/2019 Week2 Crystal Report

    33/49

    BIS Crystal Reports 33

  • 8/3/2019 Week2 Crystal Report

    34/49

    BIS Crystal Reports 34

    Selecting records

  • 8/3/2019 Week2 Crystal Report

    35/49

    BIS Crystal Reports 35

    Selecting records

    The first step in record selection is to define yourcriteria for selection. For example, you can focus on

    one city or state, or are you interested in specific

    regions. May be a date range or all records below a

    particular value will work best. Base on the above, you make your selection choice in

    Select Expert (default is any value).

    You can ensure that your record selection statement is

    case insensitive to prevent unnecessary problems.

  • 8/3/2019 Week2 Crystal Report

    36/49

    BIS Crystal Reports 36

    Saved and Refreshed data

  • 8/3/2019 Week2 Crystal Report

    37/49

    BIS Crystal Reports 37

    Saved and Refreshed data

    In Crystal Reports, you have the option to usedata that is saved to your local machine or use

    data that is directly taken from the data source.

    Saved data

  • 8/3/2019 Week2 Crystal Report

    38/49

    BIS Crystal Reports 38

    Saved data

    Saved dataReports with saved data are useful for dealing with

    data that isnt continually updated.

    When users navigate through reports with saved

    data, and drill down for details on columns orcharts, they dont access the database server

    directly; instead, they access the saved data.

    It not only minimize data transfer over the network,

    but also lighten the database servers workload.

    Saved data

  • 8/3/2019 Week2 Crystal Report

    39/49

    BIS Crystal Reports 39

    Saved data

    You can scheduled these reports to be automaticallyrefresh from the database on a predetermined basis.

    For example, if your sales db is only updated once a

    day, or once a week, then you can run the report on a

    similar schedule and save it with data so that salesrepresentatives always have access to current sales data

    without hitting the db each time they open a report.

    You can also refresh reports with saved data on an as-

    needed basis.

    Saved data

  • 8/3/2019 Week2 Crystal Report

    40/49

    BIS Crystal Reports 40

    Saved data

    Saved data is discarded and refreshed when youperform any of these tasks in a report: Select the Refresh command

    Change your database logon

    Change the reports parameters

    Add a new field that doesnt exist in the saved data Drill down in a report where Perform Grouping on Server isselected and the details section is suppressed.

    Verify the dbwhen db structure changes

    Change the linking parameter on a sub-report (the sub-reportis refreshed)

    Change the order of groups (only for reports in theapplication server).

    Refreshed data

  • 8/3/2019 Week2 Crystal Report

    41/49

    BIS Crystal Reports 41

    Refreshed data

    When you refreshed a report that doesnt have saveddata, Crystal Reports retrieved data from the database;i.e., the program discards the reports saved data andretrieves new data.

    Crystal reports only retrieves data when necessary. When you preview your report

    Print the report

    Export it to a file

    The program runs your report and retrieves the

    required data.

    Refreshed data

  • 8/3/2019 Week2 Crystal Report

    42/49

    BIS Crystal Reports 42

    Refreshed data

    Once you are working with the data in the Preview tab,

    the program will run the report again and retrieve fresh

    data if you:

    Add fields to the report after the report was run

    Add a formula that references a field that was not in the

    report when you ran it the first time

    Expand your record selection criteria to include more records

    than were needed when you first ran the report.

    You choose to retrieve new data for report when you may

    have created the report few days earlier and you want to seeit run with the most current data.

    How to saved and refreshed data

  • 8/3/2019 Week2 Crystal Report

    43/49

    BIS Crystal Reports 43

    How to saved and refreshed data

    To save a report with dataOn the file menu, select Save Data with Report

    Save the report

    To refresh data

    Click Refresh on the Navigation Tools toolbar

    You can also use the Refresh Report Data command

    from the Report menu, F5 on the keyboard, or the

    Refresh button located to the far right of the ReportDesigner window at the top of the screen.

    Apply time-based record selection

  • 8/3/2019 Week2 Crystal Report

    44/49

    BIS Crystal Reports 44

    Apply time based record selection

    Setting a time-based record selection is useful whenyou want to determine results based on a certain dateor time range.

    For example, you may want to find out whichcustomers bought over $10,000 in product from you in

    Q1 of your fiscal year. Of you may want to see all accounts that have not been

    accessed in the past year

    Or to show all sales representatives that have placed

    five or more orders in the past month.

    Set record selection based on a date

  • 8/3/2019 Week2 Crystal Report

    45/49

    BIS Crystal Reports 45

    Set record selection based on a date

    To do this, you would create a record selectionusing the appropriate date and, if needed,formula fields in the Select Expert.

    Crystal Reports will then read the date from

    your system and displays the appropriate dataeach time the report is refreshed.

    For example, you need a report that shows eachstaff member whose birthday is within a certain

    period.

  • 8/3/2019 Week2 Crystal Report

    46/49

    BIS Crystal Reports 46

  • 8/3/2019 Week2 Crystal Report

    47/49

    BIS Crystal Reports 47

  • 8/3/2019 Week2 Crystal Report

    48/49

    BIS Crystal Reports 48

    Summary

  • 8/3/2019 Week2 Crystal Report

    49/49

    BIS Crystal Reports 49

    y

    What is a report?

    What are the typical contents of a report?

    What are the steps needed to create a report?

    Ways to enhance the presentation of a report