04 - Reporting With Crystal Reports

  • Upload
    ly-bang

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

  • 7/26/2019 04 - Reporting With Crystal Reports

    1/24

    Reporting With SAP Crystal

    Reports

    MOTIVATION

    This material is anintroduction to how to developreport utilizing SAP CrystalReports. It is aimed atstudents at universities,universities and other

    educational institutions withlimited experience withusiness Intelligence.

    It can !e used in theclassroom or "or sel"#study.

    $n completion o" the course,students will !e a!le tounderstand the !asicconcepts o" reporting anddevelop reports with this tool.

    The material also serves as a

    re"erence "or occasional userso" SAP systems.

    LEARNING METHOD

    The learning method used is%guided learning.& The !ene"ito" this method is that'nowledge is imparted(uic'ly. Students also ac(uirepractical s'ills and

    competencies. As with anexercise, this methodexplains a process orprocedure in detail.

    )xercises at the end ena!lestudents to put their'nowledge into practice.

    Product

    SAP Crystal Reports

    Level

    eginner

    Focus

    Report *evelopment

    Author

    Paul +aw'ing

    Version

    Paul +aw'ing - une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    2/24

    GBI

    BIKEBicycles

    TOURTouring

    DTRDelu!e

    touring "i#e

    DTR $%%%

    Blac#

    DTR &%%%Sil'er

    DTR (%%%Re)

    PRTRPro*essionaltouring "i#e

    PRTR $%%%

    Blac#

    PRTR &%%%Sil'er

    PRTR (%%%Re)

    ORBKO+ Roa)

    OR,- $%%%,en.s

    stan)ar)

    ORW, $%%%

    Wo/en.sstan)ar)

    ACCRAccessories

    PROTProtecti'e

    PADSPa)s

    EPAD $%%%

    El"o0 pa)s

    KPAD $%%%Knee pa)s

    12,T1el/ets

    O1,T $%%%

    O* * roa)hel/et

    R1,T $%%%Roa)

    hel/ets

    UTI2Utilities

    S1RT $%%%T3shirt

    RKIT $%%%

    Repair #it

    PU,P $%%%Air pu/p

    CAGE $%%%Water "ottle

    cage

    BOT2 $%%%Water "ottle

    4AID $%%%4irst ai) #it

    SAP Crst!l Re"ortsSAP usiness Intelligence provides a !road range o" reporting tools to "acilitate decision ma'ing o"

    the di""erent end users. SAP Crystal Reports is reporting tool that is used to "ormatted reports. SAPCrystal Reports ma'es it easy to create simple reports, and, it also has the comprehensive tools youneed to produce complex or specialized reports. uilt#in report experts guide you step !y step through!uilding reports and completing common reporting tas's.

    Reporting Scenario0lo!al i'e International 10I2 is a world class !icycle company

    serving !oth pro"essional and amateur cyclists. The company sells

    !icycles and accessories. In the touring !i'e category, 0I3s

    handcra"ted !icycles have won numerous design awards and are

    sold in over -/ countries. 0I3s signature composite "rames are

    world#renowned "or their strength, low weight and easy maintenance. 0I !i'es are consistently

    ridden in the Tour de 4rance and other ma5or international road races. 0I produces two models o"

    their signature road !i'es, a deluxe and pro"essional model. The 'ey di""erence !etween the two

    models is the type o" wheels used, aluminium "or the !asic model and car!on composite "or the

    pro"essional model. 0I3s o""#road !i'es are also recognized as incredi!ly tough and easy to

    maintain. 0I o""#road !i'es are the pre"erred choice o" world champion o"" road racers and have

    !ecome synonymous with per"ormance and strength in one o" the most gruelling sports in the world.

    0I produces two types o" o""#road !i'e, a men3s and women3s model. The !asic di""erence !etween

    the two models is the smaller size and ergonomic shaping o" the women3s "rame. 0I also sells an

    Accessories product line comprised o" helmets, t#shirts and other riding accessories. 0I partners

    with only the highest (uality suppliers o" accessories which will help enhance riders3 per"ormance and

    com"ort while riding 0I !i'es.The 4igure !elow displays the 0I range o" products.

    Paul +aw'ing une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    3/24

    Traditionally 0I was a wholesaler who sold their !i'es to retailers who then resold the !i'es to theend consumers. Recently 0I has decided to sell their !i'e to the end consumer via the internet.

    Organisational Structure

    0I3s head(uarters are located in *allas and the )uropean su!sidiary company 10I )urope2 is

    !ased in +eidel!erg, 0ermany. In regards to the 0I sales process there are two sales organisations

    "or America 1)astern 6S and 7estern 6S2 and two "or 0ermany 18orthern 0ermany and Southern

    0ermany2. All sales organisations have a wholesale distri!ution channel responsi!le "or delivering the

    products to the customers. +owever only one sales organisation is re(uired in each country to

    support internet sales. The diagram !elow displays the 0I organisation to support the sales

    process.

    Paul +aw'ing 9 une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    4/24

    Re#uire$ents

    0I management currently SAP )CC to manage and automate their !usiness processes.. The*epartment +eads have indicated that re(iuire a simple report which displays the Price :ist "or the

    products which 0I sell. it was decided to !uild a report using SAP Crystal Reports.

    Paul +aw'ing ; une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    5/24

    Opening Crystal reports

    -. Choose St!rtPro%r!$sCrst!l Re"orts &'((Crst!l Re"orts &'((.

    Crst!l Re"orts appears on screen.

    SAP Crystal Reports provides users with a num!er o" alternatives "or report creation including wizards

    1Standard, Cross#Ta!,

  • 7/26/2019 04 - Reporting With Crystal Reports

    6/24

    OLAP )i*!rdguides the user to create a report in which $:AP data is displayed as a grid o!5ectwhich includes dimensions "rom the $:AP data source.

    4or the purpose o" this tutorial you will create a report without the use o" a wizard.

    . Clic' to create a new report..

    The D!t!,!se E-"ertdialog screen appears.

    Selecting a data source>ou can create reports !ased on a variety o" data sources. +owever !e"ore you can create a report

    you need to create a connection to the re(uired data source. >ou are going to connect to the 0I

    data source which is in a ou now need to select the ta!les

    which are to !e included in the report.

    Paul +aw'ing une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    7/24

    . Clic' to select this ta!le "rom the data source.

    D. Clic' to trans"er this ta!le.

    -/. Repeat the process "or the remaining ta!les in your data source.

    --. Press 2ENTER3to continue.

    Paul +aw'ing B une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    8/24

    The *ata!ase )xpert displays the ta!les "orm the data source. It displays the primary 'eys o"

    each ta!le and the lin's !etween ta!les.

    -. *rag the D!t!,!se E-"ertscreen to re#size it so all ta!les appear.

    >ou will notice that the D!t!,!se E-"erthas predicted most o" the lin's !etween ta!les. +owever

    due to the same "ield having di""erent names 1SalesOrg and Sales Organistion2 in di""erent ta!les the

    *ata!ase )xpert was not a!le to predict this lin'. >ou will have to create this lin' manually.

    -9. Clic' SalesOrgto select this "ield in the Sales_Organisation ta!le.

    -;. *rag the selected "ield to Sales Organisationin the GBI_Transactionsta!le to create a lin'.

    The lin' appears !etween the two "ields.

    8ote i" you ma'e a mista'e to can delete a lin' !y selecting it and pressing 2DELETE31

    -=. Clic' to continue.

    Paul +aw'ing une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    9/24

    A !lan' report appears on screen in Desi%nmode .

    -. Clic' to maximise Crystal Reports.

    Screen Components

    The Crystal Reports *esign ta! is divided into "ive sections?

    Re"ort He!der1R+2# This section is generally used "or the report title and other in"ormation you want

    to appear at the !eginning o" the report. It can also !e used "or charts and cross#ta!s that include data

    "or the entire report.

    P!%e He!der1P+2# This section is generally used "or in"ormation that you want to appear at the top o"each page. This can include such things as chapter names, the name o" the document, and othersimilar in"ormation. This section can also !e used to display "ield titles a!ove the "ields on a report.

    Det!ils1*2# This section is used "or the !ody o" the report, and is printed once per record. The !ul' o"the report data generally appears in this section.

    Re"ort Footer 1R42 # This section is used "or in"ormation you want to appear only once at the end o"the report 1such as grand totals2 and "or charts and cross#ta!s that include data "or the entire report.

    Paul +aw'ing D une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    10/24

    P!%e Footer1P42 # This section usually contains the page num!er and any other in"ormation youwant to appear on the !ottom o" each page.

    Another area o" the Crystal Reports Desi%nta! is the Field E-"lorer. The Field E-"lorer, as the

    name implies, contains the "ields that can !e included in a report.

    -B. Clic' next to to display the ta!les "rom your data source.

    -. Clic' next to to display the "ields in this ta!le.

    -D. Repeat this process "or each ta!le in your data source.

    Inserting fields into a report>ou include a "ield in your report !y dragging the "ield to the section o" the report where it is to appear.

    Sometimes it is di""icult to remem!er the particular "ield you re(uire especially when there are many

    "ields. Crystal Reports provides the opportunity to !rowse the data "or a "ield in the Field E-"lorer.

    /. Right Clic' Material in the Materialta!le to display the context menu.

    -. Clic' 0ro4se D!t!111

    A dialog !ox appears with the data "rom this "ield.

    . Clic' to close the dialog !ox.

    Paul +aw'ing -/ une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    11/24

    9. *rag into the "ar le"t o" the Det!ilssection to include this "ield in the report.

    8otice as you drag the "ield an o!5ect "rame appears to indicate the "ield3s location.

    The Material"ield appears in the report. Also notice that a tic' appears ad5acent to this "ield in the

    Field E-"lorer.

    8otice that Materialappears in the P!%e He!derand Det!ilssections. The Materialin the P!%eHe!dersection is the heading o" the column which contains the values "or the Materials in the Det!ilssection. As you would have noticed previously that the

  • 7/26/2019 04 - Reporting With Crystal Reports

    12/24

    >our report appears on screen.

    8otice that the Previe4ta! now appears on screen.

    I" you examine your report closely you will notice that some ou can easily re#size "ields in the Desi%nta! !y

    clic'ing the re(uired "ield to display the handles and then drag the handles to increase or reduce thesize o" the "ield. This can !e applied separately to the "ield in the *etails section or in com!inationwith the P!%e He!der"ield. >ou can use the 2CTRL3clic6techni(ue to select more than one "ield tore#size.

    . Clic' to display the Desi%nview.

    B. Clic' Material Description in the Det!ilssection to select it.

    . *rag the right handle to increase the "ield size !y approximately cm.

    D. Clic' to view the changes to your report.

    8otice that the Material Description "ield has !een re#sized and the "irst row and the "ield have !eenselected.

    Paul +aw'ing - une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    13/24

    9/. Clic' a white area o" your report to de#select the "ield and record.

    >ou should now save your report !e"ore continuing.

    9-. Clic' to display the S!vedialog screen.

    9. Type G0I Re"ort( 2our n!$e3in the 4ile name? text "ield.

    99. 8avigate to the M Docu$ents"older.

    9;. Clic' to complete the process.

    8otice that the "ile name appears on the report ta! and the Title ,!r1

    Changing the order of fields>ou have included two "ields 1Material and Material Description2 in your report. >ou can use the dragand drop "unctionality to include additional "ields in your report. Ass you design the report you may"ind that "ields are not in the correct placement. >ou can easily change location o" a "ield through dragand drop "unctionality.

  • 7/26/2019 04 - Reporting With Crystal Reports

    14/24

    9D. *rag the mouse around the "ields to select all o" them.

    ;/. Press le"t arrow 'ey 12 on the 'ey!oard until the "ields have !een moved to the le"t o" thereport.

    ;-. Clic' to save the report.

    ;. Clic' to view the changes to your report.

    Combining fields

  • 7/26/2019 04 - Reporting With Crystal Reports

    15/24

    If the Tet ob!ectappears in the wrong location select and delete it, then repeat the process.

    >ou now need to de"ine the contents o" the Te-t o,7ect.

    ;. *ou!le clic' the inside the Te-t o,7ectto select it "or editing.

    ;B. *rag "rom the Field E-"lorerinto the Te-t o,7ect.

    7hen you release your mouse the "ield appears in the Te-t o,7ect.

    The re(uire "ormat "or the "ield is Material Description1Material2.

    ;. Press 2SPACE3to insert a space.

    ;D. Type 8

    =/. *rag into the Te-t o,7ecta"ter 8.

    =-. Type 9

    The Te-t o,7ectappears as "ollows.

    =. Clic' to save the report.

    =9. Clic' to view the changes to your report.

    Paul +aw'ing -= une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    16/24

    8otice that the Material Descriptionand Materialare now com!ined in the one "ield.

    =;. Re#size the Te-t o,7ecti" re(uired to include all data.

    ==. Clic' to display the Desi%nview i" not already on this screen.

    =. Insert a Te-t o,7ectin the P!%e He!dersection a!ove the existing Te-t o,7ect.

    =B. Type Productsin the Te-t o,7ect.

    =. Clic' to view the changes to your report.

    =D. Clic' to save the report.

    Removing fieldsAs you have com!ined the Material Descriptionand Material"ields in the Te-t o,7ectthere is no pointduplicating these on the report. >ou can also easily remove "ields "rom your report !y selecting the"ield and the pressing 2DELETE3.

    /. Clic' to display the Desi%nview.

    -. *elete Material Descriptionand Material"ields "rom the Det!ils section

    8otice that the corresponding "ields in the P!%e He!derare also removed.

    .

  • 7/26/2019 04 - Reporting With Crystal Reports

    17/24

    ;. Clic' to save the report.

    Sorting the data

    To ma'e the report easier to navigate the data should !e sorted. The on the E-"erts tool,!rdisplays the Record Sort E-"ertto assist with the sorting process. >ou have decided to sort theMaterial Descriptionalpha!etically.

    =. Clic' to display the Desi%nview.

    . Clic' on the E-"erts tool,!r.

    The Record Sort E-"ert appears on screen.

    8otice that all the ta!les and "ields "rom the data source are listed as well as the "ields containedwithin the report.

    B. Clic' to select this "ield.

    Paul +aw'ing -B une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    18/24

    . Clic' to move the selected "ield to the sort criteria.

    D. Clic' to apply the sort criteria to your report.

    B/. Clic' to view the changes to your report.

    The products are now sorted !y Material Description.

    B-. Clic' to save the report.

    "rouping dataThe Materialsin 0I are categorised !y Material Group1Accessories and icycles2 and then !yProduct ategor!1Accessories E ProtectiveF6tilitiesG icycles E $"" RoadFTouring2. The report would!e more meaning"ul i" the Materialswere %rou"ed!y Material Groupand Product ategor!.

    >ou can insert a grouping your report !y using the Grou" E-"erticon on the E-"ert tool,!r. >oucan add a %rou"in%either in Desi%nor Previe4mode.

    B. Clic' on E-"ert tool,!rto display the Grou" E-"ertdialog screen.

    8otice that all the ta!les and "ields "rom the data source are listed as well as the "ields containedwithin the report.

    B9. Clic' next to to display the "ields o" this ta!le.

    B;. Clic' to select the "ield.

    B=. Clic' to move the selected "ield to the Grou" 0.criteria.

    B. Repeat the process "or Product ategor! Description"rom the Product_ategor!ta!le.

    >our screen appears as "ollows?

    Paul +aw'ing - une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    19/24

    BB. Clic' to apply the %rou"in%criteria to your report.

    The products are now grouped !y Material Group andProduct ategor!

    B. Clic' to save the report.

    The grouping o" "ields creates new sections 10roup +eader and 0roup 4ooter2 "or each grouping inyour report.

    BD. Clic' to display the Desi%nta! and view the new sections.

    Paul +aw'ing -D une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    20/24

  • 7/26/2019 04 - Reporting With Crystal Reports

    21/24

    /. Select the Filemenu then the Su$$!r In:ocommand.

    The Docu$ent Pro"ertiesdialog !ox appears on screen.

    -. Type the "ollowing in"ormation?

    . Clic' to complete the process.

    $ormatting a reportCurrently your report has limited "ormatting. The column headings are inconsistent, there is no reporttitle, Standard Price is not "ormatted as currency and management would li'e the 0I logo includedon the report. )ach o" these components can !e "ormatted to improve their appearance.

    %dding a titleThe Products Price :ist report needs a Title to descri!e the contents o" the report. >ou can add a titleto your report using a Te-t o,7ector !y inserting the in"ormation directly "rom the Docu$entPro"erties. >ou will use the in"ormation "rom the Docu$ent Pro"ertiesthrough the inclusion o" a

    Re"ort Title"ield "rom the S"eci!l Fieldsin the Field E-"lorer.

    9. Clic' to display the Desi%nview.

    ;. Clic' next to in the Field E-"loreto display the "ields.

    =. *rag to the Re"ort He!dersection o" the report.

    . Clic' to view the changes to your report.

    The report title appears on the report.

    >ou can now "ormat the report title.

    Paul +aw'ing - une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    22/24

    B. Right clic' G0I Product Price Listto display the context menu.

    . Select For$!t Te-tto display the For$!t Editordialog screen.

    D. Change the Fontto size ; and colour !lue.

    D/. Clic' to apply the changes.

    $ormatting $ields

    D-. 4ormat Productsto include underline.

    >ou will notice that the column headings are not horizontally aligned.

    D. Clic' Productsheading to select it.

    D9. Press 2CTRL3and right clic' Standard Priceto display the context menu.

    D;. Select Ali%nthen 0otto$sto align the headings.

    7hen you apply "ormatting to a "ield in a section the "ormatting applies to all "ields in that section.

    D=. Right clic' Accessories to display the context menu.

    D. Select For$!t :ieldto display the For$!t Editordialog screen.

    DB. Clic' 0order.

    D. Clic' Dro" Sh!do4to select this option.

    DD. Clic' to apply the changes.

    >ou now need to "ormat the Standard Priceto display currency.

    -//. Right clic' any o" the Standard Pricevalues to display the context menu.

    -/-. Select 4ormat 4iled.

    The For$!t Editordialog screen appears with various num!er "ormats displayed.

    -/. Clic' to select this option.

    -/9. Clic' to apply the changes.

    Inserting a graphic

    >ou can insert graphics in your report using the Insert Pictureicon on the Insert tool,!r. >oucan insert a graphic in either the Desi%nor Previe4ta!.

    -/;. Clic' on the Insert tool,!r.

    The O"endialog !ox appears.

    Paul +aw'ing une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    23/24

    -/=. $pen G0I1,$"1C?@0I.!mp2.

    An outline o" the graphic appears.

    -/. *rag the graphic to the right o" the Re"ort He!dersection.

    The 0I logo appears a"ter the mouse is released.

    -/B. Clic' to save the report.

    >our report appears similar to the management3s re(uirements.

    Paul +aw'ing 9 une /-

  • 7/26/2019 04 - Reporting With Crystal Reports

    24/24

    Test ;our S6ills

    Create another report

    >ou have now completed the tutorial on Crystal Reports. This tutorial was designed to provide an

    introduction to this reporting tool and provide the "undamental s'ills to !uild reports. The next tutorial willcover the incorporation o" calculations and charts within a report.

    ResourcesThere are many resources availa!le on the internet that can "urther enhance your s'ills. A good place tostart is at the SAP developer 8etwor'.

    SAP Crst!l Re"orts !t SDN

    http?FFwww.sdn.sap.comFir5F!ocFcrystalreports

    SAP Crst!l Re"orts Online Tutori!ls1http://www.sdn.sap.com/irj/scn/crystal-reports-elearning?refer=marketing

    http://www.sdn.sap.com/irj/scn/crystal-reports-enterprise-elearning?refer=main

    http://www.sdn.sap.com/irj/boc/crystalreportshttp://www.sdn.sap.com/irj/scn/crystal-reports-elearning?refer=marketinghttp://www.sdn.sap.com/irj/scn/crystal-reports-enterprise-elearning?refer=mainhttp://www.sdn.sap.com/irj/scn/crystal-reports-elearning?refer=marketinghttp://www.sdn.sap.com/irj/scn/crystal-reports-enterprise-elearning?refer=mainhttp://www.sdn.sap.com/irj/boc/crystalreports