Using SAP Crystal Reports with SAP Sybase SQL Anywhere



Similar documents
Set Up Hortonworks Hadoop with SQL Anywhere

SAP BW on HANA & HANA Smart Data Access Setup

How-to guide: Monitoring of standalone Hosts. This guide explains how you can enable monitoring for standalone hosts in SAP Solution Manager

Extend the SAP FIORI app HCM Timesheet Approval

SAP BusinessObjects Business Intelligence 4 Innovation and Implementation

SAP PartnerEdge Program: Opportunities for SAP-Authorized Resellers

Creating a Fiori Starter Application for sales order tracking

Sybase ASE Linux Installation Guide Installation and getting started guide for SAP Sybase ASE on Linux

SAP Landscape Transformation (SLT) Replication Server User Guide

How to Extend a Fiori Application: Purchase Order Approval

Consumption of OData Services of Open Items Analytics Dashboard using SAP Predictive Analysis

Open Items Analytics Dashboard System Configuration

How to Implement a SAP HANA Database Procedure and consume it from an ABAP Program Step-by-Step Tutorial

Agentry and SMP Metadata Performance Testing Guidelines for executing performance testing with Agentry and SAP Mobile Platform Metadata based

LVS Troubleshooting Common issues and solutions

Memory Management simplifications in ABAP Kernel 7.4*

Create and run apps on HANA Cloud in SAP Web IDE

Configuring Java IDoc Adapter (IDoc_AAE) in Process Integration. : SAP Labs India Pvt.Ltd

Using Database Performance Warehouse to Monitor Microsoft SQL Server Report Content

SAP Sybase Adaptive Server Enterprise Shrinking a Database for Storage Optimization 2013

Setting up Single Sign-On (SSO) with SAP HANA and SAP BusinessObjects XI 4.0

Compare & Adjust How to Guide for Compare & Adjust in SAP Solution Manager Application Lifecycle Management

SAP CRM Service Manager 3.1 Mobile App Extended Feature List An extended list of all the features included in the default delivery of the SAP CRM

Nine Reasons Why SAP Rapid Deployment Solutions Can Make Your Life Easier Get Where You Want to Be, One Step at a Time

SAP BUSINESS PLANNING AND CONSOLIDATION 10.0, VERSION FOR SAP NETWEAVER, POWERED BY SAP HANA STARTER KIT FOR USGAAP

LHI Leasing Simplifying and Automating the IT Landscape with SAP Software. SAP Customer Success Story Financial Services Provider LHI Leasing

BW Source System: Troubleshooting Guide

How To Use Sap Business Objects For Microsoft (For Microsoft) For Microsoft (For Pax) For Pax (For Sap) For Spera) For A Business Intelligence (Bio) Solution

Training.sap.com User Guide

Installing and Configuring the HANA Cloud Connector for On-premise OData Access

SAP BusinessObjects Dashboarding Strategy and Statement of Direction

Setting up Single Sign-On (SSO) with SAP HANA and SAP BusinessObjects XI 4.0

SAP BusinessObjects Edge BI, Standard Package Preferred Business Intelligence Choice for Growing Companies

Active Quality Management

Information Design Tool User Guide SAP BusinessObjects Business Intelligence platform 4.0 Feature Pack 3

What's New in SAP BusinessObjects XI 3.1 Service Pack 5

How To... Master Data Governance for Material: Create Custom Print forms. Applicable Releases: MDG 7

Cloud Single Sign-On and On-Premise Identity Federation with SAP NetWeaver Cloud White Paper

SAP Solution Manager - Content Transfer This document provides information on architectural and design questions, such as which SAP Solution Manager

Design Thinking for. Requirements Analysis

Streamlined Planning and Consolidation for Finance Teams in Any Organization

BusinessObjects Enterprise InfoView User's Guide

How To... Master Data Governance for Material: Maintenance for multiple Materials in one Change Request. Applicable Releases: all

SAP Security Recommendations December Secure Software Development at SAP Embedding Security in the Product Innovation Lifecycle Version 1.

SAP Thought Leadership Paper Engineering, Construction, and Operations. Beyond Enterprise Resource Planning Construction in the ipad Age

