Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius...

51
SAGE ACCPAC Sage Accpac ERP Dashboard Customization Toolkit User Guide

Transcript of Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius...

Page 1: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

SAGE ACCPAC

Sage Accpac ERP™

Dashboard Customization Toolkit User Guide

Page 2: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

©2008 Sage Software, Inc. All rights reserved. Sage Software, Sage Software logos, and all Sage Accpac product and service names are registered trademarks or trademarks of Sage Software, Inc., or its affiliated entities. All other trademarks are the property of their respective owners. Sage Software, Inc. Publisher No part of this documentation may be copied, photocopied, reproduced, translated, microfilmed, or otherwise duplicated on any medium without written consent of Sage Software, Inc. Use of the software programs described herein and this documentation is subject to the Sage Software License Agreement enclosed in the software package.

Page 3: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

User Guide i

Contents

Dashboard Toolkit Overview Resources Needed ............................................................................ 2 How the Accpac Dashboard Works ........................................................... 3 Designing Data Presentations Using Xcelsius................................................. 4

Step 1: Decide on the Dashboard Components .......................................... 5 Step 2: Create the Excel Model .......................................................... 5 Step 3: Create the Xcelsius Visual Model ................................................ 6 Step 4: Export the Xcelsius Model to a Flash File ........................................ 6 Step 5: Add the Flash file to a Dashboard Web Page .................................... 6

Connecting Visualizations to Accpac Databases .............................................. 7 Tutorials for Creating Visualizations and Connecting to Accpac Databases ............... 8

Dashboard Tutorials Creating a Simple Query-based Visualization................................................. 9

Create the Excel Spreadsheet ............................................................ 9 Select a Chart and Link to Spreadsheet Data............................................14 Add the Data Connection ................................................................16

Examples of Complex Queries ...............................................................19 One Large Query vs. Six Small Queries..................................................21

Adding a New Menu Item to the Dashboard.................................................23 Creating a View-based Visualization.........................................................26

Create XLF in Xcelsius and Export to SWF ...............................................26 Create the ASP.Net Pages in Visual Studio ..............................................30

Publishing the Dashboard....................................................................35 Applying the Sage Accpac Color Scheme ....................................................37

Dashboard Developer’s Reference Query-based References.....................................................................39

SQL Query Hints .........................................................................39 SQL Query Marker .......................................................................39

Special characters....................................................................41 Sample query with markers and hints ...................................................42

View-based References ......................................................................43 Folders and Files in the Accpac Dashboard Solution.........................................44

Page 4: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

ii Dashboard Customization Toolkit

Accpac Dashboard Folders............................................................... 44 AP folder for the Accounts Payable Dashboard ...................................... 44 App_Browsers folder................................................................. 44 App_Data folder ..................................................................... 44 App_Global_Resources folder........................................................ 44 App_Themes folder .................................................................. 45 AR folder for the Accounts Receivable Dashboard ................................... 45 Bin folder ............................................................................ 45 CSS folder ........................................................................... 45 Images folder........................................................................ 45 JavaScript folder..................................................................... 45 OE folder for the Sales Analysis Dashboard ......................................... 45 Schema folder ....................................................................... 45

Accpac Dashboard Files ................................................................. 46 Default.aspx ......................................................................... 46 Login.aspx ........................................................................... 46 Site.master and SiteSignon.master ................................................. 46 web.config ........................................................................... 46 web.sitemap ......................................................................... 46 Query.aspx .......................................................................... 46

SWFObject Parameters...................................................................... 46

Page 5: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

User Guide 1

Tu

toria

ls

Dashboard Toolkit Overview

The Sage Accpac Dashboard is a web application that provides a browser-based, graphical presentation of key financial data so Accpac users can easily monitor their company’s performance.

Sage Accpac ERP 5.5 ships with an initial set of three dashboard pages, which can be modified or added to by business partners or development partners who have the Dashboard Toolkit.

This customization toolkit includes:

• Xcelsius 2008 from Business Objects

• Xcelsius project files for currently shipped dashboard objects with source code for partners that want to modify existing dashboard objects. Other files include Xcelsius project examples that connect to generic and specialized aspx pages.

Root Folder

The default install location for the toolkit is C:\Program Files\Sage Software\Sage Accpac Dashboard Customization Toolkit.

Accpac.xml - Xcelsius custom color scheme for Sage Accpac Dashboard.

QueryBased subfolder - Sample XLFs/SWFs for query-based customization, sample to add a new menu item to dashboard web site.

ViewBased subfolder - Sample and source code (XLFs and VB.NET projects) for view-based customization, VB templates, and DashboardClassLibrary online help.

QueryBased Folder

TerritorySales.xlf (TerritorySales.swf) - Sample Xcelsius/SWF (Flash) file with a simple SQL query.

SalesHistory.xlf (SalesHistory.swf) - Sample Xcelsius/SWF file with multiple SQL queries.

SaleHistory2.xlf (SalesHistory2.swf) - Sample Xcelsius/SWF file with a complex SQL query.

QueryBasedContentPage.aspx - Sample web page to embed SWF files.

SampleSales subfolder - Sample files to add a new menu item (including new web page and SWFs) to the released Sage Accpac Dashboard web site. Only files that are changed or added are listed.

Page 6: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Resources Needed

2 Dashboard Customization Toolkit

ViewBased Folder

DashboardContentPage.zip - VB template for a web page to embed SWFs

DashboardQueryPage.zip - VB template for a web page to process SQL queries requested by SWFs

DashboardLibrary.chm - DashboardClassLibrary online help.

SourceCode subfolder - VB.NET project source code to produce Sage Accpac Dashboard and all Xcelsius source files for Sage Accpac Dashboard

SampleARStats subfolder - Sample VB.NET project code to add a new SWF ("AR Statistics") to the Sage Accpac Dashboard Accounts Receivables page, also contains the Xcelsius file (ARStatistics.xlf).

• The Dashboard Customization Toolkit User Guide (this document)

The User Guide (this manual) covers the following topics:

• How the dashboard works

• Detailed descriptions of dashboard components

• How to create a query-based visualization using Xcelsius

• How to create a view-based visualization using Microsoft Visual Studio and Xcelsius

• How to extend the Accpac Dashboard by adding new aspx pages that call DashboardClassLibrary.dll

