Using Data Tables - Logi DevNet

advertisement
Data Analysis using
Data Tables
in Logi Info v12.1
March 2016
This document has been formatted for double-sided printing, hole-punching, and placement in a ring-binder.
Author: Lee Hausman
Logi Analytics is a trademark of Logi Analytics, Inc.
Microsoft, Microsoft Word, Microsoft Excel, Windows, Windows XP, Windows Server, Windows Vista, and Visual Basic are registered
trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
Other products and company names mentioned in this book may be trademarks of their respective owners.
Logi Analytics, Inc.
7900 Westpark Drive, Suite A200
McLean, Virginia 22101
703-752-9700
Copyright © 2009-2016, Logi Analytics, Inc. All rights reserved.
Table of Contents
Introduction ............................................................................................................................................................ 1
Using the Data Table Wizard................................................................................................................................... 2
Table Configuration Panel................................................................................................................................... 4
Column Configuration Menu .............................................................................................................................. 5
Retrieving Data ....................................................................................................................................................... 7
Using the Connection Wizard ............................................................................................................................. 7
Connection Basics ............................................................................................................................................... 9
Using Vendor-Specific Connections .................................................................................................................. 12
Using Generic Connections and Connection Strings......................................................................................... 13
Using Special-Purpose Connections .................................................................................................................. 15
Retrieving Data into a Datalayer ....................................................................................................................... 18
Using the Data................................................................................................................................................... 19
Using the Data Table Wizard................................................................................................................................. 25
Data Table Basics .................................................................................................................................................. 30
Creating a Data Table Manually ........................................................................................................................ 32
Data Table Links ................................................................................................................................................ 34
Using Auto Columns .......................................................................................................................................... 35
Data Table Columns .............................................................................................................................................. 37
Using the Add Data Columns Wizard ................................................................................................................ 37
Attributes .......................................................................................................................................................... 39
Working with Column Headers ......................................................................................................................... 40
Sorting Displayed Column Data ........................................................................................................................ 42
Rearranging and Resizing Columns at Runtime ................................................................................................ 42
Showing/Hiding Columns .................................................................................................................................. 43
Summarizing Column Data................................................................................................................................ 44
Using Event Handlers with Column Data .......................................................................................................... 45
Data Table Rows.................................................................................................................................................... 46
Creating Header and Summary Rows ............................................................................................................... 46
Highlighting Rows with CSS............................................................................................................................... 48
Working with “More Info Rows”....................................................................................................................... 48
Working with Hierarchical Data ............................................................................................................................ 52
Group Header and Group Summary Rows........................................................................................................ 53
Creating Hierarchies by Indenting Groups ........................................................................................................ 55
i
Creating Hierarchies by Hiding Duplicate Values .............................................................................................. 58
Working with Subdata Tables............................................................................................................................ 61
Working with Crosstab Tables ............................................................................................................................... 62
Using the Crosstab Table Wizard....................................................................................................................... 62
Crosstab Table Basics ........................................................................................................................................ 64
Creating a Crosstab Table Manually .................................................................................................................. 66
Working with Crosstab Columns ....................................................................................................................... 66
Arranging and Sizing Columns ........................................................................................................................... 68
Comparing, Sorting, and Summarizing Columns ............................................................................................... 69
Displaying Column Detail................................................................................................................................... 73
Working with the Crosstab Filter....................................................................................................................... 74
Planning an Example Crosstab Table ................................................................................................................. 76
Building the Basic Table Structure..................................................................................................................... 77
Adding Extra Crosstab Values ............................................................................................................................ 78
Summarizing Value Rows .................................................................................................................................. 80
Adding a Header Row ........................................................................................................................................ 81
Summarizing Value Columns ............................................................................................................................. 82
Customizing Data Table Appearance .................................................................................................................... 84
Assigning Classes to Table Components............................................................................................................ 84
An Easier Way to Assign Classes........................................................................................................................ 86
Paginating Data and Printing Reports ................................................................................................................... 88
Paginating Data Tables ...................................................................................................................................... 88
Creating “Printable” Reports ............................................................................................................................. 92
Resources and Support.......................................................................................................................................... 97
ii
Introduction
This publication introduces developers to the use of Data Tables in Logi applications as developed using Logi
Info.
Logi Info is a tool that allows developers to create and run comprehensive reporting solutions and web applications, using a full range of business analytics features and components.
Documentation for Logi Analytics products, available on the Logi Developer Network web site, will always present the most up-to-date information. Specifically, you can look there for the newest features; publications like
this one are by their nature more difficult to keep current.
Unlike products based on client-server technology, Logi Analytics’ products were conceived to be web-based
from the start. They output only HTML and script to the end-user’s browser and as a result achieve simplicity,
cross-browser compatibility, and an ease-of-use that eludes other products. At the same time, this means that
some of the flashier functionality of desktop applications or downloaded custom components is not available.
However, the resulting minimal configuration management requirements and tighter security of Logi products
provides ample proof of the correctness of its approach, especially in an enterprise setting.
The DevNet web site includes numerous free sample applications that can be quickly downloaded and that
provide a great learning opportunity for new developers. Frequently the sample apps mirror the examples in
the documents on DevNet. Logi developers are urged to take advantage of these sample apps.
What should the Logi developer already know? A prospective Logi developer should already have a good understanding of general web technologies, such as HTML and style sheets, and be familiar with their data
sources and the techniques, such as SQL, needed to access that data. Experience with JavaScript is useful but
not required.
What information is not presented here? Developers must have an understanding of the data they want to
work with and the techniques, such as SQL queries, required to access that data. The assumption is made that
developers have these skills themselves or have access to others within their organizations with them and the
specifics of these topics are not included here.
We hope you enjoy working with these products and quickly become productive and successful with them.
Comments about this publication are welcomed and can be addressed to DevNet@Logianalytics.com.
Data Analysis using Data Tables
1
Using the Data Table Wizard
The fastest and easiest way to create a data table is to use the Data Table Wizard in Logi Studio. Here's how:
1. As shown above, in a definition in Logi Studio, select an element and either click the Data Table item in
the main menu's Wizards tab, or right-click the element and select Element Wizards, and then select
Add a Data Table from the secondary menu.
2
Data Analysis using Data Tables
2. A series of dialog boxes, shown above, will be displayed. These all relate to the retrieval of the data.
Make appropriate selections for your application and click Next to move to the next dialog box.
Data Analysis using Data Tables
3
3. The wizard will display a model data table in a dialog box, where you can adjust it, if desired. If the table is just as you want it, click Next to exit the wizard. If not, you can continue the customization, using
the features identified above:
1- Click these buttons to add calculated or "Formula" columns, and to Filter the data based on column
values;
2- Click the Gear icon to display the table's Configuration Panel (discussed below);
3- Hover your cursor over a table column header and use the drag handles that appear to change the
column width or rearrange column order. Click the header text to see a configuration menu for that
column (discussed below);
4- Select the maximum number of rows to be retrieved.
When you're done, the Wizard will add all of the elements for the table to your definition. Only the table itself
will be added, not any of the configuration controls you've just worked with. The wizard automatically gives
each column interactive sorting capabilities.
Table Configuration Panel
If you click the Gear icon, the table's Configuration Panel will be displayed:
4
Data Analysis using Data Tables
As shown above, the Configuration Panel includes these controls:





Columns - Select the columns that will be displayed (displayed vs. retrieved in the data).
Sort - Specify the sort order of the data after it's been retrieved.
Group - Specify the grouping of the data after it's been retrieved.
Aggregate - Add new columns for aggregations including Sum, Average, Standard Deviation, Count,
Distinct Count, Minimum, and Maximum.
Paging - Specify whether the table will use paging and, if so, how many rows will be shown per page.
Click the Gear icon again to hide the Configuration Panel.
Column Configuration Menu
If you click a column's header text, a pop-up Configuration Menu for that column will be displayed:
Data Analysis using Data Tables
5
Options on that menu allow you to do some of the same thing you can do in the Configuration Panel but other
options, like Format, work specifically on the selected column. Changes in the displayed table will take affect
immediately.
If you already have your data table and datalayer elements added and configured, another wizard - "Add Data
Columns" - is available when you select the Data Table element and is really useful if you don't have a list of
table columns handy.
6
Data Analysis using Data Tables
Retrieving Data
The first step in displaying data is to retrieve the data and Logi products make it easy to do that. The
“datasource” can be any one of a wide variety of databases, web services or feeds, or flat files.
A datasource can be one of the following:






OLEDB-, ODBC-, or JDBC-compliant databases
.XML, .CSV, Excel, JSON and other data files, and hard-coded, static data
LDAP directories
Web server file system information
Web Feeds, Web Services, or Web Pages
Your Logi application's metadata
Using the Connection Wizard
The fastest and easiest way to add and configure a Connection element to your application is to use one of
Logi Studio's Connection Wizards. Here's how:
Data Analysis using Data Tables
7
1. As shown above, in the _Settings definition in Logi Studio, select the Connections element and either click
a Connection item in the main menu's Wizards tab, or right-click the element and select Element Wizards,
and then select an Add a Connection item from the secondary menu. For this example, we'll add a Database Connection.
2. A series of dialog boxes, like those shown above, will be displayed. You'll be asked to identify the server,
the database, and to provide server login credentials. Provide appropriate information for your datasource
and click Next to move to the next dialog box.
8
Data Analysis using Data Tables
3. Finally, the connection between Studio and the database server will be tested, as shown above. When you
click Next and Finish, an appropriately configured Connection element will be added to the _Settings definition.
That's it - your connection is ready to be used.
Connection Basics
Your Logi application connects to the datasource in order to retrieve data from it. In most cases, this is done
using a Connection element which specifies the nature of the communication with the datasource, including
security credentials.
The exceptions are certain kinds of flat files, such as XML, CSV, and Excel files, which your Logi application is
able to access directly through a web server’s file system. These situations employ datalayers (data retrieval
elements) and do not need Connection elements.
Connection elements are configured in the _Settings definition and are therefore available application-wide.
One connection can be used for multiple report definitions, and a Logi application can have multiple connections, allowing data from multiple sources to be included in a single report. There are three types of Connection elements:
Vendor-Specific Connections
Vendor-specific connection elements, such as Connection.MySQL, are the connections we recommend you
use. They provide the best performance and easiest configuration (they do the job of creating a connection
string for you in most cases, using the values you enter as attributes). Connection strings are text strings that
are passed in code to an underlying driver or provider in order to initiate the connection. The available vendorspecific Connection elements include:







Connection.DB2
Connection.Google Maps
Connection.Google Docs
Connection.MondoDB
Connection.MySQL
Connection.Oracle
Connection.PostgreSQL







Connection.Redshift
Connection.Salesforce
Connection.SimpleDB
Connection.SQLServer
Connection.Sybase
Connection.Twitter
Connection.Vertica
Your Logi product, in combination with the .NET framework or Java libraries, contains all of the underlying
drivers or providers necessary to make all of these connections work, except for three:
Due to licensing restrictions, the DB2 and Sybase connections are only usable if you have the client or provider
software that's distributed with the database server. You can download the DB2 software - see the DB2 Usage
Notes later in this document. In the case of the Sybase connection, you must have installed the ADO.NET 2.0
data provider from Sybase, which is typically included on your Sybase CDs or can be downloaded from the
Sybase web site. Logi Info does not include providers for these two connections..
Connection.SQLServer is for use with Microsoft's SQL Server database server. Connection.Twitter uses the
Twitter API to interact with the popular social networking web site.
Data Analysis using Data Tables
9
Connection.Google Docs - Google, as of mid-June 2015, added a optional, additional layer of security for its
services. The Connection.Google Docs element does not make use of this additional security and you may need
to configure your Google account to allow that. If you get "invalid account or password" error messages when
you run your Logi application, try these two steps:

Go to this link - https://accounts.google.com/b/0/DisplayUnlockCaptcha - login with the account used
to configure the Connection element and allow access to be able to sign in from a new device/application.

Go to this link - https://www.google.com/settings/security/lesssecureapps - login and, as shown
above, "Turn on" access for "less secure apps".
Note that this affects all apps using your account.
Generic Connections
Generic connection elements, such as Connection.OLEDB, require you to provide, or use a wizard to construct,
a connection string. The available generic Connection elements include:




Connection.ADO
Connection.JDBC
Connection.LDAP
Connection.ODBC



