Applies to:
SAP Business One versions 2007 and 8.8
Crystal Report Basic 2008 for SAP Business One SP1
Crystal Reports runtime 2008 SP1
Xcelsius
Summary
The following article demonstrates how to create a runtime Xcelsius dashboard based on SAP Business One
data. The following methods are demonstrated:
1. Using Crystal Report as a data source for the Xcelsius dashboard.
2. Using a Web service as a data source for the Xcelsius dashboard.
Author Bio
Joined SAP in 2003 as part of the IBD SDK infrastructure team. Starting in 2008, she
joined the SAP Business One Solution Architects team, which assists partners with any
technical challenge they face in developing and implementing their solution
Table of Contents
Introduction ......................................................................................................................................................... 3
1. Introduction to Xcelsius ............................................................................................................................... 3
2. SAP Business One and Crystal Reports..................................................................................................... 4
3. Xcelsius ....................................................................................................................................................... 4
3.1 How to Obtain Xcelsius .......................................................................................................................................... 4
3.2 SAP Business One Data and Xcelsius ................................................................................................................... 4
Creating Xcelsius Dashboard using Crystal Report ........................................................................................... 5
Step 1 – Generate a Crystal Report................................................................................................................ 6
Step 2 - Design Xcelsius dashboard and export it to a flash file..................................................................... 6
Step 3 – Embed the flash file into the Crystal report ...................................................................................... 8
Creating Xcelsius Dashboard Using a Web Service .......................................................................................... 9
Step 1 – Generate a Web Service for querying the DB ................................................................................ 10
Step 2 – Import the Web Service to Xcelsius................................................................................................ 13
Step 3 – Design Xcelsius Dashboard ........................................................................................................... 16
Appendix 1 – Use .Net object to connect and run query on the DB ................................................................. 22
Appendix 2 – Service.cs file content ................................................................................................................. 23
Related Content ................................................................................................................................................ 25
Copyright........................................................................................................................................................... 26
Introduction
1. Introduction to Xcelsius
Just like a pilot gets lots of information in one glance of the airplane’s dashboard, managers can
get lots of information in one glance of a well-designed dashboard.
Crystal Xcelsius is a data dashboard design tool that displays summary-level business data in a
visually rich and intuitive format that allows users to analyze and interact with their data in order to
make better business decisions.
Xcelsius has the ability to show data using gauges, charts, and other components, to generate interactive
flash files, and to generate “what if” scenarios – all of which are tremendous tools for decision-making.
3. Xcelsius
** The values in the fields are not important at this stage since the real values will be forward to
Xcelsius during runtime. We just need to define which excel cells are going to be used.
3. Summarize the total sales for all the sales persons.
4. Add a chart to your Xcelsius canvas area, for example: Pie chart. Fill the chart’s properties as
described below:
a. General Æ Titles Æ chart: ‘Annual Gross Profit Analysis By Sales Person”
b. General Æ Data Æ Values: Select the Gross Profit values (In this example it should be:
Sheet1!$B$2:$B$8)
c. General Æ Data Æ Lables: Select the Sales Person Names (In this example it should be:
Sheet1!$A$2:$A$8)
5. Add a gauge to the Xcelsius canvas area. Fill the gauge’s properties:
a. General Æ Title: “Total Gross Profit”
b. General Æ Data: select the cell with the Total gross profit value (In this example it should be:
Sheet1!$B$9)
c. General Æ Scale: Set the minimum and maximum limits (for example: 0, 3000000).
* Tip – In the “GrossProfitBySalesPersonAnalysis.xlf” file alerts are also demonstrated.
6. Add horizontal sliders for each one of the sales persons. (The horizontal sliders will be used for the
running the “what if” scenarios). Fill the horizontal slider properties:
a. General Æ Title: Choose the relevant cell for the title (for example - Sheet1!$A$2)
b. General Æ Data: Choose the relevant cell for the data (for example - Sheet1!$B$2)
c. General Æ Scale: Set the maximum (for example: 600000)
** repeat steps a & b for each one of the sales employees.
7. Define the range of cells that will hold the data from the crystal report:
a. In the upper menu click on “Data Æ Connection”
b. Click on “Add” and choose Æ “Crystal Report Data Consumer”
c. Row Headers: The data for this sample is saved in rows therefore select the relevant data
into the “Row Header” property. (In this example it should be: Sheet1!$A$2:$A$8)
d. Data: select the relevant cell that will hold the data into the “Data” property. (In this sample it
should be: Sheet1!$B$2:$B$8)
e. Click on close.
8. Export the Xcelsius dashboard into a flash:
a. In the upper menu click on File ÆSave.
b. In the upper menu click on File Æ Export Æ Flash (SWF)
4. Click on “Web Services In the local machine” (Please note: this option is relevant only if you have
the B1WS installed on your local machine! If you don’t have B1WS installed, you can also generate
the web service using .NET objects as shown in appendix 1).
5. Choose “Login service”, rename it and click on the “Add Reference” button.
6. Repeat steps 3-5 and add the “CompanyService” as well.
7. Open the “Service.cs” file (under AppCode folder).
8. Above the “HelloWorld” Web method add the following struct:
public struct QueryResult
{
public string ItemName;
public string Quantity;
public double GrossProfit;
public string ItemGroupName;
}
9. Rename the “HelloWorld” web method to “RunQuery”.
10. Change the Return value to “QueryResult”
11. Edit the “RunQuery” web method:
a. Remove the “return "Hello World";”
b. Add the code for login to your B1 DB, for example:
CmpService.MsgHeaderValue = CmpMsgHdr;
output, Therefore in this step we will parse the query result into a more simple data
type. We will transfer the data from the RecordSet into our “QueryResult” struct.
For example:
QueryResult[] QryRes = null;
QryRes = new QueryResult[RS_QryResult.Row.Length];
int i = 0;
while (i < RS_QryResult.Row.Length )
{
QryRes[i].ItemName = RS_QryResult.Row[i].Property[0].Value;
QryRes[i].Quantity = RS_QryResult.Row[i].Property[1].Value;
QryRes[i].GrossProfit = double.Parse(RS_QryResult.Row[i].Property[2].Value);
QryRes[i].ItemGroupName = RS_QryResult.Row[i].Property[3].Value;
i++;
}
Send the formatted data as a returned value:
return QryRes;
6. Now we need to tell Xcelsius, to which fields to copy the web service output. In order to do it we
need to fill the “Insert In” field for each one of the following output values:
a. ItemName
b. Quantity
c. GrossProfit
d. ItemGroupName
For example: ItemName field values will be saved in “Sheet1!$A$2:$A$16”
7. Click on the “Usage” tab and check the “Refresh On Load” checkbox. (Please note that you can
decide how frequent you want to refresh your data).
Click on the Preview button and you’ll see the result of your query:
2. Add a Bar chart: From the “Component” tool barÆ under charts Æ drag and drop a “Bar Chart”. Fill
the chart’s properties as described below:
a. General Æ Titles Æ chart: ‘Annual Sales Analysis By Item”
b. General Æ Titles Æ sub title: ”Gross Profit”
c. General Æ Data Æ Choose “By Series”, Click on the (+) to add new series.
d. Name the Series: “Item Gross Profit”
e. Value(X) – Choose the “Gross Profit” values (Sheet1!$C$2:$C$11)
f. Category Labels (Y) – Choose the Item Name values (Sheet1!$A$2:$A$11)
Tip: for a better visibility: go to appearance tab and reduce the “marker size” value.
The dashboard should look like this:
3. I’d like to show the gross profit distribution per item group. In order to do it, first we need to
summarize the gross profit per items group.
a. Add the following formula for each one of the items group:
“=SUMIF(D$2:D$11,F2,C$2:C$11)”
4. Add a Pie chart: From the “Component” tool barÆ under charts Æ drag and drop a “Pie Chart”. Fill
the chart’s properties as described below:
a. General Æ Titles Æ chart: ‘Annual Sales Analysis Per Item Groups”
b. General Æ Titles Æ sub title: ”Gross Profit”
c. General Æ Data Æ Values: Choose the values we’ve calculated on section a
(Sheet1!$G$2:$G$4).
d. General Æ Data Æ Labels: Choose the item groups names (Sheet1!$F$2:$F$4)
5. Add a Total Gauge: From the “component” tool bar Æ Under “single Value” Æ drag and drop a
“Gauge”. Fill the Gauge’s properties as described below:
a. In the Excel part of the Xcelsius designer - Summarize the gross profit column as shown
below:
6. Add a “What If” scenario: we’d like to show how a change in the Gross profit of one of the top 5
selling items will influence the total gross profit. In order to do it we will add 5 “Horizontal Sliders” that
will represent the gross profit for each one of the top selling 5 item.s User will be able to change the
value of each one of them and see how the total gross profit is affected.
a. From the “component” tool bar Æ Under “single Value” Æ drag and drop an “Horizontal
Slider”. Set the following properties:
i. General Æ Title: Should point to the cell that holds the Item Name of the relevant
item (for example: “Sheet1!$A$2”).
ii. General Æ Data: should point to the cell that holds the gross profit value of the
relevant item (for example: ” Sheet1!$C$2”).
iii. General Æ Data Æ Scale: Adjust the “Maximum Limit” value to fit your data (for
example: 350000).
iv. Repeat steps i-iii for each one of the top 5 selling items.
Tip: You can choose a “Theme” and design the Xcelsius dash board according to your taste and
needs. For example; I chose the “Elan” theme.
7. Click on the “Preview” button and see your dash board running. You can check the ‘what if’ scenario
by changing the values off the horizontal sliders and see how the values in the graphs and gauge
are changed accordingly.
Your Dash board is ready you can export it to power point, flash, PDF etc…
[WebMethod]
public QueryResult[] RunQuery()
{
// Open Connection - Query Data from DB table - Close connection
SqlConnection connection = new SqlConnection("Data Source=(local);Integrated
Security=SSPI;Initial Catalog=SBODemoUS");
SqlDataAdapter adapter = new SqlDataAdapter(
"SELECT SlpName, Commission FROM OSLP", connection);
DataTable DT_QryResult = new DataTable();
adapter.Fill(DT_QryResult);
connection.Close();
// Parse data to be forward to Xcelsius
QueryResult[] QryRes = null;
QryRes = new QueryResult[DT_QryResult.Rows.Count];
int i=0;
foreach (DataRow row in DT_QryResult.Rows)
{
QryRes[i].SlpName = row["SlpName"].ToString();
QryRes[i].Commission = row["commission"].ToString();
i++;
}
return QryRes;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
public Service () {
}
public struct QueryResult
{
public string ItemName;
public string Quantity;
public double GrossProfit;
public string ItemGroupName;
}
[WebMethod]
public QueryResult[] RunQuery()
{
/////////////// Connect to DB ////////////////
string SessionID = "";
LoginService.LoginService serviceLogin = new LoginService.LoginService();
SessionID = serviceLogin.Login("(Local)", "SBODemoUS",
LoginService.LoginDatabaseType.dst_MSSQL2005, true, "sa", "B1Admin", "manager",
"manager", LoginService.LoginLanguage.ln_English, true, "localhost:30000");
CmpService.MsgHeaderValue = CmpMsgHdr;
int i = 0;
Related Content
For more information about this topic:
1) Crystal Report Runtime blog - https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/14516
2) Xcelsius Landing Page -
https://service.sap.com/~form/sapnet?_SCENARIO=01100035870000000183&_SHORTKEY=01100
035870000711038&_OBJECT=011000358700000566202008E&_ADDINC=0110003587000011926
82007E&
Copyright
© Copyright 2009 SAP AG. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG.
The information contained herein may be changed without prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.
IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9,
iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server,
PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes,
BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX,
Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation.
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems
Incorporated in the United States and/or other countries.
Oracle is a registered trademark of Oracle Corporation.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of
Citrix Systems, Inc.
HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts
Institute of Technology.
Java is a registered trademark of Sun Microsystems, Inc.
JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by
Netscape.
SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, 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 S.A. in the United States and in other countries. Business Objects 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, if any. Nothing herein should be construed as constituting an
additional warranty.