SAP White Paper Enterprise Information Management

Certification Guide Network Connectivity for SAP on Premise and Cloud Solutions Integration

SAP Business One OnDemand. SAP Business One OnDemand Solution Overview

HANA Input Parameters with Multi-Values to Filter Calculation Views

How To Install The Sap Business Explorer 7.X 2.X (Sap) On A Windows 7.30 Computer (Windows 7)

BRIO QUERY FUNCTIONALITY IN COMPARISION TO CRYSTAL REPORTS

SAP BusinessObjects Web Intelligence Users Guide SAP BusinessObjects Business Intelligence Suite 4.0 Feature Pack 3

Developing Own Crystal Reports

ForFarmers: SAP Business Communications Management for Call Center Workload Distribution

Five Strategies Small and Medium Enterprises Can Use to Successfully Implement High Value Business Mobility

SAP PartnerEdge Program Guide for Language Services Partners

SAP BusinessObjects Edge BI, Preferred Business Intelligence. SAP BusinessObjects Portfolio SAP Solutions for Small Businesses and Midsize Companies

Additional Guide to Implementing the SAP CRM Service Management rapiddeployment

How to... Master Data Governance for Material: Use the Data Import Framework for Material. Applicable Releases: EhP6, MDG 6.1, MDG 7.

Create Mobile, Compelling Dashboards with Trusted Business Warehouse Data

Document and Data Retention Compliance Understanding and Addressing the Costs, Risks, and Legal Pitfalls

SAP HANA. SAP HANA Performance Efficient Speed and Scale-Out for Real-Time Business Intelligence

Setting up the Environment for Creating or Extending SAP Fiori Apps

Ignite Your Creative Ideas with Fast and Engaging Data Discovery

K in Identify the differences between the universe design tool and the information design tool

Installation Guide: Agentry Device Clients SAP Mobile Platform 2.3

Data Governance. Data Governance, Data Architecture, and Metadata Essentials Enabling Data Reuse Across the Enterprise

Implementing an Enterprise Information Management Strategy An Approach That Mitigates Risk and Drives Down Costs

SAP Crystal Solutions. What s New in SAP Crystal Dashboard Design Create Superior Data Visualizations Faster with New Features

2. Building Cross-Tabs in Your Reports Create a Cross-Tab Create a Specified Group Order Filter Cross-Tab by Group Keep Groups Together

Secure MobiLink Synchronization using Microsoft IIS and the MobiLink Redirector

Within Budget and on Time

Guide to the SAP Extended Business Program

Quick Start SAP Sybase IQ 16.0

SAP BusinessObjects Query as a Web Service Designer SAP BusinessObjects Business Intelligence platform 4.0

SAP Work Manager 6.0 Mobile App Extended Feature List

How To Create A Powerpoint Intelligence Report In A Pivot Table In A Powerpoints.Com

Ohio University Computer Services Center August, 2002 Crystal Reports Introduction Quick Reference Guide

Performing On-Report Analysis with SAP BusinessObjects Web Intelligence

Release Document Version: User Guide: SAP BusinessObjects Analysis, edition for Microsoft Office

InfoView User s Guide. BusinessObjects Enterprise XI Release 2

Creating Custom Crystal Reports Tutorial

CHAPTER 6: ANALYZE MICROSOFT DYNAMICS NAV 5.0 DATA IN MICROSOFT EXCEL

Computer Training Centre University College Cork. Excel 2013 Pivot Tables

Backup Strategy for Oracle

How-To Guide SAP Cloud for Customer Document Version: How to Configure SAP HCI basic authentication for SAP Cloud for Customer

AC200. Basics of Customizing for Financial Accounting: General Ledger, Accounts Receivable, Accounts Payable COURSE OUTLINE

Quick Guide to the SAP Customer Relationship Management Rapid- Deployment Solution (based on EhP1) Demo/Evaluation Appliance

Complementary Demo Guide

Empower Individuals and Teams with Agile Data Visualizations in the Cloud

Business Objects Version 5 : Introduction

Crystal Reports Server Embedded 2008 with Service Pack 7 for Windows Supported Platforms

Excel Database Management Microsoft Excel 2003