Connection.OLAP
Connection.OLEDB
Connection.SMTP
Connection.ADO enables data connections using ADO drivers, such as HPCC from CData. These
connections are normally used with DataLayer.SQL elements.
The following example Connection.ADO example works with HPCC clusters:
10
Data Analysis using Data Tables
<Connection Type="ADO"
AdoAssembly="System.Data.CData.HPCC.dll" ID="HPCC"
AdoConnectionString="URL=http://192.168.193.242:8510;Offline=false;
Cluster=yourCluster;Version=1" CommandTimeOut="30" />
ADO connections work with Logi .NET applications only; they are not usable in Java applications. This connection element allows you to use ADO-style drivers that you may develop yourself, however, Logi does not guarantee your driver will work.
Connection.OLAP is used for connection to XML/A OLAP databases and Connection.SMTP is for connecting to
SMTP email servers. The other generic elements are for connection to a variety of databases.
For example, the Connection.OLEDB element allows you to use the Microsoft Jet driver to connect to MS Access database files and can also be configured to connect to Microsoft's SQL Server database server. Note that
Microsoft elected not to include the MS Jet driver in its 64-bit OS versions, but it is possible to use the "MS
Ace" OLEDB driver, distributed with Office 2007, instead.
Special-Purpose Connections
Special-purpose connection elements, such as Connection.Web Service, are designed to ease communication
with specific web services or Logi services. The available special-purpose Connection elements include:



Connection.DataHub
Connection.HTTP
Connection.REST


Connection.Scheduler
Connection.Web Service
Connection.DataHub is used to connect to our Logi DataHub data virtualization product.
Connection.Logi Application Service is used to connect to special Windows services installed
with add-ons such as the Discovery Module.
Connection.OData, and its OData Parameters child element, allow connection to REST-style
APIs.
Connection.HTTP allows the following datalayers to use a connection to an HTTP or HTTPS datasource that
requires authentication:





DataLayer.CSV
DataLayer.Excel
DataLayer.File Format File
DataLayer.GPX File
DataLayer.JSON File




DataLayer.KML File
DataLayer.Web Feed
DataLayer.Web Scaper
DataLayer.XML File
Connection.REST and Connection.Web Service are similar, in that they both connect to web services. However, Connection.REST works with Representational State Transfer (REST) protocols, such as HTTP, and Connection.Web Service works with the SOAP protocol.
Data Analysis using Data Tables
11
The Request Header element was added as a child of Connection.HTTP and Connection.REST. This element
allows custom information, primarily intended for authentication purposes, to be sent through the connection
in the HTTP request header.
Connection.Scheduler is used with the Logi Scheduler service provided in Logi Info to manage scheduled reporting. The other connection elements are used with web services.
The Studio Connection Element
Logi Studio includes tools, like the SQL Query Builder and the Database Browser, and normally
uses the configured Connection elements to transparently connect these tools to the data during development.
However, for a variety of reasons, the Windows development machine where Studio is installed may not be
able to use the configured data connections. For instance, the driver may not be installed on, or may be incompatible with, the Windows machine running Studio. In this case, a special Studio Connection element can
be added to provide a separate connection for Studio's tools. Studio Connection is available as a child of the
following connections:





Connection.DB2
Connection.JDBC
Connection.MySQL
Connection.Oracle
Connection.PostgreSQL




Connection.Redshift
Connection.SQLServer
Connection.Sybase
Connection.Vertica
Using Vendor-Specific Connections
Vendor-specific Connection elements are designed to make configuring a connection very simple.
As shown in the example above, a Connection.MySQL element has been added to the _Settings definition in
an application. Its attributes allow the developer to specify the server name, database name, and access credentials. At runtime, whatever connection string may be required will be automatically created behind-thescenes using this information. The developer does not need to know the specific format of the connection
string.
12
Data Analysis using Data Tables
Optional parameter elements, as shown above, can be added beneath the connection element. These provide
the flexibility of including additional connection string parameters, if necessary.
For example, the optional parameters for the MySQL connection include Compress, Connection Lifetime, Direct, Embedded, Port, Protocol, and Unicode.
The other attributes for the MySQL and similar connection elements, are:
Attribute
Description
ID
(Required) A unique element ID; referred to by datalayer elements that use
this connection.
Command Timeout
Specifies the amount of time, in seconds, before the request to connect to
the datasource is presumed to have failed. For most datasources, the default value is 60 seconds. For MySQL, the default is 30 seconds.
MySql Connection String
A fully-formed connection string for the MySQL database. If a value is defined here, all other attributes will be ignored and this string will be used to
connect to the database. Any child parameter elements are processed and
added to the connection string.
MySql Port
The port address of the MySql database. Default: 3306.
In general, vendor-specific connection are much easier to configure than generic connection and developers
should look to them first when creating applications.
Using Generic Connections and Connection Strings
An alternate method of creating a connection is to use one of the generic Connection elements, which requires
that you provide a connection string for it.
Data Analysis using Data Tables
13
In the example shown above, a Connection.OLEDB element has been added to the _Settings definition. It's
Connection String attribute has been configured with a connection string, which looks like this in its entirety:
Provider=SQLOLEDB.1;Password=password;Persist Security Info=True;User ID=user;Initial Catalog=Northwind;Data Source=myDBServer
You can see that the connection string has a specific format, which is unique to the connection type. The Connection.OLEDB element can invoke a special wizard to build its connection string; for all other connections,
developers will need to provide an appropriate string.
The Data Link Properties wizard, shown above, assists in the creation of connection strings for the Connection.OLEDB element. In Studio, click the little browse button at the end of the element's Connection String attribute value to invoke the wizard.
The Test Connection button only ensures network connectivity to the database server - it does not guarantee
that the User Name and Password entered are valid! The test can be successful and yet you may still not be
14
Data Analysis using Data Tables
able to access the data if the credentials are wrong. If providing specific credentials, be sure that you enter
them carefully and check Allow saving password.
This very useful web site: http://www.ConnectionStrings.com provides example connection strings for a wide
variety of datasources and can assist in providing the proper format for strings for other connection types.
With ActiveSQL
If Connection.JDBC or Connection.ODBC is used with DataLayer.ActiveSQL, you must configure the Connection
element's optional SQL Syntax attribute for the appropriate database's SQL version.
Notes for Java Developers
When using Connection.JDBC element, specifying an IP address instead of a host name in the connection
string may significantly increase the connection opening time, due to the underlying Java implementation.
Therefore, it is recommended that developers use host names, not IP addresses, in connection strings to minimize the time it takes to open a connection.
Logi Studio includes tools, like the SQL Query Builder and Database Browser, and uses information from the
Connection elements to transparently connect these tools to the data. However, as a .NET application, Studio
can't use the information from Connection.JDBC for this purpose. So,Logi Studio includes a special element,
Studio Connection, a child of Connection.JDBC, which lets developers specify separate, nonJDBC connections for Studio's tools.
The Connection.SMTP element supports TLS/SSL authentication in our Java products only. This allows connection ot Gmail and other similar services that will programmatically send email on your behalf. Set the element's
SMTP Authentication Mode attribute to 3 to select TLS/SSL.
Using Special-Purpose Connections
Special-purpose connections are used to connect to specific web services or to the Logi Scheduler service (Logi
Info only). All require credentials to authenticate the connection.
In the example shown above, a Connection.Web Service element has been added to the _Settings definition.
The attributes identify specific aspects of the web service. As with all connections, a unique ID is required so
that it can be referenced later by datalayer elements.
Data Analysis using Data Tables
15
For developers connecting to their own web service, note that the WSDL document specified in this connection
element's required WSDL URL attribute must be "valid", meaning that it can contain no errors that would
cause it to fail to compile. A document that's readable but that will not compile is invalid and will cause the
connection to fail.
Connection.Web Service has an optional child element, Connector Property Parameters, which makes it possible to connect to a web service which requires special authentication and proxy settings.
In the example shown above, a Connection.REST element has been added to the _Settings definition. Its Url
Host attribute identifies the web service host address, and other attributes are used to provide user credentials, if required. As with all connections, a unique ID is required so that it can be referenced later by datalayer
elements.
Creating Dynamic Connections
You may want to create dynamic connections, which connect to a datasource based on external criteria. Connection elements make this possible by accepting tokens in their attributes.
In the example above, tokens are used in the attributes of the Connection.SQL Server element. Another approach is to assign a complete connection string to a Session variable and use its token in the Connection
String attribute, as shown above right. A value in that attribute will cause the "required" attributes to be ignored.
16
Data Analysis using Data Tables
Finally, you can enter the literal connection string text into that attribute, as shown above, and tokenize parts
of it, like this:
Server=@Session.DBServer;Database=@Session.DBName~;User Id=@Function.UserID~;
Password=@Session.DBPassword;
There are a variety of techniques available for setting the token values prior to the processing of the _Settings
definition. For Logi Info developers, the Startup Process element, when included in _Settings, can be used to
call a Process task that assigns the Session variables needed. This task will run before the Connection elements
are processed.
The example shown above is simplistic but shows you how to use a Process task to set Session variables, which
can be used later as tokens in the Connection element's attributes.
If you're unable to use the Startup Process element for some reason, you can still make the Process task run by
calling it directly, rather than calling the default report definition:
http://yourServer/yourLogiApp/rdProcess.aspx?rdProcess=yourProcessDefinition&
rdTaskID=taskStartUp
Connecting with Metadata
Metadata files were introduced in Logi Info v11.3.049 and they can be used with the Analysis Grid and Active
Query Builder elements to provide a dynamic data environment for end users. Metadata files are created by
developers using a wizard in Logi Studio during application development and they can be highly tailored to
present desirable data objects and relationships. Numerous data qualities, including formatting, security restrictions, and joins, can be specified.
Data Analysis using Data Tables
17
The Metadata element is used to identify the metadata files to be included with a data connection. The following Connection elements can use the Metadata element:





Connection.DataHub
Connection.DB2
Connection.JDBC
Connection.MySQL
Connection.Oracle




Connection.PostgreSQL
Connection.RedShift
Connection.SQLServer
Connection.Vertica
Information about building metadata files can be found in our Using the Metadata Builder Wizard document.
Retrieving Data into a Datalayer
The “datalayer” is a mechanism that retrieves data from the datasource via a connection and caches it to temporary storage. During the retrieval, the data can be shaped using filters and conditional processing. The
datalayer is where the data retrieval commands, such as a SQL query, as configured.
Cached data may be temporarily stored in memory or on disk; Logi applications handle this dynamically and
also clean-up any left-over data when the session ends.
When a datalayer “runs”, it retrieves the data and caches it, then iterates through it record by record, and
each record’s data is processed based on the rest of the Logi report definition.
There is a correlation between the type of datalayer used in a report and the connection to the data source. A
DataLayer.WebService element is used with a Connection.WebService element, for example.
For connections to databases that use SQL, such as Connection.MySQL, the appropriate datalayer is usually
DataLayer.SQL.
Some of the available DataLayer elements include:











DataLayer.Cached
DataLayer.CSV
DataLayer.Definition List
DataLayer.Directory
DataLayer.Excel
DataLayer.Fixed File Format
DataLayer.Google App
DataLayer.Google Spreadsheet
DataLayer.JSON File
DataLayer.LDAP
DataLayer.MongoDB