Resources Needed In order to create a query-based visualization, you need to know how to create an Excel spreadsheet. Prior knowledge of Xcelsius will assist you greatly, as well as an understanding of the Sage Accpac application object model (http://support.accpac.com/techsupport/aom/advantage.asp) and the ability to write SQL statements.

Creating a view-based visualization requires knowledge of Microsoft Visual Studio in addition to the resources needed to create a query-based visualization.

As well, ensure you have installed Product Update 1 for Sage Accpac 5.5 ERP, available at http://support.accpac.com/techsupport/Service_Packs/a4w/

Page 7: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

How the Accpac Dashboard Works

User Guide 3

Refe

ren

ce

How the Accpac Dashboard Works The Sage Accpac Dashboard is a web application that runs under Microsoft’s Internet Information Services server (IIS). Essentially, the installed dashboard is a website that can read data from an Accpac database and display it graphically on a web page.

When you install the Accpac Dashboard, you are installing a web site that includes several types of files:

*.SWF — Flash files to graphically present data on the dashboard pages. Once you have created the data presentation for your dashboard using Xcelsius, you export it to a Flash file. The Flash file contains a table of the cells referenced by your presentation, as well as the connection to your dashboard query page.

For example, AgedPayables.swf looks like this:

The Xcelsius-generated Flash files are linked to Accpac data through aspx pages.

*.ASPX — Web forms for displaying the dashboard pages or processing data from Accpac database. You’ll notice that each dashboard includes several aspx pages — a main page and additional pages for each process.

The main page — for example, APMain.aspx — is the display page, and arranges each of the individual dashboard items (each represented by a Flash file and xxxProcess.aspx file).

The process pages are associated with each Flash file. For example, AgedPayablesprocess.aspx is associated with the AgedPayables.swf file.

All of the Flash files initially shipped with Sage Accpac ERP use view calls to get data from the Accpac database. You can use the generic query.aspx page to process SQL queries for query-based visualizations.

*.CONFIG — Configuration files for the web site.

*.DLL — Program libraries used by aspx pages to provide query access and view access to Sage Accpac databases.

Other site files — Style sheets, message resources, images, JavaScript, and support for logging on and off Accpac databases.

Page 8: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Designing Data Presentations Using Xcelsius

4 Dashboard Customization Toolkit

The following diagram provides a simplified view of the Sage Accpac Dashboard.

Dashboard in browser.

Graphs designed in Xcelsius and exported to Flash.

Access to Accpac data through SQL queries or view calls

Flash files are referencedon aspx content page

Flash queries through Query.aspx, or uses VB code for data retrieval.

Accpac database

Designing Data Presentations Using Xcelsius You create each graphical object on the Accpac Dashboard using Xcelsius, and then export it to a Flash file (SWF) and add it to a dashboard page.

Xcelsius calls its graphical objects “visualizations.”

Each Xcelsius visualization has two parts:

• The data presentation element (such as a bar chart, gauge, progress bar, checkbox, ticker, etc.).

• An embedded Excel spreadsheet that contains the source data for the presentation element.

You link the spreadsheet cells to the graphical elements, and you can also link the spreadsheet cells to an outside datasource, such as a Sage Accpac database.

The exported Flash file contains the data presentation elements, as well as the spreadsheet cells and the datasource information.

The overview for creating and using Xcelsius visualizations is as follows:

Step 1: Decide on the dashboard components

Step 2: Create the Excel model

Step 3: Create the Xcelsius visual model

Page 9: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Designing Data Presentations Using Xcelsius

User Guide 5

Refe

ren

ce

Step 4: Export the Xcelsius model to a Flash file

Step 5: Add the Flash file to a dashboard Web page

Step 1: Decide on the Dashboard Components

Your first step is to decide which information you want to display and then determine what data you need in your spreadsheet.

Each of the components on the Accpac Dashboard was developed in a separate Xcelsius project file

The Dashboard page shown here includes four different Flash files that were developed in four Xcelsius projects.

This modular approach lets you mix and match objects later, but you could also add several objects to the same Xcelsius project.

Step 2: Create the Excel Model

You can add data directly to Xcelsius’ embedded spreadsheet, or import an already existing Excel spreadsheet.

Page 10: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Designing Data Presentations Using Xcelsius

6 Dashboard Customization Toolkit

Step 3: Create the Xcelsius Visual Model

In this step, you add the visual components for your dashboard object, and link the spreadsheet data to the Xcelsius components. You can preview your visual model as you work.

If you link the embedded spreadsheet to a datasource, Xcelsius will automatically update the visual components as the data changes.

Step 4: Export the Xcelsius Model to a Flash File

Once you are satisfied with your data visualization, you can generate and export the Flash file from Xcelsius.

Although our final destination is the Sage Accpac dashboard, you can also publish to a sharepoint site, e-mail the visualization to other colleagues, or add the model to your corporate Web site.

Step 5: Add the Flash file to a Dashboard Web Page

You add the Flash files exported from Xcelsius to the aspx content page for the dashboard — such as APMain.aspx.

Each Flash object on Accpac dashboards appears in a division on the page using <div> tags.

The parameters for each SWF object are handled by JavaScript at the bottom of the content page.

Page 11: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Connecting Visualizations to Accpac Databases

User Guide 7

Refe

ren

ce

You do not have to set up new aspx content pages this way; however, the existing pages provide good models for the styles and script that you will use for your own pages.

Connecting Visualizations to Accpac Databases The Accpac Dashboard provides two ways to connect Xcelsius Visualizations (SWF files) to Accpac data:

Query-based approach

This method lets you create new dashboard items using only Excel and Xcelsius.

The Xcelsius spreadsheet cells contain a SQL query that’s processed by Query.aspx.

View-based approach

With this method, you modify the provided Accpac Dashboard by adding one or more aspx pages derived from QueryBasePage, and compile it to a dll.

You can then replace your existing dashboard web site by publishing the new web application.

You create the Flash files using Excel and Xcelsius (the same way that you do using query.aspx), but, instead of embedding a query in a single spreadsheet cell, you process queries or access Accpac views in the aspx page.

If your dashboard object also uses global resources, you will have to modify \App_GlobalResources\SWFResource.resx and any resources for other languages (such as SWFResource.es.resx for Spanish).

The Dashboard customization toolkit gives you the templates to create new aspx files and processing code, as well as the dashboard source code you need to create new web application projects.

Page 12: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Connecting Visualizations to Accpac Databases

8 Dashboard Customization Toolkit

Tutorials for Creating Visualizations and Connecting to Accpac Databases

The tutorials in this guide take you through the process of creating Xcelsius dashboard objects, adding them to aspx content pages, and adding the code pages.

The tutorials cover the following material:

• Creating Xcelsius dashboard objects

• Embedding a SQL query in an Xcelsius object, and using it to call Accpac databases through Query.aspx.

• Extending the Accpac Dashboard by adding new aspx pages. This involves changing the dashboard configuration files, writing the VB.net code with SQL queries and/or view calls, and calling routines in DashboardClassLibrary.dll.

Page 13: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

User Guide 9

Tu

toria

ls

Dashboard Tutorials

There are two ways to customize the dashboard examples. The first involves using Xcelsius to perform a query-based customization, and the second is a view-based modification that involves changing source code using Microsoft Visual Studio.

Creating a Simple Query-based Visualization The following tutorial provides the basic steps in creating an Excel spreadsheet, selecting visual components and linking them to spreadsheet data, and creating a data connection. The end result is a column chart with sales data by territory that can be refreshed with up-to-date data from the Sage Accpac dashboard.

Prior knowledge of Xcelsius is helpful when completing the following procedure. It is assumed that you know the basic tasks in creating data visualizations and data connections. Consult your Xcelsius documentation if any of the steps seem too condensed.

Create the Excel Spreadsheet

Use Excel to create a spreadsheet with data and SQL statements. This spreadsheet will be imported into Xcelsius and linked to data components in the column chart.

1. Create an Excel spreadsheet with five worksheets: Query, Data, Markers, ViewFields, and Resources.

2. On the Query worksheet, insert the labels Web Site, PSQLQuery, MSSQLQuery, DB2Query, and OracleQuery into cells A1, A3, A5, A7, and A9 respectively.

a. Insert the location of the Query.aspx page in cell B1 next to the Web Site label. Based on the default install location, the relative path ../query.aspx should be entered. If you cannot find the query.aspx file, you may not have installed Product Update 1 for Sage Accpacc 5.5 ERP.

b. Insert the following SQL statement in cells B3, B5, B7, and B9.

SELECT C.CODETERR, SUM(FTOTSALES - FRETSALES) AS NETSALESAMT /* ACCPAC TYPE 2 FT_BCD 10 3 */ FROM OESHHD H, ARCUS C WHERE H.CUSTOMER = C.IDCUST AND H.YR = |APOS||OESHFISCYR||APOS| AND H.PERIOD |LT|=

Page 14: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a Simple Query-based Visualization

10 Dashboard Customization Toolkit

|OESHFISCPER| GROUP BY C.CODETERR ORDER BY NETSALESAMT DESC

This SQL statement gets year-to-date net sales by territory in descending order based on session date.

The query works for each of the four database products supported by Sage Accpac: Pervasive (PSQLQuery), Microsoft (MSSQLQuery), IBM (DB2Query) and Oracle (OracleQuery). However, it is different from a regular SQL statement.

/* TYPE 2 FT_BCD 10 3 */ is a hint for AccpacComAPI to convert the NETSALESAMT value into a 10 bytes BCD number with 3 decimal places.

|APOS| and |LT| represent characters ‘ and < respectively as these special characters break the XML code when the statement is passed to the query.aspx page.

|OESHFISCYR| and |OESHFISCPER| represent the fiscal year and fiscal period based on the session date. These values are only known at runtime.

APOS, LT, OESHFISCYR, OESHFISCPER are called markers defined in web.config. At runtime, markers will be replaced with actual values when executing the SQL statement.

For detailed information about hints and markers, please refer to the query-based reference section in this document.

3. On the Data worksheet, enter the status label in cell A1, the culture label in cell C1, the language label in cell E1, Territory Code in cell A2 and Net Sales in cell B2.

Enter the formula =UPPER(LEFT(D1,2)) in cell F1. Enter Dynamic Visibility and a zero (0) in cell G1 and H1 respectively. These cells will be used later when creating a data connection.

Data obtained from the SQL statement will be inserted in placeholders on this worksheet, such as sales for each territory (cell range underneath Territory Code and Net Sales headings) and culture (cell

Page 15: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a Simple Query-based Visualization

User Guide 11

Refe

ren

ce

D1). This formula in cell F1 is used to determine the language from the culture.

4. On the Markers worksheet, enter Name and Value in cells A1 and B1 respectively. The cells in the first two columns are placeholders where name/value pairs obtained from the query page are stored. You can do a lookup to get the value for the marker.

Enter the labels OESHFISCYR in cell C2, OESHFISCPER in cell C3, SESSIONDATE in cell C4 and Formatted Session Date in cell E4.

a. Enter the following formula in cell D2 (adjacent to the OESHFISCYR label).

=VLOOKUP(CONCATENATE("|",C2,"|"),$A$2:$B$49,2,FALSE)

This formula is used to obtain the fiscal year from the name/value pairs that will be loaded into the table.

b. Enter the following formula in cell D3 (adjacent to the OESHFISPER label).

=VLOOKUP(CONCATENATE("|",C3,"|"),$A$2:$B$49,2,FALSE)

This formula is used to obtain the fiscal period from the name/value pairs that will be loaded into the table.

c. Enter the following formula in cell D4 (adjacent to the SESSIONDATE label).

=VLOOKUP(CONCATENATE("|",C4,"|"),$A$2:$B$49,2,FALSE)

This formula is used to obtain the unformatted session date from the name/value pairs that will be loaded into the table. You can also enter |SESSIONDATE| and 20091231 in cells A16 and B16 respectively to display the session date value as 20091231.

d. Enter the following formula in cell F4 (adjacent to the Formatted Session Date label).

=DATE(LEFT(D4,4),MID(D4,5,2), RIGHT(D4,2))

This formula provides the formatted session date from D4 cell.

Note: Even if you do not need any of the markers for the chart, you must provide enough space for the name/value pairs.

Page 16: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a Simple Query-based Visualization

12 Dashboard Customization Toolkit

5. On the ViewFields worksheet, enter information that appears as labels in the chart.

a. Enter Rotoids and OE0480 in cells A1 and A2 respectively. Rotoid must be defined in web.config dashboardconfigsection | views.

b. Enter Fields, SHFISCYR, SHFISCPER, TRANPRDS, and TRANPRD in cells B1, B2, B3, B4 and B5 respectively.

c. Enter the labels Name, Value, Presentation and Graph Label in cells C1, D1, E1 and H1 respectively.

d. Enter the following formula in cell H5

=CONCATENATE(Resources!C4," ",E5," ",D3, " (",TEXT(Markers!F4,"mm/dd/yyyy"), ")") in cell H5.

This formula is used to provide label text by combining information in cells contained in other worksheets.

View fields provide access to Accpac views. They can be used when the view has only one record (i.e., option views), or is a superview. While both the Markers and ViewFields worksheets have cells used as labels in the chart, the difference is that Markers can only get one field obtained by the SQL statement while ViewFields are intended for multiple Accpac view fields not referenced in the SQL statement. You can have more than one view by simply putting other views in the corresponding cells under each column.

6. On the Resources worksheet, enter different strings that can be used as titles on the chart. If you don’t require a multi-language setup, you can simply enter the titles YTD Net Sales, By Territory and As of in cells B2, B3 and B4 respectively. Complete the following steps for an English, French, Spanish and Chinese label setup.

a. Enter the labels Name, Value, EN, FR, ES and ZH in cells A1 to F1 respectively.

b. Under the Name column enter CAP_YTDNetSales, CAP_ByTerritory and CAP_Asof in cells A2 to A4 respectively.

c. Under the EN column, enter the English terms that can be used for labels in the chart (YTD Net Sales in C2, By Territory in C3 and As of in C4).

Page 17: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a Simple Query-based Visualization

User Guide 13

Refe

ren

ce

d. Under each of the FR, ES and ZH columns enter the French, Spanish and Chinese terms that can be used as labels in the chart.

e. Under the Value column, enter

i. =IF(Data!$F$1=$F$1,F2,IF(Data!$F$1=$E$1,E2,IF(Data!$F$1=$D$1,D2,C2))) in cell B2

ii. =IF(Data!$F$1=$F$1,F3,IF(Data!$F$1=$E$1,E3,IF(Data!$F$1=$D$1,D3,C3))) in cell B3 and

iii. =IF(Data!$F$1=$F$1,F4,IF(Data!$F$1=$E$1,E4,IF(Data!$F$1=$D$1,D4,C4))) in cell B4.

These formulas determine which strings to use by looking at cell F1 on the Data worksheet.

7. Save the Excel file as TerritorySales.xls.

Launch Xcelsius and create a new project. Import the Excel spreadsheet by selecting Data > Import on the menu bar. The next step will be to add data components and link them to cells in the spreadsheet.

Page 18: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a Simple Query-based Visualization

14 Dashboard Customization Toolkit

Select a Chart and Link to Spreadsheet Data

Use Xcelsius to create a column chart and link the chart elements to fields in the spreadsheet. Once the chart is created you can add a data connection that refreshed the chart form the dashboard.

1. Drag a column chart from the components pane into the blank canvas.

2. Define the titles on the chart by linking cell B2 on the Resources worksheet as the Chart title, and cell B3 as the Subtitle. Use the button next to the fields to link cells rather than entering the cell addresses manually.

3. Add a data series for the Primary Axis and link the value to cell range B3 to B12 on the Data worksheet.

Page 19: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a Simple Query-based Visualization

User Guide 15

Refe

ren

ce

4. Link cell range A3 to A12 on the Data worksheet as Category Labels(X).

5. Add a label component for the “As of” title and link it to cell H5 on the ViewFields worksheet.

In this example, we want to use the view field value and presentation string to compose a string for the label, for example, “As of Fiscal Period 3 (3/31/2008)”. “Fiscal Period” is the presentation string for field “TRANPRD”. The “3” after “Fiscal Period” is the value of field “SHFISCPER”.

Page 20: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a Simple Query-based Visualization

16 Dashboard Customization Toolkit

Add the Data Connection

Add a data connection in the chart so that data can be refreshed from the Sage Accpac database.

1. Drag a Connection Refresh Button component onto the canvas.

2. Select Behavior > Common tab. In the Dynamic Visibility section link cell H1 on the Data worksheet to the Status field and enter 1 for the Key field. Specifying different values for the two fields result in the button not appearing in the exported flash file.

3. Under the General tab, enter a label for the button if you do not want to use the default name. Click Launch Data Manager.

4. Select Add > XML Data to create a new connection.

5. On the Definition tab of the Data Manger window, provide a name for the data connection, link cell B1 on the Query tab to the XML Data URL field and select application/x-www-form-urlencoded as the MIME Type.

6. Under the Enable Send section, add an entry for each of the four database queries that appear on the Query worksheet and link to the respective cells.

Add an entry for OE0480 and link it to cell range B2 to B5 on the ViewFields worksheet. OE0480 is an optional query that accesses the accpac view defined in the dashboard config section/views in the web.config file.

Page 21: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a Simple Query-based Visualization

User Guide 17

Refe

ren

ce

7. Under the Enable Load section, enter OE0480 again, this time link to cell range C2 to E5 on the ViewFields worksheet. This is where the query results will be loaded

Enter the rest of the load entries in the following order, and link to the respective cells.

a. Create the markers entry and link to cell range A2 to B33 the Markers worksheet. This information will be used as labels in the chart.

b. Create the queryresults entry and link to cell range A3 to B102 on the Data worksheet. This information will be used to display data on the chart.

c. Create the status entry and link to cell B1 on the Data worksheet. You can use this field for debugging purposes by creating a label to display error messages that appear during the development process.

d. Create the culture entry and link to cell D1 on the Data worksheet. This information will be used by the Resource worksheet to determine what strings will be used (if working in a multi-language setup).

Note: Load order must be OE0480, markers, queryresults, status and culture.

8. On the Usage tab of the Data Manager, select the Refresh On Load check box under the Refresh Options section.

9. Close the Data Manager window.

Page 22: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a Simple Query-based Visualization

18 Dashboard Customization Toolkit

10. Select the checkbox for the Connection Refresh button you just created.

11. Save the file and export the visualization as a Flash (swf) file.

12. Replace the TerritorySales.swf file in the SageAccpacDashboard\OE folder with your newly created swf file. Clear your internet cache before opening the dashboard website and you should get the same end result as the Territory Sales visualization shipped with the toolkit.

Note: A completed sample of the Territory Sales data visualization is included in the toolkit in the QueryBased folder

You may want to create a new web page to hold your newly created dashboard (SWFs). You can do so by adding a new content page and menu item to the existing dashboard web site (See Adding a New Menu Item to the Dashboard later in this document).

Page 23: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Examples of Complex Queries

User Guide 19

Refe

ren

ce

Examples of Complex Queries The dashboard created in the previous section was a relatively simple dashboard that used one query to populate data in one column chart. The Xcelsius project SalesHistory.xlf (located in the QueryBased directory) uses six queries to feed data into a chart with 5 components that represent historical sales figures.

When comparing TerritorySales.xlf and SalesHistory.xlf, you will notice the number of worksheets in the nested Excel spreadsheet is the same for both files, and all worksheets share the same titles. However many differences exist in the Query and Data worksheets.

As queries and data connections have a one-to-one relationship, you will notice there are six connections to manage in the Data Manager. The first connection – Invoices – has the same Send and Load variables as the single data connection in Territory Sales.

Page 24: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Examples of Complex Queries

20 Dashboard Customization Toolkit

As stated in the previous section, the load variables must be ordered in the following way: OE0480, markers, queryresults, status and culture. However, since you only need to load the OE0480 and culture variables once, the subsequent connections do not need the first and last entry in the Enable Load section, and the OE0480 send variable can be omitted. As a result, the load and send variables in second data connection – Returns – looks like so:

Page 25: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Examples of Complex Queries

User Guide 21

Refe

ren

ce

The remaining connections all have the same number of load and send variables and are ordered the same way. The cells that they link to, of course, vary.

One Large Query vs. Six Small Queries

The following section explains how the exact same data dashboard can be achieved using different methods. The Xcelsius files SalesHistory.xlf and SalesHistory2.xlf both export the same data visualization to the Dashboard.

Page 26: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Examples of Complex Queries

22 Dashboard Customization Toolkit

While both end up with the same result, SalesHistory.xlf does so with 6 queries and SalesHistory2.xlf does so using one large query concatenated by strings in the SubQueries worksheet.

As data connections have a one-to-one relationship with queries, there is also just one data connection to manage in SalesHistory2.xlf, as opposed to the six in the SalesHistory.xlf example. The results for the single query are loaded in to the cell range A3 to F3 on the Data worksheet.

This is contrary to SalesHistory.xlf, which loads the query results in individual cells for each of the six queries.

Page 27: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Adding a New Menu Item to the Dashboard

User Guide 23

Refe

ren

ce

In both instances, the Data worksheet takes the results from the query and uses other formulas to prepare the data for presentation.

The information in the other worksheets (Markers, ViewFields, Resources) are largely the same between SalesHistory.xlf and SalesHistory2.xlf files.

Adding a New Menu Item to the Dashboard Use the following tutorial to add a new menu item titled “Sample Sales” to the dashboard web site. When you select the menu item, a new web page appears with YTD Territory Sales and Sales History data. You may wish to backup your site before making any changes. By default the dashboard web site is located in the C:\Inetpub\wwwroot\sageaccpacdashboard\ directory.

1. Modify the Web.sitemap file in the existing dashboard to add a new node.

<siteMapNode url="~/oesample/OESample.aspx" title=" Sample Sales" >

</siteMapNode>

2. Add a new folder named oesample to the web site.

3. Create a new content page named oesample.aspx using the QueryBasedContentPage.aspx file as a base.

Copy the QueryBasedContentPage.aspx file from the toolkit’s QueryBased directory and rename it to oesample.aspx. The file already contains the necessary sections for the SWF objects TerritorySales.swf and SalesHistory.swf.

<div id="topleft">

<div id="saleshistory">

<strong></strong>

<p>Sales History</p>

</div>

</div>

Page 28: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Adding a New Menu Item to the Dashboard

24 Dashboard Customization Toolkit

<div id="topright">

<div id="territorysales">

<strong></strong>

<p>Territory Sales</p>

</div>

</div>

If you have different SWF files, you need to replace corresponding sections with your own SWFs.

The following SWFObject code replaces the previously mentioned placeholder content with the SWF files when the page is rendered at runtime.

so = new SWFObject("SalesHistory.swf", "saleshistory", "375", "266", "8", "white");

so.addParam("wmode", "opaque");

so.write("saleshistory");

so = new SWFObject("TerritorySales.swf", "territorysales", "375", "266", "8", "white");

so.addParam("wmode", "opaque");

so.write("territorysales");

SWFObject is a small Javascript file used for embedding Adobe Flash content

var so = new SWFObject(swf, id, width, height, version, background-color [, quality, xiRedirectUrl, redirectUrl, detectKey]);

For descriptions of the parameters, please refer to the Reference section of this document.

4. Modify ~\App_Themes\Default\Default.css to manage the page layout. Open ~\App_Themes\Default\Default.css and add the following two sections.

#topleft

{

float:left;

}

#topright

{

float:right;

}

Page 29: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Adding a New Menu Item to the Dashboard

User Guide 25

Refe

ren

ce

These styles work with the topright and topleft DIV tags, displaying the two SWF files side by side, one aligned to the left, the other to the right. You may add other formatting properties as desired.

5. Copy SalesHistory.swf and TerritorySales.swf (created from the tutorial) to the new oesample folder.

6. Create a web.config file to handle user authorization, and set the user role to "OEDSHBOARD".

<configuration>

<appSettings/>

<connectionStrings/>

<system.web>

<authorization>

<allow roles="OEDSHBOARD" />

<deny users="*"/>

</authorization>

</system.web>

</configuration>

This ensures that only users with OE Dashboard Security rights can access this page. The new menu item will not appear for other users.

7. Launch the new dashboard. The Sample Sales page should look similar to the following image.

Page 30: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a View-based Visualization

26 Dashboard Customization Toolkit

Creating a View-based Visualization When query-based data visualizations are not sufficient, you can create view-based ones using Microsoft Visual Studio and a little .NET programming knowledge. This tutorial will show you how to add a view-based visualization to your existing dashboard. As a result, you should create a backup of your dashboard web site (located at C:\Inetpub\wwwroot\sageaccpacdashboard\ by default) before you start the tutorial.

Before you begin, ensure you have the following resources available.

• Xcelsius 2008 (included with the toolkit)

• Microsoft Visual Studio 2005 SP1 (visit http://msdn.microsoft.com/en-us/vstudio/products/default.aspx for details)

• Microsoft ASP.NET 2.0 AJAX Extension 1.0 (available at http://www.asp.net/ajax)

• ASP.NET AJAX Control Toolkit v 1.0.11119.0 (available at http://www.asp.net/ajax)

Copy the custom Visual Basic templates DashboardContentPage and DashboardQueryPage (located in the ViewBased folder of the toolkit) to the My Documents\Visual Studio 2005\Templates\ItemTemplates\Visual Basic directory. They will automatically appear under the my template list for you when adding a new item.

Create XLF in Xcelsius and Export to SWF

Compared to the Query-based example, creating the XLF file is easier as the view fields, SQL queries and resource strings can be embedded in the web page, so the Xcelsius file needs only to provide the resource strings and placeholders for the query results. As well, the data connection only has load variables and no send variables.

1. Launch Excel and create a spreadsheet with 3 worksheets: Query, Data, and Resource.

2. On the Query worksheet, enter web page in cell A1 and ARStatistics.aspx in cell B1. This is the page you will create later using Visual Studio.

3. On the Data worksheet, enter the placeholders that will receive data from the query and the formulas that are used in the chart.

Page 31: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a View-based Visualization

User Guide 27

Refe

ren

ce

a. Enter Net Billings and Net Collections in cells A1 and B1 respectively.

b. Enter the formula =A5+B5+C5 in cell A2, and =A7-B7-C7+D7 in cell B2. These cells will be linked to data components in the chart.

c. Select cells A2 and B2, right-click, then select Format Cells from the shortcut menu. Select Custom under the Category list, then select _(* #,##0_);_(* (#,##0);_(* "-"??_);_(@_) as the Type.

Click OK and exit the Format Cells window.

d. Enter Sales, Miscellaneous Sales and Adjustments in cells A4, B4 and C4 respectively.

e. Enter Total Receipts, Total Returned Receipts, Total Refunds, and Total Reversed Refunds in cells A6, B6, C6 and D6 respectively.

f. Enter XML Data Button Visibility in cell A9, and a zero (0) in cell B9. This cell will be used later to instruct Xcelsius to hide the data refresh button on the chart.

4. On the Resource worksheet, enter Name, CAP_NetBillings, CAP_NetCollections, and CAP_ARStatistics in cells A1 to A4 respectively. Enter Value, Net Billings, Net Collections and AR Statistics in cells B1 to B4 respectively. These cells will be used as labels in the Xcelsius visualization.

5. Save the Excel file. Launch Xcelsius and create a new project. Import the spreadsheet you just created by selecting Data > Import on the menu bar.

Page 32: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a View-based Visualization

28 Dashboard Customization Toolkit

6. Drag two value components onto the blank canvas and position them next to each other.

7. Link the Title of the first value component to cell B2 on the Resource worksheet (Net Billings). Link the Data to cell A2 of the Data worksheet.

8. Link the Title of the second value component to cell B3 on the Resource worksheet (Net Collections). Link the Data to cell B2 of the Data worksheet.

9. Drag a Label text component onto the canvas and link it to cell B4 on the Resource worksheet (AR Statistics).

10. Drag a Connection Refresh Button (a web connectivity component) onto the canvas. In the Dynamic Visibility section under the Behavior tab, link the Status field to cell B9 on the Data worksheet, then enter 1 in the Key field. This hides the refresh button on the visualization.

11. Select the General tab, then click Launch Data Manager. The Data Manager window appears.

12. Select Add > XML Data to create a new connection.

13. On the Definition tab of the Data Manger window, provide a name for the data connection, link cell B1 on the Query tab to the XML Data URL field and select application/x-www-form-urlencoded as the MIME Type.

14. Select the Enable Load checkbox, then create the following eight load variables on the Data Manager window.

a. Link sales to cell A5 on the Data worksheet.

b. Link miscsales to cell B5 on the Data worksheet.

c. Link adjustments to cell C5 on the Data worksheet.

d. Link receipts to cell A7 on the Data worksheet.

Page 33: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a View-based Visualization

User Guide 29

Refe

ren

ce

e. Link returnedreceipts to cell B7 on the Data worksheet.

f. Link refunds to cell C7 on the Data worksheet.

g. Link reversedrefunds to cell D7 on the Data worksheet.

h. Link resources to cell range B2 to B4 on the Resource worksheet.

The resources variable must be the last variable in the list and cannot be renamed.

15. On the Usage tab of the Data Manager, select the Refresh On Load check box under the Refresh Options section.

16. Close the Data Manager window.

17. Select the checkbox next to data connection you created.

18. Save the Xcelsius file as ARStatistics.xlf

19. Export the file as ARStatistics.swf to a working directory. This file will be used when you create the ASP.Net pages in Visual Studio.

Page 34: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a View-based Visualization

30 Dashboard Customization Toolkit

You can compare what you created to the file in the ViewBased\SampleARStats folder. As well, the ViewBased\SourceCode\Xcelsius folder contains all the XLF files used in the Accpac dashboard.

Create the ASP.Net Pages in Visual Studio

To get started in creating the content and query pages in Visual Studio, you need to modify the Dashboard web project located in the toolkit.

Copy the entire contents of the ~\ViewBased\SourceCode directory included to the toolkit to your desired location (for example, C:\DEV\). Rename the folder to SampleARStats.

Copy the ARStatistics.swf file you created previously to the C:\DEV\SampleARStats\AccpacDashboard\AR folder. All the required files now reside in this folder for you to create the ASP pages.

1. Open the AccpacDashboard project with Visual Studio 2005.

2. Right-click on the AR folder in the solution explorer and select Add > Existing Item from the shortcut menu. Add the ARStatistics.swf file to this project.

3. Right-click on the AR folder in the solution explorer and select Add > New Item from the shortcut menu. Create ARStatistics.aspx using the DashboardQueryPage template (which should appear under My Templates) and put it under the AR folder.

Page 35: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a View-based Visualization

User Guide 31

Refe

ren

ce

4. Open ARStatistics.aspx.vb and add the following variables, which hold the query results for total amount of receipts, reversed receipts, refunds, reversed refunds, sales, miscellaneous sales and adjustments.

Private receiptResults As ArrayList = New ArrayList

Private receiptReversedResults As ArrayList = New ArrayList

Private refundResults As ArrayList = New ArrayList

Private refundReversedResults As ArrayList = New ArrayList

Private salesResults As ArrayList = New ArrayList

Private miscSalesResults As ArrayList = New ArrayList

Private adjustmentsResults As ArrayList = New ArrayList

Note: An arraylist of strings can map to the same number of contiguous cells in an Excel row or to several rows. For example:

a. Single element in the array maps to one cell (i.e., {x} maps to cell A1)

b. Several elements in the array map to one row (i.e., {x1, x2, x3} maps to cell A1, A2, A3)

c. Array of array maps to a matrix (i.e., {{x1,x2, x3}, {y1, y2, y3}} maps to cell A1, A2, A3, B1, B2, B3 with {x1,x2,x3} to A1, A2, A3, and {y1,y2.y3} to B1, B2, B3)

In this case, each variable maps to one cell in Excel.

5. Add the following constants to hold the SQL queries.

Private Const query_Sales As String = _

"SELECT SUM(AMTINVCHC) /* ACCPAC TYPE 1 FT_BCD 10 3 */ " + _

"FROM AROBL " + _

"WHERE (TRXTYPETXT IN (1,2,3,4)) "

Private Const query_Misc As String = _

"SELECT SUM(AMTRMITHC) /* ACCPAC TYPE 1 FT_BCD 10 3 */ " + _

"FROM ARRRH " + _

"WHERE IDCUST = ' ' "

Private Const query_Adj As String = _

"SELECT SUM(AMTPAYMHC) /* ACCPAC TYPE 1 FT_BCD 10 3 */ " + _

"FROM AROBP P, AROBL L " + _

Page 36: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a View-based Visualization

32 Dashboard Customization Toolkit

"WHERE P.IDCUST = L.IDCUST " + _

"AND P.IDINVC = L.IDINVC " + _

"AND P.TRANSTYPE = 14 "

Private Const query_Receipt As String = _

"SELECT SUM(AMTRMITHC) /* ACCPAC TYPE 1 FT_BCD 10 3 */ " + _

"FROM ARRRH "

Private Const query_ReceiptR As String = _

"SELECT SUM(AMTRMITHC) /* ACCPAC TYPE 1 FT_BCD 10 3 */ " + _

"FROM ARRRH " + _

"WHERE SWCHKCLRD = 2 "

Private Const query_Refund As String = _

"SELECT SUM(AMTHC) /* ACCPAC TYPE 1 FT_BCD 10 3 */ " + _

"FROM ARPYM "

Private Const query_RefundR As String = _

"SELECT SUM(AMTHC) /* ACCPAC TYPE 1 FT_BCD 10 3 */ " + _

"FROM ARPYM " + _

"WHERE SWSTATUS = 2 "

Notice the SQL statement is different from a regular statement in that it includes a hint that instructs AccpacComAPI on how to format the query result. For detailed information about hints, refer to the Reference section of this document.

6. Insert the following code into ProcessXML().

_accpacProcessor.ProcessCSQRY(query_Sales)

salesResults = _accpacProcessor.QueryResults

_accpacProcessor.ProcessCSQRY(query_Misc)

miscSalesResults = _accpacProcessor.QueryResults

_accpacProcessor.ProcessCSQRY(query_Adj)

adjustmentsResults = _accpacProcessor.QueryResults

Page 37: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a View-based Visualization

User Guide 33

Refe

ren

ce

_accpacProcessor.ProcessCSQRY(query_Receipt)

receiptResults = _accpacProcessor.QueryResults

_accpacProcessor.ProcessCSQRY(query_ReceiptR)

receiptReversedResults = _accpacProcessor.QueryResults

_accpacProcessor.ProcessCSQRY(query_Refund)

refundResults = _accpacProcessor.QueryResults

_accpacProcessor.ProcessCSQRY(query_RefundR)

refundReversedResults = _accpacProcessor.QueryResults

Note that _accpacProcessor.ProcessCSQRY() executes the SQL statement, and you can get the query result from _accpacProcessor.QueryResults. If you need AP/AR aging or balances, call APAging(), ARAging(), APBal() or ARBal() of _accpacProcessor. Or you can do whatever you want with Accpac views.

7. Replace the line .AddVariable(“status”, “ok”) in SetQueryResult() with the following code.

.AddVariable("sales", salesResults)

.AddVariable("miscsales", miscSalesResults)

.AddVariable("adjustments", adjustmentsResults)

.AddVariable("receipts", receiptResults)

.AddVariable("returnedreceipts", receiptReversedResults)

.AddVariable("refunds", refundResults)

.AddVariable("reversedrefunds", refundReversedResults)

This packs the query results into XML and passes them to the SWF file. Note the order of the variables must match the order defined in the XLF file.

8. Insert the following code into GetResources().

AddOneResource(Resources.SWFResource.NET_BILLINGS)

AddOneResource(Resources.SWFResource.NET_COLLECTIONS)

AddOneResource("AR Statistics")

Page 38: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Creating a View-based Visualization

34 Dashboard Customization Toolkit

Note: This routine packs the resource strings into XML. Notice the first two are from App_GlobalResources\SWFResource.resx, while the third is hard-coded. The order of resource strings must match the order in Excel.

9. Modify the ARMain.aspx to include ARStatistics.swf. Add the following inside the DIV “bottom”.

<div id="arbottombottom">

<div id="arstatistics">

</div>

</div>

Also add the following to the end of the JavaScript section.

so = new SWFObject("ARStatistics.swf", "arstatistics", "480", "240", "8", "white");

so.addParam("wmode", "opaque");

so.write("arstatistics");

10. After creating the necessary files in Visual Studio, you may also want to manage the layout by editing ~\App_Themes\Default\Default.css if you don’t want to use the default format. See step 4 of Adding a New Menu Item to the Dashboard for more information. You can also use the instructions to display AR Statistics as a new menu item, the only difference is the content page should be created using the VB template DashboardContentPage

Now either publish the new dashboard or run from Visual Studio.

Page 39: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Publishing the Dashboard

User Guide 35

Refe

ren

ce

Publishing the Dashboard You can either publish to the existing dashboard site or to a new site. The following procedure assumes you are using Visual Studio 2005 and want to publish to the existing dashboard website. As such you should backup the website before proceeding.

1. Select Build > Publish AccpacDashboard from the menu bar to display the Publish Web window.

2. Select the browse button next to the target location field.

The Open Web site window appears.

3. Select Local IIS from the left pane. All of the web applications appear in the right pane.

Page 40: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Publishing the Dashboard

36 Dashboard Customization Toolkit

Note: If you do not want to overwrite the existing dashboard, you can create a new web site by clicking the Create New Web Application button on the top right corner. You can then test your new web site and make comparisons without affecting your existing one. You must configure the new web site before doing so (refer to your Sage Accpac System Manager Administration Guide for instructions).

4. Select SageAccpacDashboard from the list and click Open.

5. Click Publish on the Publish Web window.

Test the customized dashboard by entering http://localhost/SageAccpacDashboard/ in your web browser. Your results should look similar to the following image.

The fully completed project is located in the ViewBased\SampleARStats folder. You can compare your results there.

Page 41: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Applying the Sage Accpac Color Scheme

User Guide 37

Refe

ren

ce

Applying the Sage Accpac Color Scheme You can also make cosmetic customizations such as creating and applying a different color scheme to your dashboards. The Sage Accpac color scheme is included with the toolkit.

Copy the Accpac.xml file from the C:\Program Files\Sage Software\Sage Accpac Dashboard Customization Toolkit folder to the C:\Program Files\Business Objects\Xcelsius\assets\themes\custom\ directory (if you accepted the default locations during installation).

Launch Xcelsius 2008, then select Format > Color Scheme to display the Color Scheme window. The Accpac selection appears in the list of available schemes.

Instructions on how to create your own custom color scheme are included in your Xcelsius documentation.

Page 42: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this
Page 43: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

User Guide 39

Tu

toria

ls

Dashboard Developer’s Reference

The following chapter provides reference for the query and view-based examples included in the Dashboard toolkit. The query-based references deals with files that are maintained using Xcelsius, while the view-based references deal with files maintained using Visual basic.net.

Query-based References

SQL Query Hints

All SQL Queries are executed through AccpacComAPI. However, since different database engines handle numbers fields differently, we provide a hint to hide the difference.

Append following to each number column:

/* ACCPAC TYPE <field #> <type> [<length> [<decimals>]] */

Where:

• field# is one based integer of the field number

• type is one of {FT_BCD, FT_BOOL, FT_LONG, FT_INT, FT_CHAR, FT_BYTE…}

• length is the number of bytes (only for BCD, BYTE and CHAR fields)

• decimals (only for BCD fields)

For example, the following query gets the total number of documents in Accounts Payables.

SELECT COUNT(*) /* ACCPAC TYPE 1 FT_LONG */ FROM APOBL

SQL Query Marker

Sometimes a SQL statement is dependent upon parameters unknown until runtime. For example, the year to date sales amount in Accounts Receivables. The year and date are unknown when writing the SQL statement. In this case, we can use placeholders called Markers (enclosed by |) in the SQL statement. When the statement is passed to Query.aspx page, the markers are replaced with runtime values before passing to ODBC engine.

Page 44: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Query-based References

40 Dashboard Customization Toolkit

Following is the query for year to date sales in AR:

SELECT SUM(AMTINVCHC) /* ACCPAC TYPE 1 FT_BCD 10 3 */

FROM AROBL

WHERE (TRXTYPETXT IN (1,2,3,4))

AND DATEBUS > |SESSIONDATELESS1YEAR| AND DATEBUS <= |SESSIONDATE|

Markers are defined in web.config dashboardConfigSection|markers. They can represent two types of unknown values. The first is solely based on session date. The second is based on Accpac view field.

Following are the markers based on session date defined in web.config. You can add more if needed. The type is one of {fiscalyear, fiscalperiod, calendaryear, calendarmonth, date}.

<add name="FISCALYEAR" type="fiscalyear" year="0"/>

<add name="FISCALYEARLESS1" type="fiscalyear" year="-1"/>

<add name="FISCALPERIOD" type="fiscalperiod" period="0"/>

<add name="FISCALPERIODLESS1" type="fiscalperiod" period="-1"/>

<add name="FISCALPERIODPLUS1" type="fiscalperiod" period="1"/>

<add name="CALENDARYEAR" type="calendaryear" year="0"/>

<add name="CALENDARYEARLESS1" type="calendaryear" year="-1"/>

<add name="CALENDARMONTH" type="calendarmonth" month="0"/>

<add name="CALENDARMONTHLESS1" type="calendarmonth" month="-1"/>

<add name="CALENDARMONTHPLUS1" type="calendarmonth" month="1"/>

<add name="SESSIONDATE" type="date" year="0" month="0" day="0"/>

<add name="SESSIONDATELESS1YEAR" type="date" year="-1" month="0" day="0"/>

<add name="SESSIONDATELESS1YEARPLUS1DAY" type="date" year="-1" month="0" day="1"/>

<add name="SESSIONDATELESS2YEAR" type="date" year="-2" month="0" day="0"/>

<add name="SESSIONDATELESS2YEARPLUS1DAY" type="date" year="-2" month="0" day="1"/>

The following are markers based on Accpac view fields.

Where name is for the marker name, type is always viewfield, view is the rotoid of the Accpac view, and field is the view field name. Most of the values are statistical year/period based on session date.

Page 45: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Query-based References

User Guide 41

Refe

ren

ce

<add name="APCURRYEARVN" type="viewfield" view="AP0047" field="CURRYEARVN"/>

<add name="APCURRPERDVN" type="viewfield" view="AP0047" field="CURRPERDVN"/>

<add name="ARCURRYEARCU" type="viewfield" view="AR0060" field="CURRYEARCU"/>

<add name="ARCURRPERDCU" type="viewfield" view="AR0060" field="CURRPERDCU"/>

<add name="OESHFISCYR" type="viewfield" view="OE0480" field="SHFISCYR"/>

<add name="OESHFISCPER" type="viewfield" view="OE0480" field="SHFISCPER"/>

<add name="OESSFISCYR" type="viewfield" view="OE0480" field="SSFISCYR"/>

<add name="OESSFISCPER" type="viewfield" view="OE0480" field="SSFISCPER"/>

Please check the toolkit for detailed view information.

Special characters

Characters like {‘,<,>,+,&} in SQL statement will break the xml when passing to Query.aspx page. Use marker to replace the special characters.

The following are the markers defined in the web.config file. They represent {<, >, ‘, +, &} respectively.

<add name="LT" type="string" hex="3C"/>

<add name="GT" type="string" hex="3E"/>

<add name="APOS" type="string" hex="27"/>

<add name="PLUS" type="string" hex="2B"/>

<add name="AMP" type="string" hex="26"/>

When you want to use the pipe character, use || to represent the pipe character if do not want the pipe character to be parsed.

If you want to use escape quotes, use |APOS||APOS| to represent in char type. i.e. to select customer record for USA’100:

SELECT * FROM ARCUS WHERE IDCUST= |APOS|USA|APOS| |APOS|100|APOS|

Which is equivalent to the standard query

SELECT * FROM ARCUS WHERE IDCUST=’USA’’100’

Page 46: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Query-based References

42 Dashboard Customization Toolkit

Sample query with markers and hints

Get year to date net sales by territory in descending order based on session date

SELECT C.CODETERR, SUM(FTOTSALES - FRETSALES) AS NETSALESAMT /* ACCPAC TYPE 2 FT_BCD 10 3 */

FROM OESHHD H, ARCUS C

WHERE H.CUSTOMER = C.IDCUST AND H.YR = |APOS||OESHFISCYR||APOS| AND H.PERIOD |LT|= |OESHFISCPER|

GROUP BY C.CODETERR

ORDER BY NETSALESAMT DESC

Page 47: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

View-based References

User Guide 43

Refe

ren

ce

View-based References The following diagram displays the Accpac Dashboard web project as viewed in Visual Studio.

The above diagram shows the dashboard web site and the web files for the A/P dashboard. The diagram on the left shows the dashboard project folders in Visual Studio 2005, as well as the source files for the A/P dashboard. The SWF files are the Flash files exported from Xcelsius. They contain the graphical objects and the table cells from the Excel spreadsheet. APMain.aspx is the content page for the A/P dashboard, and xxxProcess.aspx pages handle the queries for each of the SWF files. All of the vb code pages are compiled into the AccpacDashboard.dll

Page 48: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Folders and Files in the Accpac Dashboard Solution

44 Dashboard Customization Toolkit

Folders and Files in the Accpac Dashboard Solution The Accpac Dashboard solution is a web application that contains one project with the following files and folders.

Accpac Dashboard Folders

AP folder for the Accounts Payable Dashboard

*.SWF — these are the dashboard Flash files exported from Xcelsius.

*.ASPX — these are web pages. There are two types:

• APMain.aspx is the main page that contains all the Accounts Payable swfs. It is derived from ContentBasePage.

• Other aspx pages (for example, AgedPayableProcess.aspx) are the data processing pages called by the Flash files (SWFs). These pages are derived from QueryBasePage. In AP, all of these pages make view calls.

*.VB — the Visual Basic code pages. All VB code is compiled to AccpacDashboard.dll in the BIN folder.

App_Browsers folder

The file in App_Browsers, CSSFriendlyAdapters.browser came from Microsoft. Instead of writing tables, the CSS adapters render divs that are easier to apply than style sheets. The only adapter that Accpac uses is for the menu, all other adapters are commented out.

App_Data folder

The Adapters folder contains Microsoft classes. The dashboard uses the MenuAdapter.vb class only. You are free to use any other classes.

App_Global_Resources folder

The resource files are stored here, and you can add resource files for other languages here, too.

Language resource files have to follow a naming convention, for example, Resource.fr-FR.resx is for French.

The Accpac Dashboard has the following resource files:

• ErrorMessage is for error related resource strings.

• Resource is for general ASP control text.

Page 49: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

Folders and Files in the Accpac Dashboard Solution

User Guide 45

Refe

ren

ce

• SWFResource is for SWF related resource strings.

App_Themes folder

The Default theme is in the Default folder, which contains Default.css and Default.skin file.

Default.css sets the colors, margins, fonts for the divs, menus, buttons, etc. for the web site. The Dashboard does not use Default.skin

AR folder for the Accounts Receivable Dashboard

This folder has the same material as the AP folder.

Bin folder

Contains the AjaxControlToolkit.dll. The Accpac Dashboard just uses the calendar control for the login page, but you can use other library items in ASP.NET Ajax.

Also contains DashboardClassLlibrary.dll, which provides common functionality to the Dashboard web pages. For more information, refer to the Dashboardlibrary.chm file in viewbased folder.

CSS folder

These are also Microsoft files, and are used by the CSS Adapters.

The Dashboard uses BrowserSpecific\IEMenu6.css only.

Images folder

This folder contains all of the jpgs for the Accpac Dashboard web page —images, backgrounds, menus, and buttons.

JavaScript folder

swfobject.js is a JavaScript file that activates the Flash files.

The remaining files came from Microsoft for the CSS Adapter.

OE folder for the Sales Analysis Dashboard

This folder has the same material as the AP folder.

Schema folder

This is the XML schema definition for the XML being sent between the Flash file and the aspx page.

Page 50: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

SWFObject Parameters

46 Dashboard Customization Toolkit

Accpac Dashboard Files

Default.aspx

This is the start up page. The master page is Site.master (see below).

Login.aspx

Unauthenticated users are redirected to Login.aspx, where they must enter the username, password, company ID, and session date.

Site.master and SiteSignon.master

These are master pages with the logos, images, and menus that have to be included on all dashboard pages.

web.config

This is a configuration file with a custom dashboard section.

web.sitemap

This is the data source for the menu system.

Query.aspx

This is the generic web page that handles SQL queries from query-based dashboards.

SWFObject Parameters SWFObject is a small JavaScript file used for embedding Adobe Flash content

var so = new SWFObject(swf, id, width, height, version, background-color [, quality, xiRedirectUrl, redirectUrl, detectKey]);

The following are brief descriptions of the parameters.

• swf is the file path and name to your Flash file.

• id is the ID of your object or embed tag. The embed tag will also have this value set as its name attribute for files that take advantage of swliveconnect.

• width is the width of your Flash movie.

• height is the height of your Flash movie.

Page 51: Dashboard Customization Toolkit - SAGE Partner … · Receivables page, also contains the Xcelsius file (ARStatistics.xlf). • The Dashboard Customization Toolkit User Guide (this

SWFObject Parameters

User Guide 47

Refe

ren

ce

• version is the required player version for your Flash content. This can be a string in the format of ‘majorVersion.minorVersion.revision’. An example would be: "6.0.65". Or you can just require the major version, such as "6".

• background-color is the hex value of the background color of your Flash movie.

Optional arguments are:

• quality - The quality you wish your Flash movie to play at. If no quality is specified, the default is "high".

• xiRedirectUrl - If you would like to redirect users who complete the ExpressInstall upgrade, you can specify an alternate URL here

• redirectUrl - If you wish to redirect users who don’t have the correct plug-in version, use this parameter and they will be redirected.

• detectKey - This is the url variable name the SWFObject script will look for when bypassing the detection. Default is ‘detectflash’. Example: To bypass the Flash detection and simply write the Flash movie to the page, add ?detectflash=false to the url of the document containing the Flash movie.

For more detailed information about the SWFObject command, please visit http://blog.deconcept.com/swfobject/