How To Use the ESR Eclipse Tool with the Enterprise Service Repository

Decision Support AITS University Administration. Web Intelligence Rich Client 4.1 User Guide

SAP Briefing Brochure. Solutions. October 2010

Oracle Fusion Middleware

Made to Fit Your Needs. SAP Solution Overview SAP Solutions for Small Businesses and Midsize Companies

Sample- for evaluation purposes only. Advanced Crystal Reports. TeachUcomp, Inc.

SAP BusinessObjects Edge BI, Preferred Business Intelligence. SAP Solutions for Small Business and Midsize Companies

Transcription:

Using SAP Crystal Reports with SAP Sybase SQL Anywhere

TABLE OF CONTENTS INTRODUCTION... 3 REQUIREMENTS... 3 CONNECTING TO SQL ANYWHERE WITH CRYSTAL REPORTS... 4 CREATING A SIMPLE REPORT... 7 Adding Data to Crystal Reports... 7 Formatting Records in Crystal Reports... 8 Displaying Records on a Map in Crystal Reports... 9 ADDING DATA TO CRYSTAL REPORTS USING A SQL QUERY... 10 Inserting a Chart Displaying Queried Data...15 CREATING A SALES REPORT... 18 Selecting the Data for the Report...18 Inserting a Bar Chart Showing Yearly Sales...20 Creating a Cross Table Showing Sales of Products Based on Different Regions...21 Creating a Pie Chart Showing Overall Sales of the Products...22 UPDATING CRYSTAL REPORTS DATA WHEN THE DATA IN DATABASE CHANGES... 24 CONCLUSION... 25 2

INTRODUCTION This document describes how to display data stored in an SAP Sybase SQL Anywhere database using SAP Crystal Reports. The document shows how to create a simple report that displays selected data from a table and an advanced report showing how to add data in the report using SQL queries. The document also shows how to format the data inside charts and maps, which can be used to graphically enhance the report. For the remainder of this document, SAP Sybase SQL Anywhere is referred to as SQL Anywhere and SAP Crystal Reports is referred to as Crystal Reports. This paper was written using SQL Anywhere 12.0.1 and Crystal Reports 2011; however, its contents are applicable to other versions. REQUIREMENTS This document assumes that the user is familiar with SQL Anywhere and Crystal Reports and has both products installed on his/her environment. For consistency and simplicity, all the examples throughout the document use the SQL Anywhere sample database, demo.db. By default, this database is installed in the SQL Anywhere samples directory: C:\Documents and Settings\All Users\Documents\SQL Anywhere 12\Samples. Evaluation copies of SQL Anywhere and Crystal Reports can be downloaded from these locations: SAP Sybase SQL Anywhere http://scn.sap.com/docs/doc-31795 SAP Crystal Reports http://www.sap.com/solutions/sme/business-intelligence-crystal-solutions/sap-crystal-reports/index.epx 3

CONNECTING TO SQL ANYWHERE WITH CRYSTAL REPORTS 1. Launch Crystal Reports. Start Programs Crystal Reports 2011 Crystal Reports 2011. The following screen appears. Figure 1: Startup screen 2. Click Report Wizard. The Standard Report Creation Wizard screen appears. Figure 2: Standard Report Creation Wizard Crystal Reports asks for the type of database connection to create. Double-click on ODBC (RDO). Select the ODBC Data Source Name SQL Anywhere 12 Demo and click Next. 4

3. Enter the database credentials and click Finish to add the connection. For the demo.db database, use the following credentials. User ID: dba Password: sql Figure 3: ODBC connection 4. Crystal Reports shows the database connection under My Connections. Figure 4: SQL Anywhere connection with Crystal Reports 5

5. We are connected to the database. We can now select tables and include them in our report. Click Finish to start creating a Crystal Report using data stored inside the SQL Anywhere database. 6

CREATING A SIMPLE REPORT This section describes how to create a simple report displaying data from the Contacts table of the sample SQL Anywhere database. Adding Data to Crystal Reports 1. Click File New Standard Report to open the Standard Report Creation Wizard. 2. Expand SQL Anywhere 12 Demo and double-click the Contacts Table from GROUPO Tables. Click Next. Figure 5: Selecting data from the SQL Anywhere database 3. The Wizard asks to choose the information to display on the report. Select GivenName, Surname, State and Country. Click Finish. 7