DataLayer.Plugin
DataLayer.REST
DataLayer.SimpleDB
DataLayer.SP
DataLayer.SQL
DataLayer.Static
DataLayer.Twitter
DataLayer.Web Feed
DataLayer.Web Service
DataLayer.Web Scraper
DataLayer.XML File
There are several more but they’re not relevant to our discussion of data tables at this time. See the Introduction to Datalayers document on DevNet for more information.
18
Data Analysis using Data Tables
Many datalayers are run by the Logi Engine in separate threads, which means that data retrieval time is limited
to the longest running query, rather than the number of queries, resulting in excellent performance. This includes all datalayers except the following: Local Data datalayers, DataLayer.Linked, DataLayer.XML File,
DataLayer.Cached, DataLayer.Bookmark, DataLayer.Static, and any datalayer whose data is displayed using the
Auto Columns element.
Data Engine performance, when processing large numbers of DateTime-type columns in a result set, can be
significantly improved by skipping Time Zone processing, if it's not needed in the application. This is done using
a special constant in the _Settings definition:
rdSQLIncludeGMTOffset = False
However, this feature does not offer improved performance with small numbers of DateTime columns.
Using the Data
The following example shows how the data in a data table corresponds with the XML data retrieved using
DataLayer.SQL to query the Northwind database:
The SQL query used was:
SELECT EmployeeID, LastName, FirstName, Title FROM Employees
Data Analysis using Data Tables
19
The Logi Engine converts data retrieved from any datasource into XML. Each row from the datasource is equivalent to one XML element and each column is equivalent to one XML attribute. For example, the data table
shown above contains four columns and nine rows, which is equivalent to nine XML elements, each with four
attributes.
Data retrieved into the datalayer is cached in XML format in memory and/or on the web server's file system.
The latter is discussed in the document The Logi Server Engine and may be of interest to developers working
with extremely large datasets or large numbers of concurrent users.
Data retrieved into the DataLayer.XML File and DataLayer.Web Service elements may need to be reformatted
for use, and the XslTransform element is available for this purpose.
Use of "bracketed" column names, such as "[Order Date]", is supported. The brackets allow column names to
include spaces, special characters, or SQL reserved words.
The data retrieved with a datalayer is available using @Data tokens, in the format @Data.ColumnName~. The
spelling of the column name is case-sensitive.
For example, @Data.LastName~ retrieves all values, in all rows, for the LastName column. This might sound as
if you get all the data in one place in your report but you don't. When the reporting engine generates the report, it iterates through each row in the datalayer; the @Data token at any point in time represents the value
in a column for the current row in the iteration.
You can see the actual XML data after it's been retrieved for any report in the Debug Trace Report; see Debugging Reports to learn more about troubleshooting datalayers.
Data Scope and Local Data
The availability of data is generally limited to the container (Data Table, Chart, etc.) which is the parent element of the datalayer element used to retrieve the data. The following example illustrates the use of multiple
datalayers and the availability of their data.
20
Data Analysis using Data Tables
1. The Data Table element within the div1 division can only use data from DataLayer_1 datalayer.
2. The chart's Series.Area element within the div2 division can only use data from the DataLayer_2
datalayer.
3. The Data Table element within the div3 division can also use the data from DataLayer_1 by virtue of
the two elements, Data Layer Link and DataLayer.Linked, which link it to the datalayer's cached data.
Linking datalayers is a very useful practice, allowing the data retrieved into one datalayer to be available for reuse in another. This eliminates extra datasource queries and improves performance. For more information, see
our document Linking Datalayers.
A special data container element, Local Data, can be used to make data available anywhere within the report:
As shown above, Local Data is a child of the report root element, not of the Body or other lower elements. The
data retrieved by Local Data's child datalayer is accessed using a special @Local tokens, in the format
@Local.ColumnName~. These tokens can be used anywhere in the report, and this is an excellent way to use
data, for example, in headers and footers.
There is a caveat, however: @Local tokens can only access the first row of the data. Local Data is particularly
useful, therefore, for "lookups" that return a limited amount of data.
Multiple Local Data elements can be used in the same report definition. In the data retrieved, the effect is a
"Union" of all the Local Data data.
You can use the linking elements shown earlier to link the Local Data datalayer to other datalayers in the report definition, which then provides access to all rows of data in the Local Data datalayer. However, the linked
data will then be subject to the same rules as those for any other datalayer (scope limited to parent element
and accessed using @Data tokens).
Local Data datalayers are run before other datalayers, so data from them can be used to condition the retrieval
of data by other datalayers. Local Data runs its datalayer every time any element in the report is refreshed; this
may have performance implications and make it less desirable.
The Local Data element has a Condition attribute. If the value of this attribute is left blank or contains a formula that evaluates to True, then the element's child elements (its datalayers) will run. If the value evaluates to
Data Analysis using Data Tables
21
False, the element is ignored and the datalayers are not run. This allows developers to dynamically determine
when the Local Data should be run, or re-run if a page is refreshed (in this case, a @Request token can be used
in the formula in the Condition attribute).
Manipulating the Datalayer
Once data has been retrieved into a datalayer, a number of elements can be used to manipulate its data. This
is generally done by either re-arranging rows, removing rows, or by adding/removing columns in the datalayer.
This arrangement allows the kind of dynamic data shaping found in a SQL query to be applied to data regardless of its source. So, for example, the equivalent of the WHERE and GROUP BY clauses in a SQL query can be
applied to a non-SQL datasource such as an XML data file.
Elements that “add” new columns to the data do so by including new columns in the cached XML data; the
original data, for example, on the database server, is not affected.
Here are just a few of the elements that can be used to shape data in a datalayer:






Aggregate Column
Calculated Column
Condition Filter
Difference Column
Formatted Column
Group Filter






Join
Moving Average Column
Running Total Column
Sequence Column
Sort Filter
Time Period Column
Datalayers can also be “joined”, another SQL-like feature that combines, compares, subtracts, and sorts data
that has already been retrieved into two datalayers. Once again, this is very useful for manipulating data that
comes from different and/or non-SQL datasources.
Datalayer Element IDs
Element IDs for datalayers are optional. However, we recommend that you always provide a unique datalayer
element ID anyway, for ease in understanding the definition and, significantly, so that the datalayer is easily
identified in the Debug Trace page.
The Include Condition Attribute
All of the datalayer manipulation elements have an Include Condition attribute. If the value of this attribute is
left blank or contains a formula that evaluates to True, the element is applied to the datalayer. If the value
evaluates to False, the element is ignored and does not affect the datalayer. This powerful feature allows developers to dynamically determine if the datalayer will be manipulated or not.
Datalayer Error Handling
The If Data Error element allows developers to handle errors, such as a failure to find or connect to data
sources, or missing or corrupt data files, that may occur while retrieving data into a datalayer. In this way, er-
22
Data Analysis using Data Tables
rors are trapped and processing can be switched to alternate data sources, instead of displaying the system
error page.
The Accessing Data section of the technical articles on DevNet offers numerous documents that discuss the
behavior and use of these kinds of elements in greater detail.
SQL Query Example
One of the most common usages of the datalayer is to retireve data from a database. The next two examples
show how to use a datalayer to retrieve data from a SQL database and they assume an appropriate Connection
element for the database server has already been configured.
This example uses DataLayer.SQL to run a query. The datalayers's Source attribute value contains the actual
SQL statement to be executed and any valid SQL code can be used. This example uses a connection to a Microsoft SQL Server database.
The example above shows a simple SQL query that returns data to a simple data table.
Data Analysis using Data Tables
23
However, as shown in the example above, the Source attribute value (opened in the Attribute Zoom window)
can consist of multiple SQL statements. They will all be executed, as long as the syntax is correct, and any results will be returned to the datalayer. The Attribute Zoom window is opened for any attribute by doubleclicking the attribute name.
While the multi-statement capability makes it easy to use queries in DataLayer.SQL, your best performance for
complex SQL queries is still to be found by using stored procedures, and the DataLayer.SP element is used to
work with them:
In the example shown above, DataLayer.SP is used to call a stored procedure. Using stored procedures provides the best protection against a SQL Injection attack.
An SP Parameters element, and one SP Parameter element for each parameter, are used to pass arguments to
the stored procedure and to receive output values. The result set from the stored procedure is retrieved into
the datalayer.
The order of the SP Parameter elements, not their IDs, is used to determine their correlation to the declared
variables in the stored procedure code. More information is available in our DataLayer.SP document.
24
Data Analysis using Data Tables
Using the Data Table Wizard
The fastest and easiest way to create a data table is to use the Data Table Wizard in Logi Studio. Here's how:
1. As shown above, in a definition in Logi Studio, select an element and either click the Data Table item in the
main menu's Wizards tab, or right-click the element and select Element Wizards, and then select Add a Data Table from the secondary menu.
Data Analysis using Data Tables
25
2. A series of dialog boxes, shown above, will be displayed. These all relate to the retrieval of the data. Make
appropriate selections for your application and click Next to move to the next dialog box.
26
Data Analysis using Data Tables
3. The wizard will display a model data table in a dialog box, where you can adjust it, if desired. If the table is
just as you want it, click Next to exit the wizard. If not, you can continue the customization, using the features identified above:
1- Click these buttons to add calculated or "Formula" columns, and Filter the data based on column values;
2- Click the Gear icon to display the table's Configuration Panel (discussed below);
3- Hover your cursor over a table column header and use the drag handles that appear to change the column width or rearrange column order. Click the header text to see a configuration menu for that column
(discussed below);
4- Select the maximum number of rows to be retrieved.
Table Configuration Panel
If you click the Gear icon, the table's Configuration Panel will be displayed:
Data Analysis using Data Tables
27
As shown above, the Configuration Panel includes these controls:





Columns - Select the columns that will be displayed (displayed vs. retrieved in the data).
Sort - Specify the sort order of the data after it's been retrieved.
Group - Specify the grouping of the data after it's been retrieved.
Aggregate - Add new columns for aggregations including Sum, Average, Standard Deviation, Count,
Distinct Count, Minimum, and Maximum.
Paging - Specify whether the table will use paging and, if so, how many rows will be shown per page.
Click the Gear icon again to hide the Configuration Panel.
Column Configuration Menu
If you click a column's header text, a pop-up Configuration Menu for that column will be displayed:
28
Data Analysis using Data Tables
Options on that menu allow you to do some of the same thing you can do in the Configuration Panel but other
options, like Format, work specifically on the selected column. Changes in the displayed table will take affect
immediately.
When you're done, the Wizard will add all of the elements for the table to your definition. The wizard automatically gives each column interactive sorting capabilities.
Only the elements for the table itself will be added, not any of the wizard's configuration controls you've
just worked with.
If you already have your data table and datalayer elements added and configured, another wizard - "Add Data
Columns" - is available when you select the Data Table element and is really useful if you don't have a list of
table columns handy.
Data Analysis using Data Tables
29
Data Table Basics
Data tables in Logi reporting products are dynamic, data-driven reporting components. Unlike basic HTML tables built using the Rows, Row, and Column Cell elements, data tables are designed column-by-column rather
than row-by-row.
As shown above, every data table must have the following components:




A Data Table element
One or more Datalayer elements to retrieve and cache the data
One or more Data Table Column elements to display each column
One or more report content elements, such as a Label, to present the data
This column-wise approach can be confusing. Just remember that, at runtime, every record in the datalayer will
be iterated and rows for all of the data will be displayed in the table.
Developers create and configure each column, while the number of rows is entirely dependent on the size of
the result set returned by a specific database query.
The Data Table Column element, for example, is configured to provide the column header text, column width
(if not automatically determined), and so forth.
The actual data values in the datalayer are accessed using tokens, such as @Data.CategoryID~, where the second part of the token is the column name in the datalayer. This case-sensitive token can be used in Label element Captions, for example, to display the data. See our document Token Reference for more information
about tokens.
Tabular vs. Form Format
The most common way to design data tables is to have a Data Table Column element for each column in the
datalayer.
30
Data Analysis using Data Tables
Note: the table shown above has had style applied to it to specify its fonts, borders, and background colors. An
easy way to quickly style a data table is to apply a Theme to your report definition.
This works well when you have many columns that you want to show in a tabular format, as shown above.
The order of the columns in the displayed data table is governed by the order of the Data Table Column elements in the definition. The top-most of these elements in the definition will be the left-most column in the
displayed data table. Developers are free to rearrange the order of columns by selecting a Data Table Column
element in Logi Studio and dragging it, or by using the Up/Down Arrow buttons in the toolbar. This is particularly useful if a wizard has been used to create the data table and a different column arrangement is desired.
However, this type of one-to-one correspondence is not required and developers have complete freedom over
the way data is presented in a report. Suppose, for example, that you don't want a tabular format:
Suppose instead you want to stack the data in a kind of form when you display it. This is easy to do, as shown
above. The data is presented in a form-like manner by using just one Data Table Column element and placing
multiple Label elements within it. Each Label element displays the data from a different data column in the
datalayer.
There's no limit on the number of elements you can place beneath a single Data Table Column element and
you can, in fact, even place HTML tables and charts there!
Data Analysis using Data Tables
31
Important Scope Limitation
The scope, or availability, of the data in a datalayer is limited to the Data Table element that contains it, and its
child elements. So, looking at the example above, if the datalayer dlCategories contains a column named
CategoryID, then @Data.CategoryID~ is valid in all elements beneath the data table dtCategories. However,
the token will be null if you attempt to use it in the Report Header element.
Tip: The only exception to this scope limitation is the Local Data element. Datalayers used with this element
can only retrieve one result row, but its data is available, using the @Local.columnName~ token, anywhere in
the report definition.
Creating a Data Table Manually
You can create a data table in Studio manually by adding the appropriate elements to a report definition.
To do this, simply add the necessary elements to your definition in Studio. After you add your first Data Table
Column and its child elements (Label, Sort, etc.), you can speed things up by copying and pasting it into the
element tree as many times as necessary, then going back and configuring the individual elements. Copying
the Data Table Column element will also copy all of its child elements, too.
In these circumstances, the issue of spelling becomes more important. @Data tokens are case-sensitive and
column names must be spelled accurately. To ensure that you know exactly how column names are spelled,
you may care to turn on debugging and view the actual data in the datalayer. See our document Debugging
Reports for more information about debugging.
Data Table Attributes
The Data Table element has a number of attributes. Note that Themes automatically set a number of these
attributes "behind-the-scenes".
Attribute
Description
ID
Required. A unique ID for this data table.
Accessible Headers
Specifies whether or not to set the HTML "Headers" attribute, which can improve the
accessibility and readability of tables. Default value: False.
Accessible
Summary
Specifies whether or not to create a "table content summary", which has no visual
effect but is used by screenr readers to improve accessibility. Default value: False
AJAX Paging and
Sorting
Enables AJAX-style paging and sorting. When the user moves to another page, or
sorts a Data Table, only the table portion of the page is updated. This method prevents the web page from flickering or losing the scroll position. This alters the behavior of the browser's "Back" button because the page history does not get updated
with AJAX Paging enabled. Default: False
Alternate Row
Class
Specifies a style class to be used for every other row of the table, making it easier to
read across the columns in single row. Themes include a class
called ThemeAlternatingRow which you can assign, if desired.
32
Data Analysis using Data Tables
Border
Specifies, in pixels, the width of a border, if any, to be displayed around the table. A
value of 1 displays a thin border. Default: 0 px
Caption
Specifies the text of a caption, or "title", that will appear above the table. Leave this
blank to suppress it.
Caption Class
Specifies a style class to be applied to the caption text from the previous attribute.
Cell Spacing
Specifies the width, in pixels, of the space between table cells, if any. Default: 0
Class
Specifies a style class to be applied to the table as a whole.
Column Header
Class
Specifies a style class to be applied to the column headers.
Draggable Columns Specifies if the user can reposition columns by dragging the column header side-toside. When enabled, any changed column positions are remembered for the table for
the current session. Draggable Columns may not be used when there are custom
header rows in use with columns that span multiple columns. Default: False
Hide When Zero
Rows
Specifies it the Data Table is to be hidden when the datalayer returns zero rows.
Default: False
Keep Scroll
Position
When enabled, causes the browser's horizontal and vertical scroll positions to be retained when the current report is redisplayed without first going to another report.
Use this to refresh the current report while avoiding resetting the scroll position to
the top. Default: False
Layout
Specifies if the table layout should be automatically determined by all the data (Auto)
or just the first row of data (Fixed). If Fixed is specified, the column layout is determined based on the width of the values in the first data row, instead of adjusting the
column widths by examining data in every row. This can help with formatting issues,
and can also significantly improve large table performance. Default: Auto
Remember Sort
Specifies whether or not to retain the user's sort selection. When True, and the user
sorts the data table on a particular column, the report will be redisplayed with the
same sort order the next time the report is displayed. Sort selections are retained
only for the user's current session. Default: False
Resizable Columns
When enabled, a small icon appears on the right edge of the column header when
the mouse hovers over it and the user can resize columns at runtime by dragging the
icon right or left to a different width. The updated column width are remembered for
the table for the duration of the current session. You may not use Resizable Columns
when there are custom header rows in use with columns that span multiple columns.
Default: False
Row Class
Specifies a style class to be applied to the table rows. This value can be an @Data
token, so the class can be applied dynamically based on the data.
Security Right ID
When specified, access to this element can be controlled with Logi Security. Specify the ID of a Right defined in the application's _Settings Security element. Only users
with matching rights will be able to see the element.
Sort Arrows
Specifies whether Sort direction indicators (arrows) will be displayed when the user
clicks a column header to sort the table. Default: False
Width
Specifies the total width of the data table.
Width Scale
Specifies the scale to be used when applying the value of the previous attribute, px
for pixels, or % for percentage of the table's parent container's width.
Data Analysis using Data Tables
33
In general, the fewer attributes you have to set for a Data Table, the better. Let a Theme or the browser figure
out the best combination of attributes for you.
About Table and Column Widths
Browser engines are designed to do the best job they can with HTML tables (which is the structure underlying
a Data Table) when it comes to automatically figuring out column widths.
Here are two tips to make widths work for you. First, always set a width for Data Tables. Second, if you're concerned about ensuring that one or two columns have a specific width, then set those widths in the appropriate
Data Table Column elements and leave the widths for the other Data Table Column elements blank. You don't
need to try to figure out what the width of every column will be, ensuring it all adds up to 100% of the table
width. The browser will try to guarantee the widths you've specifically set and will divide and allocate the remaining space among the remaining columns, when it can.
And remember that it is possible to put so many conflicting restrictions (via attribute values) in place that the
browser will get confused and produce weird results. If that happens, try removing width attribute values for
columns until things look normal again, then reconsider the issue.
Data Table Links
A common requirement is to be able to click the actual data in a data table cell and do something with the
clicked value.
The image above shows an example of this, and here are the elements needed to make that work:
As shown above, an Action element is placed beneath the Label element used to display the data in each column. An appropriate Target element is also included
34
Data Analysis using Data Tables
Finally, a Link Parameters element is added, as shown above, to pass a data value to the target.
Using Auto Columns
The Auto Columns element provides an easy method of viewing all datalayer columns without having to know
their names and without loading up a definition with Data Table Column elements. This document discusses
the use of the Auto Columns element.
We don’t recommend use of Auto Columns in a production application. Should you attempt to do so, note
that this element is processed at a different time by the Logi Engine than other elements, which can result in
no data being shown. For example, if you try to use Auto Columns as a child of More Info Row, no data will be
displayed when the More Info Row is expanded.
The example above shows a report definition containing a table with one column and the report output.
Data Analysis using Data Tables
35
However, when an Auto Columns element is used instead of (or with) Data Table Column elements, as shown
above, the resulting report output will contain all of the columns. The column header text of these "automatic"
columns will match the names of the columns in the datalayer. And if you combine Auto Columns with Data
Table Column elements, the automatic columns will always appear to the right of any specified using Data Table Column elements.
The Auto Columns element has no attributes and there are no data formatting options.
How Is This Useful?
Where can this element be used to good effect? Though we don't discount the resourcefulness of developers
in making use of this element in production, it's expected to find use predominantly in development or diagnostic situations, such as:
1. Including an Auto Columns element and remarking/unremarking it during development can provide a
quick way to ensure that the datalayer is actually receiving the expected data.
2. The Auto Columns functionality is useful in situations where the count and names of columns returned
to a datalayer vary dynamically based on a query or situation. For example, imagine that a web service
your application uses suddenly changes the results that it returns; use of Auto Columns can help you
discover the change.
3. Consider this query: SELECT * FROM @Request.TableName~ . In this case, you may not be able to
hard-code the columns in the result as elements in a report definition because the table name varies
and so, possibly, will the column names.
36
Data Analysis using Data Tables
Data Table Columns
Now that the basic structure and operations of data tables have been described, let’s take a closer look at
some of the components of the table. This chapter will help developers customize column headers, add interactive sorting capabilities, and create various types of aggregations based on column data.
Using the Add Data Columns Wizard
Logi Studio provides a convenient wizard for adding columns to a data table. This wizard is especially useful if
you're not sure of the exact number or spelling of column names in the table's datalayer.
You must have correctly configured Connection (if required) and Datalayer elements in your definition
before you can use this wizard.
Select and right-click a Data Table element, as shown above, and use the context menus shown to launch the
Add Data Columns wizard (or use the main menu’s Wizards tab).
Data Analysis using Data Tables
37
The wizard will run the datalayer and present a list of the columns returned in the datalayer, as shown above.
You can then select the columns you want added to the definition.
The wizard will insert elements for the selected columns, including a Data Table Column, Label, and Sort element for each column, into the report definition, as shown above. The elements are configured generically for
immediate use but, at a minimum, you'll probably want to adjust the Data Table Column elements' Column
Header attributes.
38
Data Analysis using Data Tables
Attributes
The Data Table Column element defines the table columns and has the following attributes:
Attribute
Description
Class
Specifies a style class to be applied to the column.
Column Header
Specifies the text to be displayed in the column's heading. In special cases in which an
Extra Header Row element is used to make grouped column headings, and one of its
columns has a Row Span greater than 1, this attribute's value may be set to None. This
prevents the header column from getting created and thus pushing other column
headers into the wrong positions. An image file can be specified here instead of text, if
Header Type is set to Image.
Column Header
Class
Specifies a class for the Column Header text or image. Use this attribute to set the
alignment and other styling of the Column Header text or image. If left blank, the text
or image will be centered.
Condition
Specifies an expression that evaluates to a value of True or False. If True, then the column is displayed, otherwise it's removed. Expressions should be in JavaScript or
VBScript syntax. Typically, expressions compare values using a token, such as
@Data.value~ < 0. Enclose both sides of the expression in quotes when working with
strings: "@Data.myColumn~" == "SomeValue".
Header Type
Specifies if the header will be text (the default) or an image.
ID
Specifies a unique element ID.
Scope Row Header
Specifies if the HTML output for data cells will be modified to improve Section 508 accessibility. Set to True to output a column which includes header information for each
row, changing the <TD> tags to <TH Scope="Row"> tags.
Security Right ID
When specified, access to this element can be controlled with Logi Security. Specify
the ID of a Right defined in the application's _Settings Security element. Only users
with matching rights will be able to see the element.
Show Modes
removed in
Specifies a text string that controsl whether elements will be displayed or hidden.
Leave this blank for the element to always be displayed or set it to None to hide it (it
can be displayed again later with an Action.Show Element element). Set it to your own
string value to have it appear only when the report's (root element's) Show Modes
includes that value. Show Modes can contain multiple, comma-delimited values.
Tooltip
Specifies text that appears when the user hovers the mouse over the column header.
Width
Specifies the width of the element, in Width Scale units.
Data Analysis using Data Tables
39
Width Scale
Specifies the units, pixels or percentage, to be used with the Width attribute.
Working with Column Headers
A column header contains optional information at the top of a specific data table column. Generally, column
headers consist of text but, in a Logi application, they can include images and even user input controls, like
buttons and links. Text or images may be a link that, when clicked, sorts the table on the column in alternating
ascending and descending order.
The Column Header row is the first row in the table, as shown above.
To configure a column header:
1. Select one of the Data Table Column elements in the definition.
2. Set the Header Type attribute to Image if an image is desired in the column header. If left blank, the
default value is Text.
3. In the Column Header attribute value, type the desired text or choose an image from the drop-down
list of choices.
4. The column header text is centered by default. However, you can apply a different class to all of the
column headers at once by setting the parent Data Table element's Column Header Class attribute, or
apply one individually to one or more columns by using their own Column Header Class attribute.
Using Extra Column Headers
Column headers normally consist of a single line title, but Logi Studio makes it easy for developers to add additional content if necessary. Developers can create extra column headers with multiple rows, containing text,
links or images.
40
Data Analysis using Data Tables
In the example above, an Extra Column Header element has been added as a child of a Data Table Column. It
contains New Line and Label elements and the effect is to make a 2-line column header for the Customer ID
column, as shown.
Another example, shown above, includes a column with a checkbox, for selecting rows, a common implementation in data tables. The Extra Column Header in this case includes two links that refresh the table, checking
or unchecking all rows. The Link Parameters elements pass either a "1" (All) or nothing (None) when the report
is refreshed, and the Input Checkbox element uses the passed Request variable as its Default Value and "1" as
its Checked Value.
Justifying Column Header Text
The Data Table Column element has a Class attribute, which affects the data displayed in the column but not
the column header text. By default, column header text is centered, which may not suit you. It also has a Column Header Class, which allows you to justify the header text itself.
Note that the effectiveness of other style descriptors in these style classes, such as font-size or -weight, may
vary depending on any other style settings that have been made for the table, its rows, and cells, including
those set by Themes.
Data Analysis using Data Tables
41
Sorting Displayed Column Data
Developers can sort a table based on columns of text, numbers, or dates, in ascending or descending order.
Developers can also give users the ability to dynamically sort columns when running a report simply by adding
a Sort element to any Data Table Column.
Column data is sorted in the order specified in the First Sort Sequence attribute when the user clicks the link;
clicking it again reverses the sort order. This defaults to Ascending first, then Descending.
To do this:
Set the following Sort element attributes:
Create an initial sort order
Set the First Sort Sequence attribute to Ascending or Descending.
Default: Ascending
Specify a sort order for multiple columns
Set the Data Column attribute to a comma-separated list of data column
names, and then set the Data Type attribute to a comma-separated list of
data types that correspond with the respective column names.
Disable interactive sorting for
large tables
Set the Sort Row Limit to a numeric value that behaves as a threshold. Interactive sorting is disabled when the number of rows exceeds this value.
Remember the user's sort selections
Set the parent Data Table element's Remember Sort attribute to True. Default: False
Display arrows in the header
that indicate the sort order
Set the parent Data Table element's Sort Arrows attribute to True. Default:
False
Adding a Sort element automatically enables interactive sorting for that particular column. Column data is
sorted in the order specified in the First Sort Sequence attribute when the user clicks the link; clicking it again
reverses the sort order. This defaults to Ascending first, then to Descending.
In some cases, with a very large number of rows, column sorting should be disabled so the user is not left waiting to sort a very large result set. Set the Sort Row Limit attribute to a large number to disable sorting with
large result sets.
If a Sort Row Limit is set, the link is present but does not perform any sorting functions on the data. In that
case, it's advisable to create a message, using the Sort Row Limit Message attribute, that will inform users
when sorting functionality is disabled for large data tables.
Rearranging and Resizing Columns at Runtime
If a Data Table element's Draggable Columns attribute is set to True, users can rearrange its columns at
runtime:
42
Data Analysis using Data Tables
When this feature is enabled, as shown above, users can click on the left side of the column header and drag
the column right or left to a new position. If columns can be dragged they'll display a special icon in their headers, as shown above, which isn't visible until the cursor is hovered over it.
The Data Table element's Resizable Columns attribute allows users to drag an icon in the column header,
shown above, at runtime to increase or decrease the column width.
The new column arrangement and/or width is "remembered" for the duration of the current session. The default value for both of these attributes is False.
Column dragging and resizing functions can't be used when the data table includes optional special rows,
such as Header rows or Summary rows, that include columns that span multiple data table columns.
Showing/Hiding Columns
The Data Table Column element's Condition attribute can be used to dynamically show or hide the column at
runtime, and developers frequently want to do this based on the table's data. However, there's an important
restriction on this attribute: an expression used as its value cannot include @Data tokens. This is because any
tokens used here must be available to be resolved when the table structure is being built but, because the
table's datalayer doesn't run until later, there are no @Data tokens available at that time.
One solution is to use Local Data, then @Local tokens would be available when the table structure is being
built and could be used in the Condition attribute. Other types of tokens, of course, can be used in Condition
attribute expressions.
Data Analysis using Data Tables
43
Summarizing Column Data
You can perform typical aggregations of column data to create summary information for data tables. The following aggregations are available when summarizing column data:






Average
AverageOfAllRows
Count
CountOfAllRows
Distinct Count
Max





Median
Min
Mode
StdDev
Sum
By default, aggregations exclude columns with Null values. To include them, create the constant
rdCalculationsIncludeNulls in your _Settings definition and set it to True.
You can display the summary information at the bottom of a data table in a dedicated row, on every page or
just the last page (if the data spans multiple pages).
To summarize a data column:
1.
2.
3.
4.
Add a Data Column Summary element beneath a Data Table Column element, as shown above.
Set its Data Column attribute value to the name of the column to be summarized.
Select an aggregating function in the Function attribute value.
Give the element an ID - this is important as the ID may be used later in order to reference the summarized value.
5. Set the Data Type attribute value to the proper data type (optional but recommended).
You can add a Data Column Summary element to every data table column that you want to summarize.
As mentioned above, the summarized value is available using an @Data token. So, the data in the example
above would be available as @Data.sumFreight~. However, you do not need to use this token if you use a
Summary Row element to display your summarized data.
44
Data Analysis using Data Tables
As shown above, the Summary Row element is added as a child of the Data Table (its position in the element
tree does not matter) and its attributes are set as shown. This will cause a separate row to appear at the end
of the report and its Caption will appear in the first column; the summarized values for each column that has a
child Summary element will automatically appear in this row.
The example above shows the summary row and summarized Freight column value. Note that the summary
row will inherit the format of its data column.
An alternative to using data column summaries is to use datalayer aggregate columns. An aggregate column
behaves like any other column in the datalayer, and developers can perform additional calculations using more
datalayer column elements.
Using Event Handlers with Column Data
It's possible to assign Event Handler elements as children of a Data Table Column. This allows the developer,
for example, to capture mouse-related events associated with table columns and dynamically react to them.
For instance, a More Info Row might be made visible or an image or popup panel or menu might be displayed
when the mouse is hovering in a particular table column.
Data Analysis using Data Tables
45
Data Table Rows
This chapter introduces the Logi developer to several types of row-related elements available for data tables,
including Header and Summary rows and the dynamic "More Info" row.
Creating Header and Summary Rows
Header and summary rows allow developers to display data column summary information on the first (excluding the column header row) and/or last rows of a data table. Developers can customize header and summary
rows by adding individual Column Cell elements.
The easiest way to display summary information is to use Summary elements with each Data Table Column to
be summarized and then create a header and/or summary row.
1. Ensure that each Data Table Column to be summarized has a child Data Column Summary element, as
shown above.
2. Set its attributes to produce the desired summary of the desired column, as shown above.
46
Data Analysis using Data Tables
3. Select the parent Data Table element and add a Header Row or Summary Row element to the definition,
as shown above.
4. Set its Caption attribute to display a title in the first column of the header/summary row.
5. When using a Summary Row and interactive paging, set its Last Page Only attribute to True to show the
summary only on the last page of the data table, otherwise it will appear at the bottom of every page.
The example above show the typical result, with the summary row at the bottom. Note that the cells generated for the summary row automatically inherit the formatting and alignment of the columns above them.
A standard header or summary row works well when every data column contains summary information. However, for data tables with numerous columns and/or columns with non-numeric data, a customized header or
summary row may be a better solution. Here's how to create a customized header:
1.
2.
3.
4.
Ensure that each Data Table Column to be summarized has a child Data Column Summary element.
Select the parent Data Table element and add a Header Row element to the definition.
Beneath it, add one or more Column Cell elements.
Add Label elements beneath the Column Cell elements to display the summary data and use the @Data
token to retrieve the summarized values, using on the ID of the Data Column Summary elements you added. For example, @Data.avgDiscount~.
Data Analysis using Data Tables
47
The formatting and alignment of the data table columns is not inherited when using Column Cell elements, so
you must set these individually.
Note that, in the example shown above, the Header Row element has three Column Cell child elements, but
the data table has four columns. This is handled by setting the first Column Cell element's Column Span attribute to span 2 columns, allowing for the difference.
Highlighting Rows with CSS
In order to increase the "readability" of tables, especially wide tables, it's often useful to be able to highlight
the entire row the cursor is hovering over.
This effect is shown in the example above and can be created using a simple style class.
The CSS used to create the effect is:
#yourDataTableID TR:hover TD { background-color: AliceBlue; }
Note that this may not work if your application doesn't have a doctype declaration set (Logi apps default
to the HTML5 doctype) or with some older browser versions.
Working with “More Info Rows”
The More Info Row element provides a mechanism that allows detail information to appear beneath each data
table row. This detail information can be visible all the time, or can be shown and/or hidden by clicking a link in
one of the data table columns. It provides developers with an opportunity to make data tables less cluttered
and more flexible.
48
Data Analysis using Data Tables
In the example shown above, the "Ship to:" detail data is displayed beneath each data row using a More Info
Row element. The font size, color, number of regular data table columns spanned, background color, etc. can
be set to differentiate the detail data, if desired. This is accomplished as follows:
1. Beneath the parent Data Table element, add a More Info Row element, as shown above.
2. Set its Show Modes attribute value to All. This causes the rows to be shown at all times.
3. Set its Span First Column attribute value to 2, which causes the its data to appear beginning underneath the second data table column (leaving this attribute and the Span Last Column attribute blank
causes the data to span the entire data table).
4. Add elements beneath the More Info Row element to display the desired text and data (data from the
table's datalayer is available here using @Data tokens).
The More Info Row element has a Condition attribute, which allows you to conditionally include the element,
for greater control over when the element can be seen, primarily when the More Info Rows are displayed by
default.
Showing/Hiding More Info Rows
In the next example, the More Info Rows are hidden from view until the user takes some action to display
them.
Data Analysis using Data Tables
49
When the user clicks on a customer ID link, above left, the table expands downward to add a More Info Row
that displays detail information about the customer, above right. The new row is added right beneath the row
that contains the clicked link. Depending on the element's configuration, clicking the link again will hide the
new row.
The information in the More Info row can be text, as shown above, or an image, another table, or even a subreport. Here are the key elements and attributes used to created the example above:
1. Beneath the parent Data Table element, add a More Info Row element, as shown above.
2. Set its ID to a unique value and its Show Modes attribute value to None. This causes the rows to be
hidden by default.
3. Add elements beneath the More Info Row element to display the desired text and data (data from the
table's datalayer is available here using @Data tokens).
50
Data Analysis using Data Tables
4. Identify the data that you want to be the link that shows and hides your More Info row. Beneath it,
add an Action.Show Element element, as shown above.
5. Set its Element ID attribute value to the ID of the More Info Row element you added earlier.
6. Set its ID attribute to a unique value and its Display attribute to Toggle.
The More Info Row element allows developers to quickly and easily build useful functionality into their reports.
It is possible to "nest" More Info Row elements, so that you have one More Info Row element as a child of a
table that's a child of another More Info Row. However, be aware that the lowest More Info Row contents may
not export correctly, or at all, so we don't recommend this design arrangement if exporting of expanded rows
is desired.
The More Info Row Column element can be used to closely align More Info Row columns with the columns of
its parent table. When this element is used, the More Info Row element's Span First Column and Span Last
Column attributes are left blank, and the More Info Row Column element's Column Span attribute is used instead to control spanning of parent table columns.
Data Analysis using Data Tables
51
Working with Hierarchical Data
Data in hierarchical groups presents a special challenge for the Logi developer and this document introduces
several different techniques for presenting it using data tables.
Hierarchical data is data that is grouped into a tree-like structure, with repeating parent/child relationships:
For example, the data shown above is in a hierarchy, grouped first by Customer, then by Order, with Order
Item details. In the business intelligence reporting world, this is a very common approach to presenting data
and segments the data visually in a way that makes it easy to understand.
The challenge with HTML-based reports, such as Logi applications, is to manage the screen real estate effectively and there are several approaches to doing this. Depending on the number of columns to be displayed, a
straight forward data table can be used. If that isn't practical, then it may be better to embed a data table (a
"subdata" table) within a table to more easily manage the columns; this is discussed in a later section. And,
finally, placing a subdata table within a More Info row may help to reduce visual clutter. The following discussion builds on the first approach, which uses a regular data table.
Restriction When Using Input Elements
Some applications display data in a Data Table and include Input elements in each row of the table. A common
example is a "Delete" checkbox for every record. This can be done in Logi applications, but is not recommended when hierarchical data is being used. The complex data relationships involved make it impossible to uniquely identify the associated user input elements.
52
Data Analysis using Data Tables
This prohibition applies to obvious hierarchical representations, such as the Data Table, and also to elements
like the Data Tree, which use hierarchical grouping internally to create their parent-child data representations.
Group Header and Group Summary Rows
One effective but uncomplicated method of displaying hierarchical data in a data table is to use Group Header
and Group Summary Rows. As is often the case, the first step is to understand the data and what groupings
are required.
The image above shows a report definition in which a SQL query has been used to retrieve data from a JOIN of
Customer, Orders, OrderDetails, and Products tables.
A Group Filter element is used to create a hierarchical arrangement of the data, based on Order ID.
A Group Aggregate Column element is used to create grouped totals of the Freight column, and a Sort Filter
element is used to sort it all by Order ID.
Group filters create data groups by looking for unique values in a particular column. By default, the first row
with a unique value is kept and the duplicate rows are discarded.
Developers must choose to keep all grouped rows when building and presenting hierarchical data within a data table by setting the Group Filter element's Keep Grouped Rows attribute value to True.
Data Analysis using Data Tables
53
The next step, as a shown above, is to add Data Table Column elements for the detail data that we want to
see. Each of these columns has a child Label element.
In order to summarize the Freight costs, also add a Data Column Summary element to the definition beneath
the Freight column. This element's attributes are then set to Sum the Freight column values.
Next, a Group Header Row element has been added, as shown above.
The Group Header Row requires that we identify the Group Filter we used earlier (that's why we gave it an element ID), and we'll configure it to insert ("prepend") a blank row before each group except the first one.
Child elements, shown above, are added beneath the Group Header Row, and are configured to show the Order ID and Customer ID. The second Column Cell element's Column Span attribute is set to 5, as there are six
total columns. The Label elements are configured to display the data tokens from the appropriate columns.
Finally, a Group Summary Row is added, as shown above. It's configured as shown to use the appropriate
Group Filter and a Caption is provided. This element will automatically display summaries beneath any column
54
Data Analysis using Data Tables
that has a Data Column Summary child element and the summary data will inherit the alignment and formatting of its parent column.
A portion of the resulting data table is shown above. Note how the data has been arranged in a hierarchy.
When printing reports directly from the browser or from a PDF export, developers can choose to print each
data grouping on separate pages. Set the Group Header Row or Group Summary Row element's Printer Page
Break attribute to True to insert a page break before each group header row.
Creating Hierarchies by Indenting Groups
The next example products a report that indents the data based on its hierarchical grouping. Once again, the
first step is to understand the data and what groupings are required.
Data Analysis using Data Tables
55
The example above shows a report definition in which a SQL query has been used to retrieve data from a JOIN
of Customer, Orders, OrderDetails, and Products tables. The query includes a calculated column created by
multiplying UnitPrice by Quantity to get an UnitTotal value. Here's the T-SQL query used in the example:
Select Orders.OrderID, Orders.CustomerID, Orders.OrderDate, [Order Details].UnitPrice,
[Order Details].Quantity, [Order Details].UnitPrice * [Order Details].Quantity AS UnitTotal,
Customers.CompanyName, Products.ProductID
From Orders
Inner Join [Order Details] On Orders.OrderID = [Order Details].OrderID
Inner Join Customers On Customers.CustomerID = Orders.CustomerID
Inner Join Products On Products.ProductID = [Order Details].ProductID
A Group Filter element is used to create a grouping of the data by CustomerID and to create a group aggregate
column that sums the UnitTotal values for each customer. Then a second, nested Group Filter is used to group
and calculate a sum for each order, again using UnitTotal values. Once again, we need to give both Group Filter
elements a unique ID, which we'll use later, and we want to keep all of their grouped rows, by setting their
Keep Grouped Rows attribute values to True.
Because the second Group Aggregate Column element is nested, gacOrderTotal will not appear in Logi
Studio's drop-down lists of attribute options or Intelligent Token Completion feature. You'll need to enter it
manually.
The next step, as shown above, is to provide columns for the data by adding Data Table Column elements to
the definition. The first six of these columns will be "placeholders" - we won't be putting Label element in
56
Data Analysis using Data Tables
them to show data. Their data will be displayed using a different mechanism described later. They can, optionally, have child Sort elements.
For the last four data table columns, colProduct ID though colUnitTotal, we will add a Label element, with an
@Data token in its Caption attribute, to display their data.
To provide data at the Customer level, a Group Header Row element is used, as shown above. Its Group Filter
ID attribute value is set to the ID of the relevant group filter ("grpCustomer").
Beneath the header row, Column Cell and Label elements are added to provide the data in the first three columns of the report.
The actual location of the Group Header Row element in the element tree - at the top as shown or after its
placeholder column elements - doesn't matter.
Data Analysis using Data Tables
57
The process is repeated for the Order data, by adding another Group Header Row element, as shown above.
However, this time three "dummy" Column Cell elements must be added to account for the columns holding
the Customer-level data. Then three Column Cells are added to contain the Order-level data.
The resulting report looks like the example above. You can see that each level of grouping - Company, Order,
and Product - has a different indentation level.
Group Summary Row elements could be used instead of, or in addition to, Group Header Rows in order to
place the summarized Order data beneath the Order Details.
Creating Hierarchies by Hiding Duplicate Values
Another way to achieve something like the previous section's results is to use the Hide Duplicates element to
create a hierarchical layout within a data table from one or more data groups.
The Hide Duplicates element can be added beneath any Data Table Column to suppress output when the record in the current row is equal to the record from the previous row.
By utilizing the Hide Duplicates element in several columns, developers can achieve the effect of a hierarchical
table.
58
Data Analysis using Data Tables
This example starts with the same datalayer used in the previous example, and uses one Data Table Column
element for each report column, as shown above. Each Data Table Column has a child Label element to display
the data. No Group Header Row or Group Summary Row elements, or their child elements, will be used.
Beneath each of the first six Data Table Column elements, add a Hide Duplicates element. This element has
one attribute, Data Column, which is the name of the column to check for duplicate values.
In the first three columns (the "Customer" columns), set this value to "CustomerID", as shown above.
Data Analysis using Data Tables
59
In the second set of three columns (the "Order" columns), set Hide Duplicates elements' Data Column attribute
to a comma-separated list of "CustomerID,OrderID", as shown above…
… and the resulting report shows how the data is grouped and indented by virtue of suppressing duplicate data.
60
Data Analysis using Data Tables
Working with Subdata Tables
As mentioned earlier, another method of presenting hierarchical data is to use a subdata table beneath a Data
Table Column or More Info Row element. We don't generally recommend this approach, although the necessary elements remain in Logi Info for backward compatibility.
Subdata tables receive data from the Subdata Layer element, which uses a standard datalayer to retrieve data
and then relates its columns to those of the parent data table's datalayer.
Most developers find it easier to use a subreport that includes a regular data table, rather than a
subdata table. One advantage to this approach is that a subreport, which is a separate report definition, can be
independently developed and tested, and then embedded in a parent report using the SubReport element.
This technique works well with the More Info Row element and does not require hierarchical data. More information is available in our document Working with SubReports.
The example definition shown above employs two More Info Row elements and two Subdata Table elements
to create a hierarchy of data. In this case, the detail data may not always be visible in the report and may require the user to do some clicking to make it visible.
For information about using subdata tables, see our document Working with Subdata Tables.
Data Analysis using Data Tables
61
Working with Crosstab Tables
A cross tabulation (often abbreviated as "crosstab") is a table that displays the joint distribution of two or
more variables simultaneously. Sometimes called "pivot tables", they make it easy to sort, count, and total
their data. The Logi Crosstab Table element makes it easy to implement this kind of table.
Using the Crosstab Table Wizard
The fastest and easiest way to create a crosstab table is to use the Crosstab Table Wizard in Logi Studio. Here's
how:
1. As shown above, in a definition in Logi Studio, select an element and either click the Crosstab Table
item in the main menu's Wizards tab, or right-click the element and select Element Wizards, and then
select Add a Crosstab Table from the secondary menu.
62
Data Analysis using Data Tables
2. A series of dialog boxes, shown above, will be displayed. These all relate to the retrieval of the data.
Make appropriate selections for your application and click Next to move to the next dialog box.
Data Analysis using Data Tables
63
3. The wizard will display a model crosstab table in a dialog box, where you can adjust it, if desired. If the
table is just as you want it, click Next to exit the wizard.
The Max Rows option at the bottom of the dialog box controls the maximum number of rows that will be retained in the table's datalayer.
When you exit the wizard, it will finish inserting all the elements for the table, properly configured, into your
report definition. Only the table itself will be added, not any of the configuration controls you've just worked
with. Preview your application and you should see your new table.
Crosstab Table Basics
The Logi Crosstab Table is a dynamic, data-driven reporting component that consists of the following three
data column types:



Crosstab
Label
Value
The Crosstab column is a specified column from the datalayer, where each unique value creates a new column
in the crosstab table.
The Label column and Value column are also specified by the developer from the datalayer. Each unique value
in the Label column creates a new row in the crosstab table. Data from the Value column fills the table out,
and the number of value columns is equivalent to the number of records in the crosstab column.
64
Data Analysis using Data Tables
The example above shows each of the column types and where they appear in a crosstab table.
Each value displayed in the Value columns is the result of an aggregating function, performed on the original
data from the specified Value column.
The example above displays years for the Crosstab column, employee names for the Label column and a sum
of corresponding subtotals for the Value columns. So, when the year is 1996 and the employee is Nancy
Davolio, the sum of all corresponding subtotals is $30,861.76.
The following functions are available for aggregating Value columns:

Any - Displays a value from any of the rows. This can be used when the specified Value column data is
a string that isn't appropriate for aggregation; for example, when there's just one record to represent
each crosstab cell.

Average - Returns the average of all corresponding records in the specified Value column.

Count - Returns the total number of corresponding records in the specified Value column.

Distinct Count - Returns the total number of distinct records in the specified Value column.

Median - Returns the value that separates the higher half of all values in the specified Value column
from the lower half.

Mode - Returns the value that occurs most frequently in records in the specified Value column.

StdDev - (Standard Deviation) Returns a simple measure of the variability of data in records in the
specified Value column. A low standard deviation indicates that the values tend to be very close to
each other, while a high standard deviation indicates that the values are “spread out” over a large
range.

Sum - Returns the sum of all corresponding records in the specified Value column
Columns with null values are excluded from aggregations by default. If you want to include them instead, create the constant rdCalculationsIncludeNulls and set it to True.
Data Analysis using Data Tables
65
What about differences between columns, either as values or as percentages? The Crosstab Comparison element was introduced in Logi Info v10.0.299 and it can display these differences in a variety of ways. The element is discussed in detail in a later section.
Creating a Crosstab Table Manually
Every crosstab table uses the following minimum components:




One Crosstab Table element
One or more DataLayer elements with a Crosstab Filter element to retrieve and shape the data
One or more Crosstab Table Label Column elements to display the Label column records
One or more Crosstab Table Value Columns element to display the Value column records
The elements above define the most basic crosstab table. Other elements, such as Condition Filters, Sort Filters, and Calculated Columns, can be used to manipulate the data in the datalayer in the same way they would
be used for any data table or chart. Note that Crosstab Filters can also be used with the datalayers that provide
data for charts.
You can create a crosstab table in Studio by manually adding the appropriate elements to a report definition
or, if your data resides in a SQL database server, you can use the Crosstab Table Wizard built into Studio.
The Crosstab Table Label Column element includes the Scope Row Header attribute which, when set to True,
causes the HTML output for data cells to be modified to improve Section 508 accessibility. It creates a column
which includes header information for each row, changing the <TD> tags to <TH Scope="Row"> tags.
Working with Crosstab Columns
Instead of using the wizard, developers can manually build crosstab tables using two types of crosstab table
columns – Label columns and Value columns. Crosstab tables have one Label column by default; the number of
Value columns is determined by the number of records found in the specified Crosstab column.
To create a crosstab table Label column:
1. In Studio, select the parent Crosstab Table element and add a Crosstab Table Label Column element
beneath it.
66
Data Analysis using Data Tables
2. Configure any optional attributes for the new label column.
3. Add a Label element beneath the new column and use the @Data token to reference values from a
column returned by the datalayer.
Next, add a Crosstab Table Value Columns element to create the Value columns for the crosstab table. Value
columns contain the results of the aggregations of the data from the specified column.
But the results of the aggregations do not appear in the datalayer under any of the datasource column names,
so how is it referenced? Special @Data tokens are used to allow developers to access Crosstab column and
Value data:
These special tokens are:



@Data.rdCrosstabColumn – Returns records in the specified Crosstab column
@Data.rdCrosstabValue – Returns the aggregated values for the corresponding records in the specified Value column
@Data.rdCrosstabValCount – Returns the number of corresponding records from the Value column
used to calculate the current aggregate value if the aggregation is Sum, Count, or Average.
These elements and attributes are used as follows:
1. Beneath the parent Crosstab Table element, add a Crosstab Table Value Columns element to the definition, as shown above.
Data Analysis using Data Tables
67
2. Set its Column Header attribute to @Data.rdCrosstabColumn~ to use the Crosstab column data as column headers.
3. Add a Label element beneath the Crosstab Table Value Columns element and set its Caption attribute
to @Data.rdCrosstabValue~, as shown above, to retrieve the aggregated crosstab values.
Arranging and Sizing Columns
The developer can configure Crosstab Table columns so that they can be rearranged and/or resized at runtime
by the user.
As shown above, when the Crosstab Table element's Draggable Columns attribute is set to True, a dotted icon
appears in the column headers when the mouse is hovered over their left side and the cursor changes to leftright arrows. The entire column can then be dragged left or right and dropped into a new position. The new
68
Data Analysis using Data Tables
column arrangement will be "remembered" for the duration of the current user session. Draggable Columns
cannot be used when there are custom header rows, with columns that span multiple columns, in use. The
default value for Draggable Columns is False.
When the Resizable Columns attribute is set to True, a dotted icon appears in the column headers when the
mouse is hovered over their right side and the cursor changes shape. The icon can then be dragged left or
right, contracting or expanding the width of the column. The new column width will be "remembered" for the
duration of the current user session. Resizable Columns cannot be used when there are custom header rows,
with columns that span multiple columns, in use. The default value for Resizable Columns is False.
Comparing, Sorting, and Summarizing Columns
It's not uncommon to need to include the difference, either as a value or as a percentage, between two or
more value columns in a cross-tab table. There are two approaches to creating this information and their
availability depends on what product and version you have.
The Crosstab Comparison Element
Included in Logi Info only, beginning with v10.0.299, the Crosstab Comparison element makes it easy to visually understand the differences between values in cross-tab columns:
Data Analysis using Data Tables
69
Each column is compared with the previous column and an indicator arrow or colored background is shown if
the value increased or decreased. The amount of increase or decrease can be displayed as a numeric and/or
percentage difference.
As shown above, comparisons between columns can be indicated by colored arrows and percentages or literal
values, within each column cell or in tooltips that appear when the mouse is hovered on a value. Instead of the
colored arrows, you can display a colored cell background, covering a spectrum, to indicate the differences.
The unique attributes of the Crosstab Comparison element are:
Attribute
Description
Comparison Show Tooltips
Enables display of the numerical difference in a tooltip when the mouse is
hovered over a cross-tab value. Display options include Percent, Value, All,
or the default, None.
Comparison Show Values
Enables display of the numerical difference in the cross-tab cells. Display
options include Percent, Value, All, or the default, None. The Format attribute can be used to format the displayed numbers.
Comparison Style
Specifies how differences will be indicated visually. Options include None,
ColorSpectrum, and the default, Arrows.
Format
Formats the numbers displayed for values or percentages. More information can be found in our Formatting Data document.
High Color Value
When ColorSpectrum has been selected as the Comparison Style, specifies
the color to be used for the highest value in the numeric range. Default:
Green
Low Color Value
When ColorSpectrum has been selected as the Comparison Style, specifies
the color to be used for the lowest value in the numeric range. Default: Red
70
Data Analysis using Data Tables
Medium Color Value
When ColorSpectrum has been selected as the Comparison Style, specifies
the color to be used for the value in the middle of the numeric range.
If the Cross-tab Table element's Draggable Columns attribute has been set to True, and the Crosstab Comparison element is in use, when columns are dragged to change their order, their comparison values will be automatically updated.
Note that, because the calculations made by this element do not affect the table's datalayer, it's not possible
to summarize or sort the results.
Calculating Comparisons Using Tokens
For developers using Logi Report, or older product versions, an alternate approach to value column comparison is available. This technique also provides for other calculations, such as comparisons to current dates or to
external values, and is accomplished entirely within the Label element used to present the results.
In the example above, a CrosstabTableLabelColumn element ("colPcntDiff") has been added with a Label element beneath it. The Label element's Caption attribute includes a formula that relies on the fact that cross-tab
table value columns can be individually addressed using the tokens @Data.rdCrosstabValue-0~,
@Data.rdCrosstabValue-1~, ...@Data.rdCrosstabValue-n~.
To get the difference between two values, for example, the Label caption would use this formula:
=@Data.rdCrosstabValue-1~ - @Data.rdCrosstabValue-0~
To get the percentage difference between two values, for example, the Label caption, with a Percent format,
would use this formula :
=IIF(@Data.rdCrosstabValue-1~ - @Data.rdCrosstabValue-0~ < 1,
(@Data.rdCrosstabValue-1~ - @Data.rdCrosstabValue-0~)/@Data.rdCrosstabValue-0~,
(@Data.rdCrosstabValue-1~/@Data.rdCrosstabValue-0~) - 1 )
Data Analysis using Data Tables
71
With both of these difference calculations included, the resulting cross-tab table looks like the example shown
above. Note that, because the calculations do not affect the table's datalayer, it's not possible to summarize or
sort the results.
Sorting and Summarizing Columns
As mentioned earlier, you can apply a Sort Filter element beneath your datalayer, before or after the Crosstab
Filter, to sort the actual data. In addition, you can use sorting elements within the table columns.
The sorting and summary features for cross-tab table columns are functionally similar to those for data table
columns: Sort Filter and Summary child elements are added beneath them. However, because of its special
dynamic-column nature, the Crosstab Table Value Column has its own special sort element: the Crosstab Value
Column Sort element is used to sort by value columns.
When using a standard Data Column Summary element to summarize cross-tab Value columns, set its Data
Column attribute to rdCrosstabColumn, as shown above.
A standard Summary Row element is added to create a row across the bottom of the cross-tab table to display
the summarized value for each column with a Data Column Summary element.
72
Data Analysis using Data Tables
Displaying Column Detail
A cross-tab table does a great job of aggregating data and displaying it in a manner that makes it easy to see its
progression.
There are times, however, when it's useful to be able to examine the detail data that the cross-tab filter used
to create the value in each column cell. The Group Drillthrough element provides this functionality.
In the example above, a Group Drillthrough element has been added beneath a Crosstab Table Value Columns
element. All of the element's attributes, other than ID, are optional but the example shows a custom caption
and export button selections have been entered. More information about the attributes can be found in the
element's Element Reference page.
The resulting cross-tab table is shown above. Note that each value column cell now contains a drill-through
icon that becomes visible when you hover your mouse pointer over the area.
Data Analysis using Data Tables
73
When the icon is clicked, a detail report, like the example shown above, is automatically generated, containing
all of the relevant detail data.
The Group Drillthrough element's attributes allow you to customize the icon image that appears in the crosstab table and certain aspects of the detail report. You can also include Drillthrough Column elements beneath
the Group Drillthrough element; they allow you to set the number columns that will appear in the report and
to customize their appearance.
Working with the Crosstab Filter
A Crosstab Filter element is required to format, or "pivot", data retrieved into a datalayer for use in crosstab
tables.
As discussed in the first section of this chapter, developers designate three columns in the datalayer to configure the Crosstab Filter: the Label column, the Crosstab column, and the Value column. Developers must also
choose an aggregate function to apply to records from the specified Value column.
The filter groups the data based on the designated Crosstab column. If the Crosstab column contains numerous distinct records, many crosstab value columns may be generated and the table can become quite wide.
74
Data Analysis using Data Tables
This can be controlled using the optional Max Crosstab Columns attribute, which limits the number of crosstab
value columns that appear in the table.
One Label column may not be sufficient to display all the necessary information in a crosstab table. As shown
above, developers can add Extra Crosstab Label Column elements beneath a Crosstab Filter element in order
to add additional columns from the datalayer as Label columns.
To display the data for these extra label columns, an @Data token is used but the token identifier matches the
ID of the Extra Crosstab Label Column element, not the datalayer column it represents.
For example, the datalayer may have a column named EmployeeLName and this column is identified in the
attributes of the Extra Crosstab Label Column element whose ID is LastName. To display this data, use the token @Data.LastName~.
Developers can summarize crosstab row data (a horizontal summary) as well as crosstab column data (a vertical summary).
As shown above, the Crosstab Row Summary Column element can be added beneath a Crosstab Filter element to generate new columns in the filtered datalayer that contain aggregations for each value in every
crosstab row.
Data Analysis using Data Tables
75
Developers can set the summary element's Function attribute to Count, Sum, Average, AverageOfAllRows,
CountOfAllRows, or StdDev. For example, to count the number of value columns, set this attribute to Count; in
the image above there are value columns for 1996, 1997, and 1998, so the value calculated will be 3. If this
attribute is set to CountOfAllRows, it will calculate 809, the number of all of the order records for all three
years.
Additional Crosstab Table Label Column elements, such as "colSum" above, can be added as needed to display
the summarized results.
The @Data token used to retrieve the data uses the ID of the summary element. In the example above, using
@Data.crsSum~ retrieves the aggregate values for the corresponding Crosstab Row Summary Column element
named "crsSum".
Crosstab Filters can also be used with the datalayers that provide data for charts and gauges, however,
they're designed for use with Crosstab Table elements and may not provide full functionality with other elements.
The Include Condition Attribute
The Crosstab Filter element has an Include Condition attribute and if it’s left blank or contains a formula that
evaluates to True, the Crosstab Filter element is applied to the datalayer. If the value evaluates to False, the
filter is ignored and does not affect the datalayer. This powerful feature allows developers to dynamically determine if the datalayer will be manipulated or not.
Planning an Example Crosstab Table
This section builds on the information presented on the previous page and demonstrates how to build a fairly
complex crosstab table.
Before adding elements to a definition, it's a good idea to first plan the table (or chart) that you're trying to
produce. A simple sketch can often provide clarity and save you from having to re-work your definition later.
Look the crosstab table shown below:
76
Data Analysis using Data Tables
The table is limited to three years of data, groups products by company, provides summarized data for each
year in several categories and for all products, and summarizes across all years as well. With this layout in
hand, we can proceed to build the table.
The following examples demonstrate how to use a variety of elements to produce this table. The complete,
downloadable definition for this crosstab table is available in the Crosstab Table Sample Application on
DevNet.
Building the Basic Table Structure
As discussed earlier, the Crosstab Filter element determines the basic structure of the table:
The definition starts with a Crosstab Table element, a datalayer to retrieve the data, and a Crosstab Filter element to format the data.
In the filter attributes shown above, the table will have a label column for the Product Names, be grouped horizontally (crosstab) by Order Year, and the initial values will be the sum of the order Quantities.
A Crosstab Table Label Column element ("colProductName") and a Crosstab Table Value Columns element
("colQuantity") are added to the definition to display the data.
Note that a special token is needed to access the Value column data: @Data.rdCrosstabValue~. The token
identifier uses the reserved word "rdCrosstabValue" and the token is used in the Caption attribute of a Label
element beneath the Crosstab Table Value Columns element.
Data Analysis using Data Tables
77
The five elements added so far provide the portions of the basic crosstab table which are highlighted in yellow
above.
In a previous section, the Extra Crosstab Label Column element was discussed. As shown above, one of these
elements is now added to the definition to provide the data for the Supplier column ("CompanyName"), along
with a Crosstab Table Label Column element ("colCompanyName") which displays the data.
The result is the addition of the Supplier column, highlighted in yellow above, to the crosstab table.
Adding Extra Crosstab Values
By default, the Crosstab Filter produces a single value for each column and row combination.
In order to generate additional values for the Total Sales data for our crosstab table, an Extra Crosstab Value
Column element is used.
78
Data Analysis using Data Tables
As shown above, this element simply identifies a column from the datalayer ("OrderTotals") and the aggregation to be applied to it.
A Crosstab Table Value Columns element ("colODTotal") is also added to display the values. Note that a special token is needed to access that data: @Data.rdCrosstabValue-ODTotal~. The token identifier combines the
reserved word "rdCrosstabValue", then a dash "-", and then the ID of the element beneath the Crosstab Filter
that represents the value column ("ODTotal"). This token is used in the Caption attribute of a Label element
beneath the Crosstab Table Value Columns element.
Additional values can also be added to the crosstab through calculations, by using an Extra Crosstab Calculation Column element. In the example shown above, the average unit price is calculated using this element. The
complete formula is: @Data.rdCrosstabValue-ODTotal~/@Data.rdCrosstabValue~ which divides the Order
Total by the Quantity.
The Order Total value is accessed using the same token discussed earlier and used to display the order total
values; while the Quantity value is accessed using a similar token representing the original Value column defined in the Crosstab Filter.
The elements added and configured in this step add the columns highlighted above.
Data Analysis using Data Tables
79
Summarizing Value Rows
Our plan calls for adding three columns in the table that summarize row (horizontal) values. This is done by
adding Crosstab Row Summary Column elements to the Crosstab Filter:
The first of these elements refers to the original Value column defined in the Crosstab Filter attributes, Quantity, so all that is required is that the element be added beneath the filter, be given an ID, and its summarizing
function be set to Sum.
The second element of this type is summarizing an Extra Crosstab Value Column ("ODTotal") so it needs to include that element's ID, as highlighted in yellow above, in the Extra Crosstab Value Column ID attribute.
Three Crosstab Table Label Columns are also added to display the summarized values. The first two reference
their data using Label elements and standard tokens @Data.crsSumQuantity~ and @Data.crsSumODTotal~.
The third one derives its value by dividing the other two using the formula:
=@Data.crsSumODTotal~/@Data.crsSumQuantity~
80
Data Analysis using Data Tables
The addition of the Crosstab Row Summary Column elements adds the columns highlighted in yellow above to
the table.
Adding a Header Row
The header row ties the crosstab value columns together and provides data-driven identification for them as
well.
Before proceeding, look at the header on our plan: it consists of a blank area that spans two columns, three
areas that will contain data (the year number) and span three value columns each, and an area labeled "Total"
that spans three columns.
The Header Row element is added, as shown above, to the definition and is then "built-up" using a combination of Column Cell elements and a Crosstab Table Header Column element.
The first Column Cell element is just a "spacer" or placeholder; its attributes are set to span the two columns
beneath it and it contains a single Space element.
The second Column Cell element ("colTotal") is configured to span three columns and contains a Label element
with the word "Total" as its Caption attribute value.
The Crosstab Table Header Column element is also configured to span three columns and contains a Label element. The Label element's Caption attribute value is set to the token @Data.rdCrosstabColumn~ and will display the actual data from the datalayer column identified as the Crosstab Column in the Crosstab Filter's attributes (in our example, this is "OrderYear").
Data Analysis using Data Tables
81
The elements added in this step create the header row, highlighted in yellow above.
Summarizing Value Columns
The creation of a Summary Row at the bottom of a table with summarizing column values is a bit like creating
the header row, in that it's built-up column by column.
The first step in this process is to add Data Column Summary elements beneath the columns to be summarized. The columns that show the average Unit Price do not need these elements as their summarized value
can be derived by dividing the summarized values of two other columns.
Note that the special column names, rdCrosstabValue-ODTotal and rdCrosstabValue, discussed earlier in the
section on Extra Crosstab Value Columns, are used in the Data Column Summary elements' attributes for the
two extra value columns, as shown above.
The IDs of the Data Column Summary elements ("sumODTotal", "sumQuantity", etc.) will be used in the next
step with an @Data token to identify the summarized data.
82
Data Analysis using Data Tables
In the example above, a Summary Row element has been added to the end of the definition.
Like the Header Row, it contains elements that "build up" the columns needed for the summaries. Column Cell
elements are used for non-crosstab value columns and Crosstab Table Summary Column elements are used
for the value columns. The first Column Cell element is set to span two columns (it will be underneath the
Supplier and Product columns) and contains a Label element with a Caption of "Totals:".
The Crosstab Table Summary Column and other Column Cell elements span just one column each and contain
Label elements. The Label elements' Caption attributes, as shown above, use an @Data token to reference the
Data Column Summary elements (by ID) that were inserted in the table columns in the previous step.
When you put it all together with live data, the first page of the resulting crosstab table looks like the image
shown above.
Data Analysis using Data Tables
83
Customizing Data Table Appearance
Data Table appearance can be changed most easily by applying a theme to the report definition.
You can create your own custom theme, based on a standard theme, using the Theme Editor
tool.
However, if you want to create your own look for tables, as we’ve already seen, a combination of attributes
and style classes is the best way to do it.
The Data Table, Data Table Column, and Label elements which form a data table have Class attributes that allow you to apply style to them. The Data Table element even has separate Class attributes for its Caption and
Column Header.
Assigning Classes to Table Components
Style classes can be assigned to the overall table, to the column header, and to the Label element used to display data within each column cell.
For example, the Data Table shown above has had the .myDataTable class assigned to it.
The class definition appears beside it and controls table margin, font family, size, and color, border width and
color, and cell padding, and it flattens the border.
84
Data Analysis using Data Tables
The resulting table appearance is shown above.
Next, a second class is assigned to provide a special appearance for the table header row.
The resulting table appearance is shown above.
This special selector:
filter: progid:DXImageTransform.Microsoft.Gradient (GradientType=0, StartColorStr=#FFFFFF,
EndColorStr=#CCFF99);
can be added to the class used for the table header and, in Internet Explorer, will produce a background gradient effect in the header:
The colors, of course, can be varied as desired.
You may have noticed that the data in each table column is justified differently, by data type. This is accomplished by creating alignment classes and assigning them to the Data Table Column elements:
Data Analysis using Data Tables
85
Note that the class definition includes a padding selector, so that the data isn’t right up against the table grid
line.
And, finally, the Label element in each column may need a class assigned to it for the correct font.
An Easier Way to Assign Classes
Rather than creating and assigning separate style classes to your Data Table, Data Table Column, and Label
elements, which can be time consuming if you have a lot of columns, an easier approach is to “do it all with
style”. This is done by letting your style classes take advantage of HTML tags.
In Logi applications, Data Tables are rendered into HTML tables at runtime, with the usual <table>, <th>, <tr>,
and <td> tags. CSS lets you create class definitions that take advantage of these tags.
We begin with the same class assignment for the Data Table as before:
But, rather than assign classes using the attributes of the Data Table Column and Label elements used in the
table, we can achieve the same results more easily with the addition of two more style class definitions in your
style sheet:
.myDataTable TH
{
text-align: center;
font-size: 9pt;
text-decoration: none;
font-family: Verdana, Helvetica, sans-serif;
font-weight: bold;
height: 14pt;
86
Data Analysis using Data Tables
vertical-align: middle;
background-color: AliceBlue;
}
.myDataTable TD
{
color: Black;
background-color : #E8F0F8;
border : 1px solid #524D73;
}
Notice that the last part of each class name is “.myDataTable”, which matches the class name assigned to the
Data Table element.
The first part of each name, “TH” and “TD”, relate to the <th> and <td> HTML tags for the table, generated
when the report runs.
So, the result of defining these two classes is that they will be automatically applied to the header (<th>) and
cells (<td>) of any data table that has had the .myDataTable class assigned to it.
Note that this arrangement will affect any table in your application that has had the .myDataTable class assigned to it, in any report definition that uses the style sheet with that class.
If you want different tables in your report to look different, then you should use the method of assigning separate classes to the attributes of the Data Table, Data Table Column, and Label elements, discussed earlier.
Data Analysis using Data Tables
87
Paginating Data and Printing Reports
The volume of data retrieved into Logi reports often requires that tables be presented as a series of pages; in
addition, developers often need to offer the ability to print hard copy versions of reports with suitable headers. The document introduces developers to techniques for satisfying both of these requirements.
Paginating Data Tables
Large data tables, with hundreds of rows of data, are cumbersome to interact with in a browser-based environment. The concept of navigating through a lot of data using "pages", each with a small number of rows, is
familiar to anyone who's used an Internet search tool and looked through the search results.
Logi reporting tools include the Interactive Paging element which provides this functionality for data tables in
Logi applications.
We do not recommend using Interactive Paging with tables that contain user input elements in each row.
The examples above show four different styles and locations for page navigation links, all of which are created
using the Interactive Paging element. The left two examples use Text-type links and the right two use Imagetype links.
88
Data Analysis using Data Tables
Studio includes a wizard that will add an Interactive Paging element to a report definition and configure it, using the Image-type links shown in the upper-right hand corner of the previous examples.
To use it, select the desired data table element, then click the "Add interactive paging controls" wizard at the
bottom of the Element Toolbox, as shown above.
The Interactive Paging element can, of course, be added and configured manually as well.
Once an Interactive Paging element has been added, it can be customized. The following table describes the
element's attributes:
Data Analysis using Data Tables
89
Attribute
Description
Caption Type
(Required) Specifies that the navigation links will be text or images.
Page Row Count
(Required) Specifies the number of data rows that will appear per "page".
Class
Sets the general style class to be applied to the element.
Current Page Class
Sets the style class to be applied to the text that indicates the current page,
overriding the previous Class. Use this, for example, to make the current page
number appear in a larger font, with a colored background, etc.
First Page Caption
Specifies the text or the image file name that will appear as the "First Page"
link.
Hide When One Page
Hides the navigation controls when the datalayer returns only one page of
data. The default value is False.
Hide/Show Previous/Next
Captions
When set to True, causes the page links to be dynamic based on the current
page. The links for First, Previous, Next, and Last are hidden, as appropriate,
when the current page is the first or last page. The default value is False.
Last Page Caption
Specifies the text or the image file name that will appear as the "Last Page"
link.
Location
Specifies where the navigation controls will appear: Top, Bottom, or Both. The
default value is Both. To align the controls to the left or right side of the table,
apply an appropriate style class to the data table's parent container (such as a
Division or Column Cell element).
Next Page Caption
Specifies the text or image file name for the "Next Page" link.
Numbered Page Count
Specifies how many numbers will appear, when using a Text-type caption, in a
list of numbered page links. The default value is 10. The Show Page Number
attribute must be set to Numbered.
Page Number Caption
Specifies the word to use for "Page" in the navigation control caption "Page X
of Y". The default is Page.
Page of Caption
Specifies the text to replace the word "of" in the phrase "Page x of y".
Previous Page Caption
Specifies the text or image file name for the "Previous Page" link.
Previous/Next Class
Sets the style class to be applied to First, Last, Next, and Previous parts of the
paging control.
Show Page Number
Specify True or False here to show or hide the "Page X of Y" part of the navigation controls. Specify Numbered to create a list of numbered page links (works
with the Numbered Page Caption attribute).
To prevent the entire page from being refreshed when a different table page is selected, set the parent Data
Table element's AJAX Paging and Sorting attribute to True. AJAX is a technology that allows targeted portions
of web pages to be updated, rather than the entire page. With this attribute enabled, when the user changes
pages by clicking the table's navigation controls, only the table portion of the web page will be updated, preventing the page from "flickering". You should be aware that this alters the behavior of the browser's "Back"
button because the page history is not updated when AJAX is used.
90
Data Analysis using Data Tables
If AJAX Paging and Sorting is enabled and a user changes table pages and there is more than a very brief delay,
a spinning "Wait" icon will automatically be displayed to let the user know that processing is occurring.
The following images show the attribute settings for the examples shown earlier. To conserve space, blank
attributes have been removed:
The following images show the attribute settings for the examples shown earlier. To conserve space, blank
attributes have been removed:
Data Analysis using Data Tables
91
Data Table Page Navigation
If a data table has been paginated, there are scenarios in which you might want to navigate to a specific table
page. For example, suppose your data table has drill-down links in it and you'd like to return to the same data
table page after drilling-down to a detail report. Yes, the "Back" button on your browser will accomplish the
same thing, but there may be circumstances in which you don't want to rely on it.
When you navigate away from the paginated data table, a special Request variable is included in the URL that
calls the next report. You can use that variable in the link used to return to the data table report to ensure you
return to the same data table page.
To do this, include these two Link Parameters in the return link:
Parameter Name
Parameter Value
<myTableID>-PageNr
@Request.<myTableID>-PageNr~
rdNewPageNr
True
where <myTableID> is the element ID of the paginated data table.
Logi Info developers may want to run a process task and then return to the same data table page. This can be
done by passing @Request.<myTableID>-PageNr~ to the task and then assigning its value to a Link Parameter named rdNewPageNr when calling the data table report.
Creating “Printable” Reports
Report consumers often want to print hard copies of their web-based reports. To do this, the reports need to
be paginated and formatted for printing. Logi reporting products make this easy to accomplish by providing
the Printable Paging element.
The process causes the report to be formatted for printing and then loaded into a browser window, after
which it can be printed. The process automatically hides any Interactive Paging element, which ensures that
the navigation controls do not appear on the printout and increases the number of records in tables so they fill
the page.
There are two things that must be done to make a report "printable": the addition of a Printable Paging element, which governs page margins, size, and headers, and the addition of a link that's clicked to begin the
formatting/printing process.
The formatting/printing process formats the report for printing and then, optionally, outputs it to a printer or
other formats, such as Adobe PDF or Word.
92
Data Analysis using Data Tables
Begin, as shown above, by adding a Printable Paging element beneath the root Report element (its location in
the element tree does not matter). Set its Margin attributes as desired, in inches.
To calculate the proper Page Height and Page Width attribute values, start with the physical paper size in
inches and subtract the related margin values. So, in the example, subtract from the physical paper height
(11") the bottom margin (- .5") and the top margin (- 1") to arrive at the Page Height value ( = 9.5").
The Show Print Dialog attribute controls whether the operating system's standard printer selection dialog box
appears once the report has been loaded into the browser.
For output to other formats, such as PDF or Word, this is set to False.
If desired, a page header and footer that will only appear in the printed output can be included by adding Page
Header and Page Footer elements as child elements beneath the Printable Paging element, as shown above.
They, in turn, can contain other elements including labels and images. In the example, the footer makes use of
some @Function tokens to present the current page number and total page number. The complete Caption
attribute value for this is:
Page @Function.PageNumber~ of @Function.PageCount~
Data Analysis using Data Tables
93
Note that the PageNumber token is only valid when Interactive Paging or Printable Paging elements are in use
and the PageCount token is only valid when Printable Paging is in use.
Next, add the element that users will click to print the report:
1. Add a Division element to your report and set its Show Modes attribute to the system value
rdBrowser, as shown above..
2. Add an Image, Label, or Button element which will become the "print link" in the report.
The rdBrowser Show Modes value causes the Division element (and its child elements) to only be visible when
the report is viewed in a browser; ensuring that it will not appear on the printed report.
Next, select the appropriate actions depending on the type of output required:
To Format Page for HTML Display and Printing
3. As shown above, add Action.Report and Target.Report elements beneath the print link element. Set
the Target.Report element's attributes as shown.
94
Data Analysis using Data Tables
When the print link is clicked, the report will be reformatted and displayed in the browser window. If the Show
Print Dialog attribute was set to True earlier, it will appear to allow printer selection and printing.
Or, To Format Page and Display as PDF
3. As shown above, add Action.ExportPDF and Target.PDF elements beneath the print link element. Set
the Target.PDF element's attributes as shown.
When the print link is clicked, the report will be reformatted, saved as a temporary .PDF file, and displayed using the Adobe PDF Reader browser extension (which must be installed on the client machine). From there, the
report can be saved as another PDF file or printed.
Page headers and footers are rendered separately when exporting to PDF format. Since space is limited on
printable pages, it's advisable to keep the size of page headers and footers small to allow room for the body of
the report.
Note that the web server's local ASPNET or NETWORK SERVICES or Application Pool account must have Full
Control access permissions to the rdDownload folder in your Logi application folder in order to create temporary PDF files.
Or, To Format Page and Display as Word Document
Data Analysis using Data Tables
95
3. As shown above, add Action.Export Native Word and Target.Native Word elements beneath the print
link element. Set the Target.Native Word element's attributes as shown above.
When the print link is clicked, the report will be reformatted, saved as a temporary Word file, and opened using Word. From there, the report can be saved to another Word file or printed. Microsoft Office or the Word
browser viewer must, of course, be installed on the client machine.
Note that the web server's local ASPNET or NETWORK SERVICES, or Application Pool account must have Full
Control access permissions to the rdDownload folder in your Logi application folder in order to create temporary Word files.
96
Data Analysis using Data Tables
Resources and Support
The following resources are available if you need additional information or support:
Corporate Headquarters
Phone:
1-888-564-4965
(703) 752-9700
Fax:
(703) 995-4811
Email:
info@logianalytics.com
Address:
7900 Westpark Drive, Suite A200
McLean, VA 22102
Web site:
www.logianalytics.com
Developer
Network:
http://devnet.logianalytics.com
Sales Department
Email:
Sales@logianalytics.com
Customer Service and Support
Email:
CustomerService@logianalytics.com
Data Analysis using Data Tables
97
Download