Figure 6: Selecting fields to display in the report 4. Crystal Reports displays GivenName, Surname, State and Country columns from the Contacts table. We saw how to add data to Crystal Reports, now let s format our report by grouping Contacts based on Country and State. Formatting Records in Crystal Reports This section describes how to group contacts based on Country and State. 1. Open Group Expert. Click on Report Group Expert. 2. Select Group by Contacts.Country and Contacts.State and click OK. Figure 7: Group Expert 3. Crystal Report groups the data based on Country and States. 8

Figure 8: Simple Crystal Report Displaying Records on a Map in Crystal Reports Crystal Reports provides a tool called Map Expert that will allow you to set the type of map, data and other options to help you render a map in the report. 1. To insert a map, click on Insert Map. 2. In the Data tab, select State in the Geographic field and On change of fields. Select State in the Map values field. Click OK. Figure 9: Map Expert 3. Crystal Reports adds the map showing contacts in different states to the header of the report. 9

Figure 10: Crystal Report with Map Moving the mouse pointer over the states in the map shows the sum of the contacts in that particular state. ADDING DATA TO CRYSTAL REPORTS USING A SQL QUERY This section describes how to add data by querying the database. In Crystal Reports, this can be done by adding a command using Database Expert. We will create an Expenses and Revenues report of different years using data from the FinancialCodes and FinancialData tables. 1. Open the Standard Report Creation Wizard to create report. 2. Expand SQL Anywhere 12 Demo under My connections from the available data sources. 10

Figure 11: Adding command to Crystal Report 3. Double-click on Add Command and enter following SQL query: Select GROUPO.FinancialData.Year, GROUPO.FinancialData.Quarter as Quarter, GROUPO.FinancialData.Amount, (GROUPO.FinancialCodes.Type + ' - '+ GROUPO.FinancialCodes.Description) as Description FROM FinancialData Inner Join FinancialCodes ON GROUPO.FinancialData.Code = GROUPO.FinancialCodes.Code where GROUPO.FinancialData.Year = {?year_sales}; 11

Figure 12: Adding a command SQL query Here we are selecting Year, Quarter, and Amount from the FinancialData table, and Type, Description from the FinancialCodes table. At the end of our query we have a WHERE clause with the parameter year_sales, filtering the data based on the year. 4. To create our year_sales parameter, click on the Create button in the Parameter List section. Enter year_sales and Enter the year in the Parameter Name and Prompting Text fields respectively. Choose the Value Type of the parameter, select String for year_sales and click OK. 12

Figure 13: Adding parameters to the command Now we can see the year_sales parameter added in the Parameter List. Figure 14: Command parameter added in Parameter List 5. Click OK to add the command to the report. Crystal Reports asks you to enter the parameter values with our prompt text Enter the year. Enter 2000 and then click OK to enter the parameter value. 13

Figure 15: Entering command parameter values 6. Now we can see our Command added in Selected Tables. Click Next. Figure 16: Command Added to Report 7. Choose Description, Amount as the fields to Display and click Finish to create the report. Group the report by Quarter. Refer to section Formatting Records in Crystal Reports above for more information on how to group records. Crystal Reports generates the report showing year 2000 data grouped by each quarter. 14

Figure 17: Crystal Report Generated Using Command Data Now let s insert a chart in the footer of our report to graphically display the expenses and revenues data. Inserting a Chart Displaying Queried Data 1. Click Insert Chart to insert a chart in report. This opens up Chart Expert. 2. Select the type of chart from the Type tab. We will select a Line chart. 15

Figure 18: Chart Expert line graph 3. From the Data tab, select Advanced as Layout. In the Data section, choose Quarter and Description in On change of field and select Amount in the Show value field. Figure 19: Selecting line graph data 16

4. From the Text tab, change the Title to Expenses and Revenues, Group title to Quarter and Data title to Total Amount. Click OK to create a line graph. Figure 20: Chart Expert titles 5. Right-click the chart and select Chart Options to change the appearance of the chart. From the Appearance tab, select Markers and Lines in Line Style and X-shape as Shape respectively. Figure 21: Chart Options Appearance tab 17

Figure 22: Crystal Reports generated line chart We have a line graph displaying the expenses and revenues for the year. Crystal Reports provides an easy way to display the report graphically using a variety of charts. CREATING A SALES REPORT In this section we are going to create a sales report with a bar chart showing yearly sales of the products, a pie chart showing overall sales of products, and a cross table showing sales of products based on different regions. Selecting the Data for the Report Select the Products, SalesOrders, and SalesOrderItems tables and create a report. Now we want to show yearly sales of the products, but we do not have any data column in the database specifying the year of the sales. We can get the year from the ShipDate field in the SalesOrders table. To do this we need to create a getyear formula that extracts the year from ShipDate. Creating Formulas 1. To add formulas, right-click on Formula Fields from the Field Explorer and select New. Enter the Formula name as getyear. This opens up the Formula Editor. 18

Figure 23: Formula Editor 2. Expand Date and Time Functions under Functions and select the Year(x) function. Select ShipDate from the SalesOrderItems as function parameter. To remove the decimal places from the year, convert year to text by passing it to the Totext function with 0 decimal places. Save the formula and close it. Figure 24: Formula to Get Year From ShipDate Now we have the year data in our report. Let s insert a bar chart showing yearly sales of the products. 19

Inserting a Bar Chart Showing Yearly Sales Figure 25: Creating a bar chart Crystal Reports generates the bar chart showing yearly sales of products. Figure 26: Crystal Reports Generated Bar Chart 20

Creating a Cross Table Showing Sales of Products Based on Different Regions 1. Group the report by Products.Name. 2. Switch to the design view of the report and insert a cross table (Insert Cross Tab) in the group header. 3. Open the Cross-Tab expert (right click Cross Tab Cross - Tab Expert). 4. In the Cross-Tab tab, add the data to display. 5. We will display Region as the column, Product.Name as the rows and SalesOrderItems.Quantity in summarized fields. As we have only one row, check Suppress Column Grand Totals and click OK. From the Styles tab, you can change the display of the cross-tab. Click OK to create a cross table showing sales of products in different regions. Figure 27: Cross- Tab Expert 21

6. Now let s add a products photo besides the product s cross table. The generated report so far looks as the following: Figure 28: Report with Cross Table Creating a Pie Chart Showing Overall Sales of the Products 1. To conclude the report, let s add a pie chart showing the overall sales in the report footer. 2. Choose Pie Chart from the Type tab of Chart Expert and check Use depth effect. 22

3. In the Data tab, select the data to be displayed. Select Products.Name in the On change of field and Products.Quantitly in the Show values field. Figure 29: Creating a Pie Chart 4. Click OK to create the chart. Crystal Reports generates the following chart at the end of the report: Figure 30: Crystal Report generated pie chart 23

UPDATING CRYSTAL REPORTS DATA WHEN THE DATA IN DATABASE CHANGES When data in the database changes, Crystal Reports can easily refresh its data. Click Report Refresh Report Data (F5). Click OK to the prompt. This will keep the report up to date. When the report is refreshed, Crystal Reports starts the database server locally and retrieves the most recent data. 24

CONCLUSION SQL Anywhere data can easily be displayed using Crystal Reports. Crystal Reports provides a compelling tool to perform analysis and helps to visualize data through the use of charts, graphs and what-if scenarios. Combining SQL Anywhere and Crystal Reports allows developers to create powerful database-driven applications that incorporate a world-class reporting engine. 25

www.sap.com 2012 SAP AG. All rights reserved. SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer, StreamWork, SAP HANA, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects Software Ltd. Business Objects is an SAP company. Sybase and Adaptive Server, ianywhere, Sybase 365, SQL Anywhere, and other Sybase products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Sybase Inc. Sybase is an SAP company. Crossgate, m@gic EDDY, B2B 360, and B2B 360 Services are registered trademarks of Crossgate AG in Germany and other countries. Crossgate is an SAP company. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, 26 if any. Nothing herein should be construed as constituting an additional warranty..