Using Birt Report Studio Iserver
Using Birt Report Studio Iserver
Information in this document is subject to change without notice. Examples provided are fictitious. No part of this document may be reproduced or transmitted in any form, or by any means, electronic or mechanical, for any purpose, in whole or in part, without the express written permission of Actuate Corporation. 1995 - 2008 by Actuate Corporation. All rights reserved. Printed in the United States of America. Contains information proprietary to: Actuate Corporation 2207 Bridgepointe Parkway San Mateo, CA 94404 www.actuate.com www.birt-exchange.com The software described in this manual is provided by Actuate Corporation under an Actuate License agreement. The software may be used only in accordance with the terms of the agreement. Actuate software products are covered by certain U.S. patents and patents pending. Actuate Corporation trademarks and registered trademarks: Actuate, the Actuate logo, BIRT, BusinessReports, Collaborative Reporting Architecture, Correlink, Correlink Framework, e.Analysis, e.Report, e.Reporting, e.Spreadsheet, Encyclopedia, Formula One, Interactive Viewing, Internet Spreadsheet, iPortal, Lens, Lens Builder, Live Report Document, Nimble, the Nimble logo, Nimble Technology, Pace, Performancesoft, Performancesoft Track, Performancesoft Views, ReportCast, Report Encyclopedia, ReportingEngines, the ReportingEngines logo, Reportlet, Spreadsheets Everywhere, Tidestone Technologies, and XML reports. Actuate products may contain third-party products or technologies. Third-party trademarks or registered trademarks of their respective owners, companies, or organizations include: Adobe Systems Incorporated: Flash Player. Apache Software Foundation (www.apache.org): Axis, Batik, Batik SVG library, Commons Command Line Interface (CLI), Commons Codec, Derby, Struts, Tomcat, Xalan-J, Xerces, and Xerces2 Java Parser. Bits Per Second, Ltd. and Graphics Server Technologies, L.P.: Graphics Server. Bruno Lowagie and Paulo Soares: iText, licensed under the Mozilla Public License (MPL). Castor (www.castor.org), ExoLab Project (www.exolab.org), and Intalio, Inc. (www.intalio.org): Castor. Codejock Software: Xtreme Toolkit Pro. Component One, LLC.: VSFlexGrid Pro. DataDirect Technologies Corporation: DataDirect JDBC, DataDirect ODBC. Eclipse Foundation, Inc. (www.eclipse.org): Data Tools Platform (DTP) ODA, Eclipse SDK, Graphics Editor Framework (GEF), and Eclipse Modeling Framework (EMF), licensed under the Eclipse Public License (EPL). International Components for Unicode (ICU): ICU library. Liferay (www.liferay.com): Liferay, licensed under the MIT License. Microsoft Corporation (Microsoft Developer Network): CompoundDocument Library. Netscape Communications Corporation, Inc.: Rhino, licensed under the Netscape Public License (NPL). Oracle Corporation: Berkeley DB. Rogue Wave Software, Inc.: Rogue Wave library. Sam Stephenson (prototype.conio.net): prototype.js, licensed under the MIT license. Sun Microsystems, Inc.: JAXB, JDK, Jstl. World Wide Web Consortium (W3C)(MIT, ERCIM, Keio): Flute, JTidy, Simple API for CSS. XFree86 Project, Inc.: (www.xfree86.org): xvfb. All other brand or product names are trademarks or registered trademarks of their respective owners, companies, or organizations. Document No. 081110-2-761302 November 20, 2008
Contents
About Using BIRT Report Studio with iServer System . . . . . . . . . . . . . . . .ix
Part 1
Specifying multiple conditional formatting rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 Reverting to default formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 Changing the order of columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33 Merging data into one column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 Adding a new column header row . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 Changing the page layout to fit data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 Changing the layout type, page size, and orientation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40 Adjusting column widths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42
ii
Filtering empty or blank values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Displaying top or bottom values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specifying a date as a comparison value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Comparing to a string pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Comparing to a value in another column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Defining multiple filter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding a condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Selecting a logical operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specifying the evaluation order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Changing a condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deleting a condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Prompting for filter values at run time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Making a prompt value optional . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Providing the user with a list of values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
79 80 80 80 81 82 82 85 85 87 87 87 88 89
iii
Selecting data for an area, bar, or line chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Selecting data for a pie chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 Selecting data for a meter chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Selecting data for a scatter chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Selecting data for a stock chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124 Displaying additional series information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125 Formatting a chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Changing the size of a chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 Setting a charts width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 Setting a charts height . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 Editing and formatting titles and labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .129 Making a chart look three-dimensional . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130 Changing the position of the legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .131 Formatting labels to fit on the x-axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132 Rotating x-axis labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132 Staggering x-axis labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133 Displaying x-axis labels by interval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Changing the range of values on the y-axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .134 Displaying a chart without the table data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
iv
DAY( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DIFF_DAY( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DIFF_HOUR( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DIFF_MINUTE( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DIFF_MONTH( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DIFF_QUARTER( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DIFF_SECOND( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DIFF_WEEK( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DIFF_YEAR( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FIND( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FIRST( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . IF( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . IN( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ISBOTTOMN( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ISBOTTOMNPERCENT( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ISNULL( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ISTOPN( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ISTOPNPERCENT( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . LAST( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . LEFT( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . LEN( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . LIKE( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . LOWER( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MAX( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MEDIAN( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MIN( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MOD( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MONTH( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MOVINGAVERAGE( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . NOTNULL( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . NOW( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PERCENTILE( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PERCENTRANK( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PERCENTSUM( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . QUARTER( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . QUARTILE( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RANK( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RIGHT( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ROUND( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ROUNDDOWN( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ROUNDUP( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RUNNINGSUM( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SEARCH( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
153 153 154 154 155 155 156 156 157 158 158 159 160 160 161 162 162 163 164 165 165 166 167 167 168 168 169 170 170 171 171 171 172 173 173 174 175 176 176 177 178 178 179
SQRT( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .180 STDEV( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .180 SUM( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 TODAY( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 TRIM( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .182 TRIMLEFT( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 TRIMRIGHT( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .183 UPPER( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 VAR( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 WEEK( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .184 WEEKDAY( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .184 WEIGHTEDAVERAGE( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .185 YEAR( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .185 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 Operators in computed column expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187 Operators in conditional formatting and filter condition expressions . . . . . . . . . . . . . . . . . .188
Part 2
vi
Types of data sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating information objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Design considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Organizing data in a suite of information objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Planning folder names and structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specifying the listing order for information object columns . . . . . . . . . . . . . . . . . . . . . . . Organizing columns into categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating information objects with the IO Design perspective . . . . . . . . . . . . . . . . . . . . . . . . Publishing information objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simplifying access to information objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring the starting folder for finding information objects . . . . . . . . . . . . . . . . . . . . Hiding folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating a custom data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Custom data source example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Developing an Open Data Access (ODA) data driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Developing a custom query builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating the servlet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Compiling the servlet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deploying the servlet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Registering the servlet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring the custom data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using a CSV file as a data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
218 218 218 218 219 221 221 222 224 226 226 230 231 231 233 233 234 235 236 236 237 238
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
vii
viii
Using BIRT Report Studio with iServer System provides information about using and configuring the BIRT Report Studio report design tool. This manual explains how to design a report and how to configure and customize BIRT Report Studio.
About Using BIRT Report Studio with iServer System. This chapter provides an overview of this guide. Part 1. Designing reports using BIRT Report Studio. This part describes the tasks that users complete to design reports. Chapter 1. Getting started. This chapter introduces BIRT Report Studio and describes how to create, save, and run a report. Chapter 2. Editing and formatting report content. This chapter describes the formatting options in BIRT Report Studio, including applying a theme, changing font properties, changing the display of data, formatting data based on conditions, and modifying the page layout. Chapter 3. Inserting calculated data. This chapter describes how to write expressions to calculate data. Chapter 4. Organizing data in a report. This chapter describes how to sort, group, and aggregate data. Chapter 5. Filtering data. This chapter describes how to create filters to display only the information that your report needs. Chapter 6. Presenting data in a chart. This chapter describes the types of charts you can create and discusses the procedures for displaying data in a chart. Chapter 7. Using data from multiple information objects. This chapter explains how to join information objects to access data from multiple data sources.
ix
Chapter 8. Functions and operators. This chapter is a reference to all the supported functions and operators you can use to create calculated data. Part 2. Customizing and Integrating BIRT Report Studio. This part is a guide to customizing and integrating BIRT Report Studio. Chapter 9. Introduction to BIRT Report Studio customization. This chapter introduces BIRT Report Studio, provides an overview of the types of customizations, and lists the Actuate software required to perform the customization tasks. Chapter 10. Creating and publishing report templates. This chapter provides guidelines for designing effective report templates for use with BIRT Report Studio. The chapter also describes the procedures for publishing the templates and their associated resources. Chapter 11. Providing data. This chapter describes the different ways to provide BIRT Report Studio users with data for their reports. The chapter provides guidelines for designing information objects and developing custom data sources. Chapter 12. Configuring BIRT Report Studio. This chapter discusses how to modify the appearance of BIRT Report Studio pages, how to control the functionality available to users, how to customize BIRT Report Studio for different user groups, and how to configure the BIRT Report Studio application. Chapter 13. Actuate BIRT Report Studio URIs. This chapter discusses how to access BIRT Report Studio using a URI and how to use the BIRT Report Studio servlet.
Part
1
Part 1
Chapter
1
Chapter 1
Getting started
About BIRT Report Studio Starting BIRT Report Studio Creating a report Saving a report Running and viewing a report
Figure 1-1
BIRT Report Studio opens in your web browser, as shown in Figure 1-2.
Figure 1-2
Creating a report
After you start BIRT Report Studio, you can either create a new report or open an existing report. When you choose to create a report, BIRT Report Studio displays a series of dialog boxes to guide you through the following required steps:
Select a template on which to base your report. Select a data source that provides the data for your report. Lay out the data in the report. Edit and format the report. Save, run, and view the report.
After you select a template and data source, you perform the following tasks:
Selecting a template
Every report you create in BIRT Report Studio is based on a template. A template determines the basic structure for a report and typically contains report items, such as a report title, a table in which to display data, and page footer items, such as a date and time stamp, page number, or author name. Figure 1-3 shows two templates included in the default installation of BIRT Report Studio.
Figure 1-3
Your version of BIRT Report Studio most likely provides custom templates designed for the types of reports you need to create. Templates are organized into categories. A category is simply a convenient way to group similar templates. Depending on the requirements at your site and the configuration your system administrator implements, the templates can be organized by report types or by departments, or the templates can be stored in a single category. Your access privileges determine which categories and templates you can view and use.
How to select a template for your report
1 When you create a new report, BIRT Report Studio displays Report Template, shown in Figure 1-4. On Report Template, select a template category from the drop-down list. Report Template displays thumbnail images of the templates in the selected category. Figure 1-4 shows sample templates in the Standard category included in the default installation of BIRT Report Studio.
Figure 1-4
2 To view a description of the template, move your cursor over the thumbnail image of the template. 3 Select the template to use, then choose Select.
These data sources contain all the information to connect to a data repository, such as a database, and retrieve a specific set of data. Both types of data sources provide easy access to the data fields that contain the data for a report. For example, an information object or a data set named CustomerData can contain customer information fields, such as customer name, address, phone number, and so on. You choose this data source to create a report that lists customers and their contact information.
How to select a data source
The procedure for selecting a data source for your report depends on the template you select.
If you select a template that includes one or more data sets, the Data dialog box appears, as shown in Figure 1-5. Data displays the data sets included in the template.
Figure 1-5
If you select a template that does not include a data set, BIRT Report Studio prompts you to select an information object stored in the iServer volume. Figure 1-6 shows an example of the dialog box.
Figure 1-6
Navigate to the folder that contains the information object to use. An information object has the file-name extension iob. Select the information object, then choose Select.
After you select a data set or an information object, BIRT Report Studio displays the fields defined in the data set or information object under Available Data, as shown in Figure 1-7. On the right of the application window, BIRT Report Studio displays the basic structure of a report, determined by the template. You are now ready to design your report.
Data fields defined in the selected data set or information object
Figure 1-7
A report title you can edit Another title you can edit A table in which you insert data
Figure 1-8
Press Ctrl, and under Available Data, select each field that you want to insert in the table, then choose Insert. Alternatively, select the fields and drop them in the table. The fields appear in the order in which you select them. Figure 1-9 shows an example of two fields, customerName and phone, inserted in the table.
Figure 1-9
10
For each field you insert, a column appears in the table, displaying up to 50 values. Notice that the field names, customerName and phone, appear at the top of each column. These items are called column headers, and BIRT Report Studio creates them when you insert fields in a table.
Saving a report
Depending on the platform on which you are working, you save a report either to a folder in an iServer volume, or to a folder in a file system. Your access privileges determine the folders in which you can save a report. The first time you save a report, BIRT Report Studio prompts you to select the folder and provide a name and description for the report. The next time you save the report, the report is saved to the same folder and you can choose whether to replace the original report or create a new version.
How to save a new report
1 Choose Save from the toolbar. The first time you save a report, Save Report Design appears, as shown in Figure 1-10. This dialog box typically displays your home folder. 2 Navigate through the folder structure to select a folder. 3 In File Name, type a name for the report. The file name can contain alphanumeric characters and spaces, but cannot contain punctuation. 4 Optionally, in Description, type a brief description of the report. A description is helpful if you are sharing this report with other users. Save as type shows that the report is saved as a BIRT Report Design file with a .rptdesign file-name extension.
11
Figure 1-10
Sometimes you need to create a new version of a report while retaining the original report or you want to save the report in a different folder. To accomplish either task, choose Save As from the toolbar. In Save Report Design, select a folder and type a file name in the same way as you would using Save.
12
Figure 1-11
13
14
Chapter
2
Chapter 2
Editing and formatting options Removing items from a report Editing labels Applying a theme Selecting an item for formatting Changing font properties Changing the alignment of text Applying a number format Applying a date-and-time format Applying a string format Formatting data based on conditions Reverting to default formats Changing the order of columns Merging data into one column Adding a new column header row Changing the page layout to fit data
15
1 On the left side of the window, select Report Items. A list of every item in the template appears. Figure 2-1 shows an example of such a list. 2 Select the items to display in the report. If you are not sure which item in the list corresponds to which item in the report design, select or deselect one item at a time, choose Apply, and see what item appears or disappears from the design.
16
Figure 2-1
Editing labels
Labels contain static text. In a typical template, some labels are editable, others are not. Examples of labels you can edit include report titles or author names. Examples of non-editable labels include standard copyright or confidentiality statements. When you insert data fields in a table, BIRT Report Studio displays the values in rows and columns and creates labels, or column headers, that show the names of the data fields. These names are appropriate in a database, but usually are not suitable for a report. You typically edit the text in these column headers.
How to edit a label
1 Double-click the label. The label becomes an editable field that contains a blinking cursor. 2 Delete the existing text and type the text to display. 3 Press Enter. The edited text appears in the label.
Applying a theme
A theme in a template is similar to a theme in Microsoft Windows. A Windows theme helps you personalize, with one click, your computer display to show a particular background and custom color and fonts settings for various items, such as title bars, buttons, and icons. Similarly, a template theme can determine the set of colors used in the report, such as the background color for column headers or
17
data rows. A theme can also determine the font used in specific report items, the spacing between rows, the styles of borders, the alignment of text, and much more. Themes are optional. A template can, but does not have to include themes. A template includes multiple themes if the template designer decides to provide users with different style options to apply to a report. On the other hand, a template does not include themes if, for example, a particular type of report must adhere to a specific layout and style.
How to apply a theme
1 On the left side of the window, select Themes. A list of available themes appears, if the template includes themes. Figure 2-2 shows an example of a list of themes.
Figure 2-2
2 Select a theme and choose Apply. The report design reflects the styles defined in the theme.
18
selected item. Figure 2-3 shows an example of a selected column header. Figure 2-4 shows an example of a selected column.
Figure 2-3
Figure 2-4
You cannot select a single row of data in a table, nor can you select a single data value. If you want to highlight a particular row or value, use conditional formatting. This topic appears later in this chapter.
19
1 Select the label, column header, or column. A box appears around the selected element. 2 From the toolbar, choose Font. Font, shown in Figure 2-5, displays the current font property values. A value of Auto means the property uses a default value, which is specified by a theme, the template, or the software.
Figure 2-5
3 Use the drop-down lists to change the font properties for the selected element, then choose Apply.
1 Select the label, column header, or column. A box appears around the selected element. 2 From the toolbar, choose one of the alignment options, Align Left, Align Center, or Align Right, as shown in Figure 2-6.
20
Figure 2-6
How the data is stored The locale to which the system is set The format, if any, set by the template or theme
BIRT Report Studio provides common formats you can use to change how numbers appear. You can, for example, display numbers with or without decimal values, in scientific notation, as a percentage, or with a currency symbol. Note that even though a column displays numbers, the data can be of string data type. Postal codes, for example, are frequently stored as string data. Numeric formats do not apply to numbers of string type. When you select a column for formatting, the title of the formatting dialog box tells you what type of data the column contains.
How to apply a number format
1 Select a column that contains numeric data. 2 From the toolbar, choose Format Data. 3 On Number Column Format, select a format from the drop-down list, as shown in Figure 2-7. You can select a standard format or define a custom format. The standard and custom formats are described in the next sections.
Figure 2-7
21
Example of data display 6066.45 or 6066.5 or 6067, depending on the original value. This format displays up to two decimal places. Whole numbers and numbers with one or two decimal places appear in their original format. $6,067.45 or 6067 or 6,067, depending on the symbol, symbol position, decimal place, and thousands separator values you set. 6067 or 6067.5 or 6,067.45, depending on the decimal place and thousands separator values you set. 45% or 45.8% or %45, depending on the symbol position and decimal place values that you set. This format multiplies the original value by 100 and adds the percent (%) symbol. 2E04 or 2.67E04, depending on the decimal place value you set. The number after the E represents the exponent of 10. For example, 2.67E04 means 2.67 multiplied by 10 raised to the fourth power.
Currency
Fixed Percent
Scientific
22
Table 2-2
$#,### ID #
1 Select a column that contains date-and-time data. 2 From the toolbar, choose Format Data. 3 On Date/Time Column Format, select a format from the drop-down list. You can select a standard format or define a custom format. The standard and custom formats are described in the next sections.
Figure 2-8
23
Figure 2-9
Description Short year Long year Month as a number Short month name Full month name Day in month Week in month Week in year Day in year Short day of week Long day of week Hour in day (0 - 23) Hour in day (1 - 24) Hour in AM/PM (0 - 11) Hour in AM/PM (1 - 12) Minutes
24
Table 2-3
Symbol ss
Description Seconds
Example 55
Table 2-4 shows examples of custom formats and their effects on a date that is stored as April 15, 2006 12:15:30 PM.
Table 2-4 Results of custom date formats
Result of formatting 04-15-06 Fri, 4/15/2006 Apr 15 April 2006 3 (the week in the month) 15 (the week in the year) 105 (the day in the year) 12:15:30
1 Select a column that contains string data. 2 From the toolbar, choose Format Data. 3 On String Column Format, select a format from the drop-down list. You can select a standard format or define a custom format. Standard and custom formats are described in the next sections.
25
Symbol @
Description Character placeholder. Each @ character displays a character in the string. If the string has fewer characters than the number of @ symbols that appear in the format pattern, spaces appear. Placeholders are filled from right to left, unless you specify an exclamation point (!) at the beginning of the format pattern. See Table 2-7 for examples. Same as @, except if the string has fewer characters, spaces do not appear. See Table 2-7 for examples. Specifies that placeholders are to be filled from left to right. See Table 2-7 for examples. Converts string characters to uppercase. Converts string characters to lowercase.
Table 2-7 shows examples of custom string format patterns and their effects on string data.
Table 2-7 Results of custom string formats
26
Table 2-7
Format pattern !(@@@) @@@-@@@@ !(&&&) &&&-&&&& !(@@@) @@@-@@@@ + ext 9 !(&&&) &&&-&&&& + ext 9 >&&&-&&&&&-&& <&&&-&&&&&-&&
Data in original format 6175551007 5551007 6175551007 5551007 5551007 5551007 D1234567xy D1234567xy
Results of formatting (617) 555-1007 (555) 100-7 (617) 555-1007 (555) 100-7 (555) 100-7 + ext 9 (555) 100-7 + ext 9 D12-34567-XY d12-34567-xy
1 Right-click the column whose data you want to format. Choose FormatConditional Formatting. 2 On Conditional Formatting, create a rule to specify the following:
The format to apply, such as bold style. Choose Format to select formatting options. The condition that must be true in order to apply the format, for example, Profit Greater than or Equal to 2000. For more information about specifying a condition, see the next section.
Figure 2-10 shows an example of a rule specified for a selected column, Profit.
27
Figure 2-10
3 Choose Apply. Figure 2-11 shows the conditional formatting applied to the report. In the Profit column, numbers greater than 2000 are displayed in bold.
Figure 2-11
28
Specifying a condition
The condition part of a conditional formatting rule is an If expression that must evaluate to true. For example:
If If If If the the the the order total is less than 1000 customer credit limit is between 10000 and 20000 sales office is Tokyo order date is 7/21/2008
The Conditional Formatting dialog box helps you construct the If expression by breaking it down to its logical parts. In Figure 2-10, the expression consists of three parts. In Figure 2-12, the expression has four parts. In the first field, select a column. This column contains the value that determines when conditional formatting takes effect. The selected column does not have to be the same as the column you selected for formatting in the report design. For example, if Product Name is the column selected for formatting, you can select Profit in this field to indicate that for a certain profit amount, conditional formatting applies to the product name. In the second field, select the comparison test, or operator, to apply to the selected column. You can select Equal to, Less than, Less than or Equal to, and so on. If you select Is Null, Is Not Null, Is True, or Is False, the If expression does not require additional information. For more information about the operators, see Chapter 8, Functions and operators. If the selected operator requires a comparison to one or more values, one or more additional fields appear. For example, if you select Less than or Equal to, a third field appears. In this field, you type the comparison value. If you select Between or Not Between, a third and fourth field appear. In these fields, type the lower and upper values, as shown in Figure 2-12.
Figure 2-12
29
between 1000 and 2000. The 1000 and 2000 values are literal values that you type. Alternatively, you can select from a list of values from the Profit column. Selecting from a list of values is useful if the comparison value is a product name and you do not know the exact product names, or if the comparison value is a date and you do not know the date format to type. If the comparison value is a date, BIRT Report Studio also provides a calendar tool, which you can use to select a date.
How to select a comparison value from a list of values
1 On Conditional Formatting, below the field that takes a comparison value, choose Change Value. 2 On Value, select Specify literal value, and choose Select Values. The values in the selected column appear. Figure 2-13 shows an example of the values in a product name column.
Figure 2-13
3 If there are too many values in the list, you can type a string in Filter Text to search for values that begin with that string. For example, you can type 18 to view all product names that begin with 18. You cannot search for strings that appear in the middle of a name. 4 Select a value from the list, then choose Apply. The value appears in the comparison value field on Conditional Formatting.
30
1 On Conditional Formatting, below the field that takes a comparison value, choose Change Value. 2 On Value, select Use value from data field. A list of columns used in the report appears. 3 Select a column from the list, then choose Apply. The column name appears in the comparison value field on Conditional Formatting. Figure 2-14 shows a condition where the sale price value is compared with the MSRP value. If the sale price value is greater, the product name is displayed in bold.
Figure 2-14
Figure 2-15 shows the conditional formatting applied to the report design.
Figure 2-15
31
Figure 2-16
For each row of data in the report, BIRT Report Studio evaluates the rules in the order in which they appear in the list of rules. As it evaluates each rule, BIRT Report Studio applies the specified format properties if the condition is met. When creating multiple rules for a column, be careful that the conditions do not cover overlapping values. Consider the following scenario:
The first rule sets a profit value to blue if the value exceeds 5000. The second rule sets the profit value to green if the value exceeds 1000.
If the profit value is 6000, the value appears in green, not blue as you expect, because the condition in both rules is true (6000 exceeds 5000 and 1000), and the second rule supersedes the first rule. For the rules to make sense, the second rule should set the profit value to green if the value is between 1000 and 5000.
32
revert an element to its default font formats, select the element, choose Font, and set the properties to Auto. To reset text alignment, select the element, and choose an alignment option. You cannot re-apply a theme to revert to all the default formats in one step. If you applied a number, date-and-time, or string format to a column of data, you also can restore these values to the original format specified by the data source. To do so, select the column, choose Format Data, and select the Unformatted option.
Select the column and drag it to the new location. As you drag the column, a solid vertical line indicates where you can drop the column.
Rectangle indicates the column being moved
Figure 2-17
Moving a column
Right-click any column and choose ColumnReorder Columns. On Re-order Columns, shown in Figure 2-18, select each column to move, and click the up or down arrow until the column is in the desired position. Moving a column up the list moves the column to the left in the table.
33
Figure 2-18
Figure 2-19
34
Figure 2-20
When you merge data from multiple columns, the column headers also appear on multiple rows, as shown in Figure 2-20. You can improve the format by merging the column headers to remove the City, State, Zip column headers, and editing the remaining column header. Figure 2-21 shows the improved format.
Figure 2-21
35
1 Select all the columns that contain the data to merge. Press Ctrl as you select each column. 2 Right-click one of the selected columns, then choose ColumnMerge Columns, as shown in Figure 2-22.
Figure 2-22
Merging columns
1 Select the column header in the bottom row, as shown in Figure 2-23. Rightclick the selected column header, then choose CellMerge Up.
Figure 2-23
2 Repeat the previous step until only one column header remains.
36
Figure 2-24
A report design displaying text in a row above the column header row
When you insert a row, the new row contains the same number of columns as the other rows in the table. To display text that spans multiple columns as shown in Figure 2-24, you must first merge the columns in that row. As Figure 2-24 shows, you also can add borders to a row.
How to add a new row
1 Select a column header. 2 Right-click the column header, then choose RowInsert Row Above to add a row above the selected column header. Choose RowInsert Row Below to add a row below the selected column header.
Select a column header, then right-click it to choose a row insertion option
Figure 2-25
A new row appears. Figure 2-26 shows a new row inserted above the default column header row. The row has the same formatting as the row below it.
37
Figure 2-26
A report design displaying an empty row above the column header row
How to merge column headers to type text that spans multiple columns
1 Select the first column header in the new row. Right-click the column header, then choose CellMerge Right, as shown in Figure 2-27. The first cell merges with the second cell to become a single wider cell.
Figure 2-27
2 Repeat the previous step to merge all the cells in the column. Figure 2-28 shows the selection of a single cell created by merging six cells.
Figure 2-28
3 To display text in this cell, double-click in the cell, type the text, then press Enter.
38
4 To add borders: 1 Select the cell. Right-click it and choose FormatBorder, as shown in Figure 2-29.
Figure 2-29
2 On Border, specify the type of border or borders to add. You can set the border style, color, and width. Figure 2-30 shows the bottom border set to create a solid white border, one pixel wide.
Figure 2-30
39
Figure 2-31
If you intend to print a report or export the report to a page-based format such as PDF or Word document, check the report output in those formats to ensure that all the data fits on the page. Figure 2-32 shows a portion of the example report in PDF format. The Zip Code column does not fit on the page and is cut.
Figure 2-32
Default layout in a PDF document does not accommodate all the data
You can change the page layout to better fit the data in your report by using the following techniques:
Changing the layout type, page size and orientation Adjusting the widths of the columns
40
Expand Width setting, the page size values apply only to PDF and printed reports.
How to set the layout type, page size, and orientation
1 On the left side of the window, select Page Setup. 2 Set the following options: 1 In Layout Preference:
Select Auto Expand Width to set the column widths based on the other page options you select and on the number of columns in the table. Select Fixed Width to set the page width and precise column widths yourself.
2 In Orientation, select either Portrait or Landscape mode. If your table is too wide to print in a standard 8.5 inch page width, select Landscape. 3 In Paper Size, select one of the standard sizes, A4, US Letter, or US Letter. Alternatively, select Custom to set a custom page width and height. 4 If you choose Custom, specify the page size values in Width and Height. 5 In Top Margin, Bottom Margin, Left Margin, and Right Margin, specify the margin sizes to use for each page. Figure 2-33 shows an example of settings in Page Setup.
Figure 2-33
41
1 Select the column, right-click it, then choose ColumnColumn Width. 2 On Column Properties, shown in Figure 2-34, type the width value. The default unit is inches, but you can select cm, mm, picas, or points.
Figure 2-34
If you prefer to work visually, you can adjust the width of a column by dragging its border, as shown in Figure 2-35.
Figure 2-35
42
Chapter
3
Chapter 3
About calculated data Creating a computed column Adding data fields for an expression Writing expressions
43
Figure 3-1
44
Figure 3-1, each value in the Total column is calculated by multiplying the value in the QUANTITYORDERED field with the value in the PRICEEACH field. Figure 3-2 shows the following expression specified for the computed column, Total:
[QUANTITYORDERED] * [PRICEEACH]
When you refer to a data field in an expression, you must enclose the field name within square brackets ([ ]). The field names are case-sensitive.
Figure 3-2
BIRT Report Studio supports typical mathematical operations, such as addition, subtraction, multiplication, and division. Computed columns, however, are not limited to mathematical calculations. BIRT Report Studio also supports many functions for manipulating date-and-time and string data. A function is a set of instructions that do something and return a result. For example, if a customer name field contains values with leading or trailing blank characters, you can remove the blank characters by using the TRIM( ) function as follows:
TRIM([CustomerName])
In this example, [CustomerName] is the input value, or argument, you supply to the TRIM( ) function to tell the function to trim the values in the CustomerName field. More examples of expressions used in computed columns appear later. For descriptions of the supported functions, see Chapter 8, Functions and operators.
45
1 Select the table column to the left of the new computed column you want to insert. 2 On the toolbar, choose New Computed Column, as shown in Figure 3-3.
Figure 3-3
The Calculation dialog box appears. 3 In Column Label, type a name for the computed column. The name you specify appears in the column header. 4 In Enter Expression, type the expression to calculate the values you want to display.
To use a data field in the expression, type the left square bracket ([), then select a field from the list that appears, as shown in Figure 3-4.
Figure 3-4
The list shows only the fields in use in the report design. It does not show all the fields in the data set. To use a field that is not in the list, you must add the field to the report design. This task is described later in this chapter.
46
To use a function, type the first letter of the function, then select a function from the list that appears, as shown in Figure 3-5. The functions indicate the arguments, if any, you need to supply.
Figure 3-5
5 When you finish writing the expression, choose Validate. If the expression is syntactically correct, the dialog box displays the message, This Expression is valid. If the expression contains an error, the dialog box displays a message that describes the error. 6 After you validate the expression, choose Apply. The computed column appears in the report design.
47
1 Right-click the tab at the left of the table, as shown in Figure 3-6.
Figure 3-6
2 Choose Data Fields. The Data Fields dialog box appears. Figure 3-7 shows an example of Data Fields displaying two fields, customerName and phone, currently used in the table.
Figure 3-7
3 Choose Add More Fields. Data Set displays all the fields in the data set, as shown in Figure 3-8.
Figure 3-8
48
4 Select the field to add. To add multiple fields, press Ctrl as you select each field. Choose Add. 5 Choose Apply. The selected fields are available to use in any expression. If you are in the process of defining an expression for a computed column, you can choose the Add Data Field link, as shown in Figure 3-9, then follow steps 2 to 5 to add fields.
Choose this link to add data fields to use in the expression for the computed column
Figure 3-9
Writing expressions
An expression is a statement that produces a value. An expression can be a literal value, such as:
1.23 "Hello, World!"
An expression can contain any combination of literal values, operators, functions, and references to data fields, as shown in the following examples. The following expression displays a customers first and last names stored in two fields. The & operator concatenates string values.
[FirstName] & [LastName]
The following expression displays a full address by concatenating values from four data fields and adding commas where appropriate:
[Address1] & ", " & [City] & ", " & [State] & " " & [Zipcode]
49
The following expression calculates a gain or loss in percent. The expression uses the subtraction, division, and multiplication operators, -, /and *.
([SalePrice] - [UnitPrice])/[UnitPrice] * 100
The following expression uses the DIFF_DAY( ) function to calculate the number of days it took to process an order for shipping. The function takes two arguments, a start date and an end date. In the example, two data fields are supplied as the arguments. BIRT Report Studio runs this expression against each value in the fields and calculates a value for each data row.
DIFF_DAY([OrderDate], [ShippedDate])
The following expression uses the ADD_DAY( ) function to calculate a payment due date when the payment term is net 30. The function takes two arguments, a start date and the number of days to add.
ADD_DAY([InvoiceDate], 30)
The following expression uses the IF( ) function to evaluate if the value in the country column is UK. If the condition is true, the function replaces the value with United Kingdom. If the condition is false, the country values appear as stored.
IF(([Country]="UK"),"United Kingdom",[Country])
Similarly, when you create an expression that contains a literal date, type the date according to the conventions of the US English locale. For example, if you are working in the French locale, type 03/12/2007 to represent March 12, 2007. Do not type 12/03/2007, which is the convention for the French locale. You must enclose literal date values in double quotation marks(" "), as shown in the following expression that calculates the number of days from the order date to Christmas:
DIFF_DAY([OrderDate], "12/25/08")
50
Report Studio uses square brackets to denote a data field. The following characters are reserved in BIRT Report Studio:
[ ] ? ' (single quotation mark)
If the name of a data field contains reserved characters, BIRT Report Studio removes the reserved characters when you select the data field to use in an expression. For example, if the name of a data field is OBSOLETE?, BIRT Report Studio changes it to [OBSOLETE] in the expression. If you type [OBSOLETE?] in the expression, the dialog box displays an error message. To avoid syntax errors, always select the field and let the software construct the correct expression. Figure 3-10 shows an example of the Calculation dialog box displaying a list of data fields, three with reserved characters in their names. The third, fourth, and fifth fields show both versions of their names, the changed name and the original name with reserved characters, as follows:
[PRODUCTCODE4digit] - PRODUCTCODE[4-digit] [OBSOLETE] - OBSOLETE? [ORDERS STATUS] - ORDER'S STATUS
Figure 3-10
51
52
Chapter
4
Chapter 4
Sorting data Organizing data in groups Organizing data in sections Aggregating data Hiding details Starting each group or section on a new page
53
Sorting data
When you insert data in a report design, the data set determines the default sort order for the data rows. If the data set sorts a field in ascending order, the column values appear sorted in ascending order in the design. Typically, however, data appears randomly. A field is likely to display customer names, for example, in the order in which customers were added to the database, rather than in alphabetical order. Sorting data, therefore, is an important task in creating a useful report. Compare the reports in Figure 4-1.
Figure 4-1
The report on the left displays the data rows in the order the data set returns them. The report on the right displays the same data, except that the rows are sorted by country in alphabetical order. You can sort data in ascending or descending order, and you can sort data by multiple columns. For example, you can sort the data shown in the reports in Figure 4-1 by country, and then by customer name. Figure 4-2 shows the results of such a sort. For rows where the country names repeat (France and USA), the customer names appear in alphabetical order.
Figure 4-2
54
Figure 4-3
1 Select a column. You can select any column in the table. 2 Right-click the selected column, then choose SortAdvanced Sort from the context menu. 3 On Advanced Sort, select a column from the first drop-down list and choose either Ascending or Descending order. 4 Select another column from the second drop-down list and choose the sort order. 5 Optionally, select a third column on which to sort. Figure 4-4 shows the sort criteria for the report design shown in Figure 4-2.
Figure 4-4
55
Figure 4-5
56
office, then by product line. Notice the repeated sales office name and product lines.
Figure 4-6
The report design in Figure 4-7 shows the same data. Unlike the previous report design, this design groups the rows by sales office then by product line. Data appears in a hierarchy. The office names and product lines are not repeated. In addition, totals, displayed in italics, appear at the end of each product line and sales office group. As the example reports demonstrate, a report design that groups data provides a more effective way to view data. When you group data, you can:
Add subtotals, counts, averages, or other aggregate information at the beginning or end of each group. Insert a page break before or after each group to start each group of data on a new page. Hide the details of each group to view a summary report. Removes duplicate values. Sorts the values of each group. For example, a product line group displays the product lines in alphabetical order (Classic Cars to Vintage Cars), as the report in Figure 4-7 shows.
In addition, BIRT Report Studio does the following when you group data:
57
Generates a table of contents when you view the finished report in the viewer. The table of contents, which displays the group values, supports navigating to specific locations in the report. This feature is particularly useful when a report contains many pages.
Figure 4-7
How to group data
A report design displaying data grouped by sales office and product line
1 Select the column that contains the data to group. 2 On the toolbar, choose Add Group, as shown in Figure 4-8.
58
Figure 4-8
If the column you select contains string or numeric data, BIRT Report Studio groups the data by each unique value in the column. If the column you select contains date-and-time data, you have additional grouping options described next.
Figure 4-9
1 Select the column that contains the date-and-time values to group. 2 On the toolbar, choose Add Group. 3 On Group Details, select one of the group options. If you opt to group by interval:
Select an interval type, such as weeks, months, or quarters, from the dropdown list.
59
Type a number to indicate grouping data by the number of the selected interval type. For example, if you selected Weeks, type 2 to group data in two-week periods.
Figure 4-10
1 Select any column. 2 Right-click the selected column, then choose ColumnReorder Columns. Reorder Columns, shown in Figure 4-11, displays the grouped columns in the order in which the report design currently groups the data. 3 Under Grouped Columns, select a column and use the up or down buttons to move the column up or down the list. Choose Apply.
60
Figure 4-11
Removing a group
Remove a group if you want to redisplay the values in the detail row. Select the column whose values you want to ungroup, then choose Delete Group from the toolbar, as shown in Figure 4-12.
Figure 4-12
When you remove a group, all information associated with the group is also removed. For example, if the report design displays aggregate data at the group level, this data is removed, too.
61
Sales office group value appears under the corresponding column header Product line group value appears under the corresponding column header Column headers
Detail rows
Figure 4-13
Figure 4-14
In Figure 4-13, the report design with groups displays the data from five fields in five columns. The sales office and product line values appear in the left-most columns below the column headers. In the report design with sections, the sales office and product line values appear above the column headers. As you can see from the examples, organizing data in sections reduces the overall width of the table. If your report design displays many columns and space is tight, this difference can be reason enough to create sections instead of groups.
62
Aside from the differences in the way information is arranged, organizing data in sections provides the following benefits over organizing data in groups:
You can insert multiple charts, one in each section, to reflect the aggregated data contained in each section. On the other hand, in a table that contains data groups, you can display only one chart, which presents the aggregated data for the overall table. Charts are described later in this guide. You can display additional data fields in a section heading. By default, a section heading displays only a label and the section value, as shown in the report design in Figure 4-14.
You can use both groups and sections in a single report design. Figure 4-15 shows a report design that contains the same data as the previous examples, except the sales office column is a section, and the product line column is grouped.
Report section Grouped column
Figure 4-15
1 Select the column that contains the data you want to organize in a section. 2 On the toolbar, choose Add Section, as shown in Figure 4-16.
Figure 4-16
Just as with groups, if the column you selected contains string or numeric data, BIRT Report Studio creates a section for each unique value in the column. If the column you selected contains date-and-time data, you can create sections based on individual date values or you can create sections that group dates by interval.
63
Figure 4-17
A section heading
You can add the contents of other data fields in a section heading. In the sales office section heading, for example, you can add the address of the sales office or the e-mail of the sales representative. Figure 4-18 shows an example.
Figure 4-18
The data fields that you can add to a section heading are the data fields that are currently in use in the table in the report design. If a data field is not in the table, but is included in the data set, you can add the data field to the table. This task is described in the previous chapter.
How to add content to a section heading
1 Select the section heading. 2 Right-click the section heading, then choose Section Heading. A dialog box displays a list of the data fields currently used in the report design. 3 Select the data field to add to the section heading, as shown in Figure 4-19.
Figure 4-19
Select Data Fields for Section Heading displaying fields that you can add to a section heading
64
Removing a section
You can remove a section to reorganize data. When you remove a section, the values in the section do not re-appear in the detail rows. Instead, the values appear in a grouped column. Any aggregate data calculated for the section is removed. Any chart you inserted in the section is also removed. To remove a section, select the section heading, then choose Delete Section from the toolbar, as shown in Figure 4-20.
Choose Delete Section
Figure 4-20
Deleting a section
Figure 4-21 shows the report design after the product line section is deleted from the design shown in Figure 4-20. The product line section becomes a grouped column.
Figure 4-21
65
Aggregating data
One of the key features of any report is the ability to display summary, or aggregate, data. Many of the example report designs shown in the previous sections contain aggregate data. The product profitability report design, for example, shows sales and profit subtotals for each product line by sales office, a sales and profit total for each sales office, and grand totals for the company. Aggregating data involves performing a calculation on a set of values. For a simple listing report that does not organize data in groups or sections, aggregate calculations are performed on values in a selected column, over all the data rows in a table. The listing report design in Figure 4-22 displays aggregate data for the Total and the Profit columns at the end, or footer, of the table.
Aggregate data
Figure 4-22
For a report design that organizes data in groups or sections, as shown in Figure 4-23, you can display aggregates for a selected column or columns, for each group of data rows, and for all the data rows in the table. In this report design, the aggregate data appears at the footer of each group and at the footer of the table. When you aggregate data in a selected column, you specify the following information:
The type of aggregate calculation. The report design in Figure 4-23 displays, for both the Total and Profit columns, the sum of the values, the highest (max) value, and the average value. For each column, you can display a maximum of three aggregations. Each aggregation appears on a separate row. Whether to perform the aggregate calculation over all the data rows in the table, or over the data rows in each group, or both. Aggregating data for groups applies only to report designs that organize data in groups or sections.
66
Whether to display the aggregate data in the footer or header of the table or the groups. The previous examples show aggregate data in the footers, which is typical. Choose header to display the aggregate data at the beginning of the table or group.
Aggregate data for the product line group, Motorcycles Aggregate data for the sales office group, San Francisco Aggregate datagrand totalscalculated over all data rows in the table
Figure 4-23
The aggregate calculations you can perform on a column depend on the columns data type. Aggregate functions that perform a mathematical calculation, such as Sum and Average, apply only to numeric data. The most common aggregate functions used for string data are Count and Count Value. Count returns the number of values in a column, including duplicate values. Count Value returns the number of distinct values in the column. For date-and-time data, you can use the Min and Max functions to get the earliest and the latest date, respectively, from an order date column. For descriptions of the supported aggregate functions, see Chapter 8, Functions and operators.
How to aggregate data
67
2 Choose Aggregation from the toolbar. Aggregation appears, as shown in Figure 4-24.
Figure 4-24
Select table to aggregate data over all the data rows in the table. If you select table, select either header or footer as the location in which to display the aggregate data. Select group to aggregate data at the group level. If you select group, select either header or footer as the location in which to display the aggregate data.
5 In Enter Label, type the text to display next to the aggregate value. By default, BIRT Report Studio uses the name of the function you selected. You can, for example, replace Max with the following text:
Highest value
6 If you want to calculate and display a second aggregation, choose Add Aggregation. Follow steps 3 to 5 to define the next aggregation. 7 Choose Apply. Figure 4-25 shows the three aggregations defined for the report design in Figure 4-23.
68
Figure 4-25
Hiding details
When you create a report that organizes data in groups or sections, you can change the report to a summary report by hiding the details of a group or section. Hiding details, particularly for a report that runs into hundreds of pages, shows key information at a glance. Figure 4-26 shows two report designs that contain the same data. The design on the left shows all details. The design on the right hides the details within each product line section.
69
Figure 4-26
1 Select the grouped column whose details to hide. 2 Right-click the column, then choose GroupHide Detail, as shown in Figure 4-27.
Product Line grouped column selected
Figure 4-27
In the example shown in Figure 4-27, all the detail rows for every product line group are hidden.
70
1 Select the section heading of the section whose details to hide. 2 Right-click the section heading, then choose SectionHide Detail, as shown in Figure 4-28.
Sales Office section heading selected
Figure 4-28
Select the grouped column or section heading, right-click the object, then choose GroupShow Detail or SectionShow Detail.
71
1 Select a grouped column or section heading. Right-click the object, then choose GroupPage Break or SectionPage Break. Page Break appears, as shown in Figure 4-29.
Figure 4-29
2 On Page Break, select After or Before from the drop-down list to insert a page break after or before a group or section.
Choose Always to always insert a page break after each group or section. Choose Always except last to always insert a page break after each group or section, but not after the last. This is the typical option to avoid a blank page at the end of the report. Choose Always to always insert a page break before each group or section. Choose Always except first to always insert a page break before each group or section, but not before the first. This is the typical option to avoid a blank page at the beginning of the report.
72
Chapter
5
Chapter 5
Filtering data
About data filtering Filtering options Creating a filter Defining multiple filter conditions Prompting for filter values at run time
73
Filtering options
You can filter data at the data set level and at the table level. Filtering at the data set level narrows the scope of data available to a report design, and can improve design time performance if the data set returns a particularly large amount of data. Filtering at the table level narrows the scope of data displayed in a table, and is the typical filtering option. If you filter data at both the data set and table levels, BIRT Report Studio executes the filter at the data set level first, then at the table level. Design the filters accordingly. For example, if a data set returns all customer sales for ten years, you can create a filter at the data set level to limit the sales data to the current year. Then, when you design your report, you can create a filter at the table level to display sales data for a particular quarter in the current year. You cannot display sales data for the previous year because the filter at the data set level excludes this data.
Creating a filter
When you create a filter, you define a condition that specifies which data rows to include in your report. A filter condition is an If expression that must evaluate to true in order for a data row to be included. For example:
If the order total is greater than 10000 If the sales office is San Francisco If the order date is between 4/1/2008 and 6/30/2008
74
Figure 5-1 shows an example of a condition defined in Filter. As the illustration shows, Filter helps you define the condition by breaking it down to the following parts:
The column to evaluate, such as order total. The comparison operator that specifies the type of comparison test, such as Greater Than. For information about all the operators, see Chapter 8, Functions and operators. The value to which all values in the column are compared, such as 10000.
The column to evaluate The comparison operator The value to compare to
Figure 5-1
The procedure for creating a filter is similar whether you create it at the data set level or the table level. The difference is how you access the Filter dialog box.
How to create a filter at the table level
1 Select the column that contains the value that determines when the filter takes effect. For example, to create a filter that retrieves data rows where the sales office is Boston, select the sales office column. 2 On the toolbar, choose Filter. Filter appears, as shown in Figure 5-2.
Figure 5-2
75
3 In Condition, select the comparison test, or operator, to apply to the selected column. Depending on the operator you select, Filter displays one or two additional fields, or a completed filter condition. 4 If you selected an operator that requires a comparison value, you can specify the value in one of the following ways:
Type the value. Choose Select Values to select from a list of values. Figure 5-3 shows the selection of Boston from a list of possible sales office values.
Figure 5-3
5 Choose Apply. The filter takes effect. In some cases, the sample data used in the report design does not meet the filter condition. When this happens, the report design does not show any data, and BIRT Report Studio displays the message shown in Figure 5-4. The best way to test a filter is to run the report and view the generated report.
Figure 5-4
The message displayed when the sample data used in the report design does not meet the filter condition
76
1 Under Available Data, choose the Filter button, as shown in Figure 5-5.
Choose the Filter button
Figure 5-5
Filter Pane appears below your report design. It is empty, as shown in Figure 5-6, if you have not yet defined any filters at the data set level.
Figure 5-6
Filter Pane
2 Choose Add to create a new filter. Advanced Filter appears, as shown in Figure 5-7.
Figure 5-7
77
3 Define the filter condition. For more information about how to define a basic filter condition, see the previous procedure, How to create a filter at the table level.
Figure 5-8
Excluding data
You use comparison operators, such as Equal to, Greater Than, or Less Than, to evaluate the filter condition to determine which data to include. Sometimes it is more efficient to specify a condition that excludes a small set of data. For example, you need sales data for all countries except USA. Instead of selecting all the available countries and listing them in the filter condition, simply use the Not Equal To operator. Similarly, use Not Between to exclude data in a specific range, and Not Like to exclude data that matches a string pattern.
78
For example, the following filter condition excludes orders with amounts between 1000 and 5000:
OrderAmount Not Between 1000 and 5000
The filter condition in the next example excludes products with codes that start with MS:
ProductCode Not Like MS%
The following filter condition displays only rows where the e-mail column contains null values:
e-mail Is Null
When filtering blank values, use the Is Blank operator. For example, to exclude rows with blank values in an e-mail column, specify the following filter condition:
e-mail Is Not Blank
Conversely, to display only rows where the e-mail column contains blank values, create the following condition:
e-mail Is Blank
In a report, you cannot distinguish between an empty value and a blank value in a string column. Both appear as missing values. If you want to filter all missing values whether they are null or blank, specify both filter conditions as follows:
e-mail Is Not Null and e-mail Is Not Blank
79
The filter condition in the next example displays the median prices in the bottom 10 percent. If there are 1000 rows of data, 100 rows are displayed.
MedianPrice Bottom Percent 10
For your convenience, BIRT Report Studio provides a calendar you can use to select a date. Figure 5-9 shows the calendar and how to access it.
Click to open the calendar
Figure 5-9
80
example, to display only customers whose names start with M, use the Like operator and specify the string pattern, M%, as shown in the following filter condition:
Customer Like M%
% matches zero or more characters. For example, %ace% matches any value that contains the string ace, such as Ace Corporation, Facebook, Kennedy Space Center, and MySpace. _ matches exactly one character. For example, t_n matches tan, ten, tin, and ton. It does not match teen or tn.
To match the percent sign (%) or the underscore character (_) in a string, precede those characters with two backslash characters (\\). For example, to match S_10, use the following string pattern:
S\\_10
1 Select the column that contains the values to compare, then choose Filter on the toolbar. 2 On Filter, choose Advanced Filter. 3 In Condition, select a comparison operator. 4 Choose Use value from data field. 5 From the drop-down list that appears, choose the column that contains the values to compare to the first column. Figure 5-10 shows an example of a filter condition that compares the values in the Sale Price column with the values in the MSRP column. 6 Choose Add Condition, then choose Apply.
81
Figure 5-10
Advanced Filter displaying a condition that compares the values in two columns
Adding a condition
There are two ways to define multiple filter conditions. You can select a column and define a filter, then select the next column and define a filter, and so on. Figure 5-11 shows the definition of two filters, the first on the SALES OFFICE column, the second on the PRODUCTLINE column.
Figure 5-11
82
When you use this method to define multiple filters, BIRT Report Studio constructs the following filter expression:
SALES OFFICE = San Francisco and PRODUCTLINE = Vintage Cars
This filter returns only data rows that meet both conditions. Sometimes, you want to create a filter to return data rows when either condition is true, or you want to create a more complex filter. To accomplish either task, use Advanced Filter, shown in Figure 5-12. As the illustration shows, this dialog box provides more options for defining a filter with multiple conditions. It also shows all the filter conditions defined for the table.
Figure 5-12
This procedure shows how to define multiple filter conditions using Advanced Filter. 1 Select the column that contains the values to filter by. 2 On Filter, choose Advanced Filter. Advanced Filter displays the selected column in Filter By. 3 Define the first filter condition as follows: 1 In Condition, select a comparison operator. 2 In Value, select or type the comparison value. 3 Choose Add Condition.
83
The filter condition appears in the Filters area. 4 Define the second filter condition as follows: 1 In Filter By, select another column. 2 In Condition, select a comparison operator. 3 In Value, select or type the comparison value. 4 Choose Add Condition. In the Filters area, the second filter condition appears below the first condition, as shown in Figure 5-13. By default, the second condition is preceded by the logical operator, And.
Figure 5-13
5 Select a different logical operator, if necessary. 6 Add additional filter conditions using the steps described previously. 7 If you create more than two filter conditions and you use different logical operators, you can use the parentheses buttons to group conditions to determine the order in which conditions are evaluated. 8 Choose Validate to verify the syntax of the filter conditions, then choose Apply. 9 Run the report to verify that it displays the results you expect.
84
The following filter conditions return all sales data for the San Francisco and Boston offices:
Sales Office = San Francisco Or Sales Office = Boston
The following filter conditions return sales data for all product lines, except classic cars, sold by the San Francisco office.
Sales Office = San Francisco And Not (Product Line = Classic Cars)
Figure 5-14 shows the generated report. Although the filter specifies the San Francisco office and the Classic Cars product line, the report displays data for other sales offices and product lines. Without any grouped conditions, the filter includes rows that meet either conditions 1, 2, and 3 or just condition 4.
85
Figure 5-14
A report displaying the results of a complex filter that does not use parentheses to group conditions
The following filter contains the same four conditions, but this time the third and fourth conditions are grouped:
Sales Office = San Francisco and ProductLine = Classic Cars and (Total >= 8000 or Profit >= 4500)
Figure 5-15 shows the generated report. This time, only two rows meet the conditions. The Sales Office = San Francisco and ProductLine = Classic Cars conditions must be true, then either the Total >= 8000 condition or the Profit >= 4500 condition is true.
Figure 5-15
A report displaying the results of a complex filter that uses parentheses to group conditions
86
Changing a condition
To change a filter condition, in the Filters area of Advanced Filter, select the condition. Modify the condition by changing the values in Filter By, Condition, or Value. Then, select Change Condition.
1. Select the condition 2. Modify the condition 3. Choose Change Condition
Figure 5-16
Deleting a condition
To delete a filter condition, in the Filters area of Advanced Filter, select the condition. Then, select Delete. Verify that the remaining filter conditions still make sense.
87
content. Without a prompt, you need to edit the filter condition to supply a different value. To create a prompt, on Filter, select Prompt Value, and type the prompt text to display, as shown in Figure 5-17.
Specify a filter condition Select Prompt Value
Figure 5-17
Creating a filter that prompts for a value when the report is run
When you choose Apply, the filter takes effect immediately. Test the prompt in BIRT Report Studio by choosing Parameter on the toolbar. Parameters displays the prompt, as shown in Figure 5-18. In this example, the default parameter value is Boston, which is the comparison value specified in the filter condition shown in Figure 5-17.
Figure 5-18
88
To make a prompt value optional, on Filter, select Optional, as shown in Figure 5-19.
Select Optional
Figure 5-19
Create a static list of values. In a static list, the values you select to display to the report user are fixed at report design time. Create a dynamic list of values. In a dynamic list, the software generates the list of values at report run time, using the current values in the data source.
Create a dynamic list for values that are frequently updated in the data source. New customer names or product names, for example, are often added to a data source. If you create a static list of these values, you have to update the list manually to match the values in the data source. Create a static list if you want control over the list of values to display the report user, for example, if you want to display only some of the values.
How to create a static list
1 Select the column on which to filter. 2 On Filter, select the Any Of operator. 3 Choose List Values, then select the values that you want to display in the prompt. The last value you select is used as the default parameter value. Figure 5-20 shows the selection of all the sales office values.
89
Figure 5-20
4 Select Prompt Value and type the prompt text to display. Choose Apply. When the user runs the report or when you choose the Parameter option on the toolbar, Parameters displays the list of values, as shown in Figure 5-21. The user can select one value, multiple values, or all the values in the list. In this example, the parameter value selected by default is Tokyo, because this is the last value selected from the list when the filter condition was defined.
Figure 5-21
Parameters displaying a list of values with the last value selected by default
90
2 On Filter, select the Any Of operator. 3 Select Prompt Value and type the prompt text to display. 4 Select Dynamic. All the column values appear in the Value drop-down list, as shown in Figure 5-22.
Figure 5-22
5 From the Value list, select a value to use as the default filter value. You can select multiple values. 6 Optionally, in Sort Direction, select either Ascending or Descending.
If you leave this field empty, Parameters displays the default value first, and the other values in ascending order, as shown in Figure 5-23. Select Ascending to display all the values in ascending order. Select Descending to display the values in descending order.
When the user runs the report or when you choose the Parameter option on the toolbar, Parameters displays a list of dynamic values, as shown in Figure 5-23. The user can select one value, multiple values, or all the values in the list. In this example, the first parameter value is the default.
Figure 5-23
Parameters displaying a list of values with the first value selected by default
91
92
Chapter
6
Chapter 6
About charts Creating a chart Inserting a chart Choosing a chart type Selecting data for a chart Formatting a chart Displaying a chart without the table data
93
About charts
A chart is a graphical representation of data. Charts are particularly useful for summarizing numeric data and showing the relationship between sets of values called series. For example, a chart can show sales by region, average temperatures by month, or the price of a stock over three months. Because a chart presents a picture, it reveals trends that would not be as apparent if a table presents the same data. Figure 6-1 shows an example of a table and a bar chart displaying sales data. The chart shows instantly the sales trend for the year without your having to look at the numbers.
Figure 6-1
Figure 6-2 shows an example of a pie chart that displays profits by product line. The table in Figure 6-3 provides the data for the pie chart. It is typical for reports to display detail data in a table and summary data in a chart, especially if the detail data spans multiple pages.
Figure 6-2
94
Figure 6-3
The table that provides the data for the pie chart
Creating a chart
The data for a chart must come from the data in a table. You must always lay out data in a table before you create a chart. Users typically design reports using this sequence. If you want to display only a chart in your report, hide the table after you create the chart. When you create a chart, you perform the following tasks: 1 Insert a chart. 2 Choose a chart type. 3 Specify the data to present in the chart. 4 Format the chart.
95
Inserting a chart
The location in which you insert a chart determines what data the chart displays. You can insert a chart in the following locations:
A table. A chart at the table level summarizes data for the entire table and the chart appears at the top of every page. A section header, if the report organizes data in sections. A chart at the section header level summarizes data for the section and the chart appears at the top of each section. If a sections data spans multiple pages, the chart appears on every page.
If your report design organizes data in groups instead of sections, you can create only one chart per table. Figure 6-26 shows one page of a 76-page report that displays a chart at the table level and a chart at the sales office section level.
Figure 6-4
Two charts in a report, the top chart displays data at the table level, the other chart displays data at the section level
96
The chart at the top, which is the chart at the table header level, displays sales and profit totals for the company. The second chart, the chart at the sales office section level, displays sales and profit totals for the Tokyo office.
How to insert a chart
To insert a chart at the table level, select the table, then choose Chart from the toolbar. To insert a chart at the table header level, select a column header in the table header row, then choose Chart. If your report design contains sections, selecting a column header does not enable the Chart toolbar button. You must first delete the existing section or sections, select a column header and insert the chart, then recreate the section or sections. To insert a chart at a section level, select the section heading, then choose Chart.
After you insert a chart, BIRT Report Studio displays the chart editor, shown in Figure 6-5. You use the chart editor to choose a chart type, select data for the chart, and format the chart.
Figure 6-5
97
Figure 6-6
The following sections describe the chart types BIRT Report Studio supports. Several of the chart types include subtypes.
98
Figure 6-7
Figure 6-8
99
sales values are shown in percentages instead of the actual numbers as shown in the previous area charts.
Figure 6-9
The percent stacked area chart is meaningful only when displaying and comparing multiple series. If displaying only one series, the percent stacked area chart looks like the example in Figure 6-10. The sales percentage of one region compared to the whole is 100%.
Figure 6-10
100
earlier sections. Sometimes, the choice of a chart type is a matter of personal preference.
Figure 6-11
Figure 6-12
101
Figure 6-13
Figure 6-14
Figure 6-15
102
Figure 6-16
A line chart
A line chart is similar to an area chart, except that the line chart does not fill in the area below the line, and it uses a square marker for each data value. There are three subtypes of line charts, which are functionally similar to the area chart and bar chart subtypes. The line chart subtypes in the following sections use the same data as the area charts and bar charts shown in the earlier sections. You can compare how different chart types present the same set of data.
Figure 6-17
103
Figure 6-18
104
Figure 6-19
Figure 6-20
A meter chart
105
show the rising price of gas over a five-day period. The chart would display five dials in a row, creating an image of a dashboard, as shown in Figure 6-22.
Figure 6-21
Figure 6-22
Figure 6-23
A pie chart
106
measurements. Use a scatter chart to compare, for example, salaries and years of experience, weight and body fat, rainfall amounts and pollen levels, or test scores and hours of study. The more data values you include in a scatter chart, the clearer the trends revealed by the data. The scatter chart in Figure 6-24 shows the relationship between salary and years of experience. Each pair of values, salary and years of experience, is plotted as a single x-y value. The chart reveals a positive, or direct, relationship between salary and years of experience; as the number of years increase, the salary also increases. The chart also displays the salaries earned by men and women, and, in this example, the chart reveals that men consistently earn more than women.
Figure 6-24
A scatter chart
107
Figure 6-25
Figure 6-26
108
height of a bar in a bar chart or the size of a sector in a pie chart. For charts that use axes to display data, value series values appear on the y-axis. A category series determines how the values are grouped, for example, by year, by country, or by product line. For charts that use axes, category series values appear along the x-axis.
y-axis A value series value
Figure 6-27
Parts of a chart
For all chart types, you must select one column as the category series and at least one column as the value series. You can select two columns to display two value series. The bar chart in Figure 6-27 displays two value series, total and profit. Then, depending on the table data that a chart uses, you might need to group and aggregate the values, so that the chart can display the data properly. Suppose the table displays data as shown in Figure 6-28. The table shows sales details by product, product line, and sales office. In Figure 6-28, the table shows only 10 rows of sample data, but the generated report contains 75 pages of data.
Figure 6-28
109
Suppose you create a bar chart based on this table data. You want the chart to show the overall sales total and profit for each product line, just like the chart in Figure 6-27. You select the product line column as the category series and the total and profit columns as the value series, as shown in Figure 6-29.
Figure 6-29
Select Data showing columns selected for the category and values series
Based on these selections, the bar chart looks like the one in Figure 6-30. Because you did not group or aggregate the data for the chart, the chart plots every total value and every profit value.
Figure 6-30
A chart that does not group or aggregate data displaying too many data points
To create the chart shown in Figure 6-27, which is based on the table data shown in Figure 6-28, you would group the chart data by product line and use the Sum function to calculate the grand total of the sales amounts and profits. Figure 6-31 shows the correct way to select and organize data for the chart.
110
Use the default aggregate function, Sum, to display the overall totals
Figure 6-31
The following sections expand on the concepts introduced in this section and provide examples for selecting and organizing data, based on different types of table data, for the different types of charts.
The area, bar, and line charts The table data that all the charts are based on The selections made in the Select Data page of the chart editor
Example 1
The charts in Figure 6-32 show sales numbers by month.
Figure 6-32
An area chart, a bar chart, and a line chart displaying sales numbers by month
111
Figure 6-33 shows the table data that the charts use. The data in the table is already aggregated. The table shows the total sales per month, and each value is plotted in each of the charts.
Figure 6-33
Figure 6-34 shows how the data is selected for the chart. You do not need to group or aggregate the data. As Figure 6-34 shows, all you do is select the Month column as the category series, and the Sales column as the value series.
Figure 6-34
112
Example 2
The charts in Figure 6-35 show sales totals by quarter and by region.
Figure 6-35
An area chart, a bar chart, and a line chart displaying sales by quarter and region
Figure 6-36 shows the table data that the charts use.
Figure 6-36
Figure 6-37 shows how the data is selected for the chart. The Quarter column is the category series and the Sales column is the value series. In addition, Region is the column selected for the Group By option. Without this option selected, the chart plots every value in the Quarter and Sales columns, as shown in Figure 6-38.
Figure 6-37
113
Figure 6-38
The pie chart The table data that the chart is based on The selections made in the Select Data page of the chart editor
Example 1
The pie chart in Figure 6-39 shows sales by quarter.
Figure 6-39
Figure 6-40 shows the table data that the pie chart uses.
114
Figure 6-40
Figure 6-41 shows how the data is selected for the chart. The Quarter column is the category series and the Sales column is the value series. In addition, the data is grouped by quarter and the Sum function is used to calculate the grand total of the sales, across regions, for each quarter.
Figure 6-41
Example 2
Figure 6-42 shows a series of pie charts. Each pie chart shows the sales by quarter for a particular region.
115
Figure 6-42
Figure 6-43 shows the table data that the series of pie charts use. It is the same set of data used in the previous pie chart example.
Figure 6-43
Figure 6-44 shows how the data is selected for the chart. The Quarter column is the category series and the Sales column is the value series. Unlike the previous pie chart example, the category series (quarter) values are not grouped. Instead, the value series data is grouped by the region column.
Figure 6-44
116
Example 3
The pie chart in Figure 6-45 shows the number of products in each product line.
Figure 6-45
Figure 6-46 shows a sample of the table data which the pie chart uses. The actual data spans two pages.
Figure 6-46
Figure 6-47 shows how the data is selected for the chart. The PRODUCTLINE column is the category series and the PRODUCTNAME column is the value series. In addition, the data is grouped by product line and the Count function is used to count the number of products in each product line.
117
Figure 6-47
The meter chart The table data that the chart is based on The selections made in the Select Data page of the chart editor
Example 1
The superimposed meter chart in Figure 6-48 shows two values, actual sales total and projected sales total.
Figure 6-48
Figure 6-49 shows the table data that the chart uses. The meter chart displays the values in the first and second columns of the table.
118
Figure 6-49
Figure 6-50 shows how the data is selected for the chart. A category series is not applicable to this meter chart, but a value is required, so the Year column is selected arbitrarily. The ActualSalesTotal column and the ProjectedSalesTotal column are the value series.
Figure 6-50
119
Example 2
The standard meter chart in Figure 6-51 shows multiple dials. Each dial in the top row shows the projected sales total for an item category. Each dial in the bottom row shows the actual sales total for an item category.
Figure 6-51
Figure 6-52 shows the table data that the chart uses. It is the same table used in the previous meter chart example. In this example, however, the meter chart uses data from the Projected Sales and Actual Sales columns. Notice that the aggregate (Sum) row for each item corresponds to a needle value in each dial.
Figure 6-52
Figure 6-53 shows how the data is selected for the chart. The Category column is the category series, and the Group At option is selected. The ProjectedSales column and the ActualSales column are the value series. The values in these columns are aggregated using the Sum function, and the values are grouped by category.
120
Figure 6-53
The scatter chart The table data that the chart is based on The selections made in the Select Data page of the chart editor
Example 1
The scatter chart in Figure 6-54 shows the relationship between salaries and years of experience.
Figure 6-54
A scatter chart showing the relationship between salaries and years of experience
121
Figure 6-55 shows the table that contains the data which the scatter chart uses. The chart uses data from the Years_Experience and Average Salary columns.
Figure 6-55
Figure 6-56 shows how the data is selected for the chart. The Years_Experience column is the category series and the Average Salary column is the value series. The data is not grouped nor aggregated because the scatter chart plots every value in the Years_Experience and Average Salary columns.
Figure 6-56
122
Example 2
Like the scatter chart in the previous example, the scatter chart in Figure 6-57 shows the relationship between salaries and years of experience. In this example, however, the chart displays two value series: the average salaries for men and the average salaries for women.
Figure 6-57
A scatter chart showing the relationship between salaries and years of experience, by gender
Figure 6-58 shows the table containing the data that the scatter chart uses. Unlike the table in the previous scatter chart example, this table does not show the average salaries by years of experience or by gender. Instead, this table shows salary and experience data for each employee. To display the average salaries by years of experience and by gender, the data must be grouped and aggregated.
Figure 6-58
Figure 6-59 shows how the data is selected, grouped, and aggregated for the chart. The Years_Experience column is the category series and the Salary column is the value series. The values are grouped by years of experience and gender. The Average aggregate function is selected, so that the chart calculates and displays the average salary for each group.
123
Figure 6-59
Date values as the categories series. High values, low values, open values, and close values as the value series.
Example
The stock chart in Figure 6-60 shows a stocks high, low, open, and close values for five days.
Figure 6-60
Figure 6-61 shows the table data that the stock chart uses.
Figure 6-61
124
Figure 6-62 shows how the data is selected for the chart. The Date column is the category series. The High, Low, Open, and Close columns are the value series.
Figure 6-62
Figure 6-63
You can disable the ToolTip by unchecking the ToolTip option. You also can display a different ToolTip value. For the bar chart shown in Figure 6-63, instead of displaying the sales value, you can display the region or the quarter. To display a different ToolTip value, select a different column from the drop-down list, as shown in Figure 6-64.
125
Figure 6-64
Formatting a chart
When you create a chart and use the default formatting options, the basic look of the chart is determined by the chart type and the data you selected. Styles, such as fonts and colors, are determined by the template or the software. Figure 6-65 shows an example of a bar chart that uses default formats. You can improve the chart by editing the placeholder text for the chart title, y-axis title, and x-axis title, and by changing the size or position of the x-axis labels to display all the city labels.
Figure 6-65
To change the appearance of a chart, change the option settings on Format Chart. Figure 6-66 shows Format Chart displaying the default option settings for a bar chart. The options that appear differ depending on the chart type. For example, a
126
pie chart does not have axes, so the Category (X) Axis Title and Value (Y) Axis Title options do not appear on Format Chart for a pie chart.
Figure 6-66
127
Figure 6-67
For more information about the Layout Preference option, see Changing the layout type, page size, and orientation in Chapter 2, Editing and formatting report content.
Figure 6-68
128
Figure 6-69
Figure 6-70
You change the font attributes of a title or labels for aesthetic reasons or for practical reasons. For example, if the x-axis does not display all the labels, as shown in Figure 6-67, reducing the font size of the Category (X) Axis labels is one way to solve the problem. Figure 6-71 shows the effect of reducing the size of the labels on the x-axis. All the city names appear. The chart in Figure 6-71 also displays the y-axis and legend labels in a smaller size than the same labels in the chart in Figure 6-67. Typically, when you change the font attributes of labels in one area, you apply the same font attributes to labels in other areas, so that the labels in the chart have a consistent appearance.
129
Legend labels
Figure 6-71
Figure 6-72
Figure 6-73 shows a bar chart that uses the 2D With Depth setting. Not all chart types support the 2D With Depth setting. For example, this setting is not available to meter charts or line charts.
130
Figure 6-73
Figure 6-74
You can also choose to remove a legend by unchecking Show Legend. For example, it is not necessary to display a legend if the chart shows only one value series. The bar chart in Figure 6-75, for example, does not need a legend.
131
Figure 6-75
Figure 6-76
132
Figure 6-77
Charts using different values for the Stagger Labels and Rotate Labels options
Figure 6-78
133
Figure 6-79
As the chart in Figure 6-79 shows, it makes sense to skip category values only if the values are consecutive numbers or dates, where the user can intuitively fill in the missing values.
Figure 6-80
You can control the range of values that appear on the y-axis. On Format Chart, in Scale, you can set the following options:
Min. Type a number that represents the lowest value to display on the y-axis. This number appears at the bottom of the y-axis. Max. Type a number that represents the highest value to display on the y-axis. This number appears at the top of the y-axis. Step. Type a number that represents the increment between each value.
134
Figure 6-81 shows the Min, Max, and Step options set to 0, 3500000, and 500000, respectively. These settings change the y-axis values of the second chart in Figure 6-80 to the y-axis values shown in Figure 6-82. Notice that the y-axis values shown in the chart in Figure 6-82 are closer together. Because the chart height is the same, the chart has to display more values in the same space. When you change the scale of y-axis values, you typically need to adjust the height of the chart, too.
Figure 6-81
Figure 6-82
135
136
Chapter
7
Chapter 7
Requirements for using multiple information objects Joining information objects Getting current data from an information object
137
You have been assigned an advanced user role. You have access to multiple information objects that can be combined. The principles of combining, or joining, database tables. To use data from two or more information objects, you join information objects in a similar manner. The structure and the relationship among the information objects whose data you want to join.
You can join information objects only. You cannot join data sets in a template.
138
Customer IO customerNumber customerName contactLastName contactFirstName phone addressLine1 addressLine2 city state postalCode country salesRepEmployeeNumber creditLimit
Figure 7-1
This procedure assumes you have created a new report design and selected an information object when prompted. 1 Under Available Data, choose Modify, shown in Figure 7-2. This figure also shows an example of Available Data displaying the data fields in the first information object, CustomerData.
Choose Modify
Figure 7-2
139
Join displays the information object, CustomerData, under List of Information Objects, as shown in Figure 7-3.
Figure 7-3
2 Select a second information object to join to the first information object. 1 Choose Add Objects. 2 In Select Information Objects, browse through the folders to find and select an information object. Figure 7-4 shows an example of Select Information Objects displaying the contents of a folder, which includes three information objects.
Figure 7-4
140
3 Choose Select. The second information object appears in List of Information Objects in Join. 3 Join the information objects. 1 In Join, under Select Join, choose Add Join. Add Join displays two fields, Left and Right, which contain the names of the information objects. 2 In Left, select one information object. Then, in Right, select the other information object. Figure 7-5 shows an example where CustomerData and OrderData are selected in the Left and Right fields, respectively.
Figure 7-5
3 Choose Add. Select Join displays the information objects selected for the join, as shown in Figure 7-6.
Figure 7-6
Select Join displaying the information objects selected for the join
4 Specify the join condition. 1 In Join, under Join Conditions, choose Add Condition.
141
Add Join Condition displays in the Left and Right lists all the fields in the first and second information objects, respectively. 2 In Left, select a field. In Right, select a field that contains the same data. The two fields do not have to have identical names, but they must have the same data type. 3 In Condition, select a comparison operator. Typically, you use the default operator, equal to. Figure 7-7 shows an example of a completed join condition. The join condition joins the information objects on their respective customerNumber fields. This condition retrieves only those rows in which the customerNumber values match.
Figure 7-7
Add Join Condition displaying the fields used to join the information objects
4 Choose Add. Join Condition displays the specified join condition, as shown in Figure 7-8.
Join condition
Figure 7-8
142
5 Repeat the previous steps to add and join additional information objects. Choose Apply when you finish joining the information objects. Available Data displays all the data fields from the joined information objects that you can insert in a table in your report design. In Figure 7-9, Available Data shows the data fields in three information objects, CustomerData, OrderData, and OrderDetailsData.
Figure 7-9
143
To ensure that your report design uses the current data from an information object, you can synchronize your data set and the data set in the modified information object. To synchronize a data set, you must have an advanced user role.
How to synchronize data sets
In Available Data, choose Synchronize Data Sets, as shown in Figure 7-10. If a new field has been added to the information object, the new field appears in the list. If a field has been removed from the information object, the field is removed from the list. If your report design uses a field that is no longer available, BIRT Report Studio displays an error message. Delete the column from the report design.
Choose Synchronize Data Sets to update the report design with the current fields in the information object
Figure 7-10
144
Chapter
Chapter 8
Functions Operators
145
ABS( )
Functions
This section is a complete reference to all of the functions in BIRT Report Studio. This reference organizes the functions alphabetically. Each function entry includes a general description of the function, its syntax, the arguments to the function, the result the function returns, and an example that shows typical usage. Use this reference to find information about a function that you want to use when you insert a computed column to display calculated data in your report design.
ABS( )
Returns the absolute value of a number without regard to its sign. For example, 6 is the absolute value of 6 and -6.
Syntax Argument
ABS(num)
num
The number, or numeric expression that specifies the number, for which you want to find the absolute value.
Returns Example
A number that represents the absolute value of num. The following example returns the absolute value for each number in the TemperatureCelsius data field.
ABS([TemperatureCelsius])
ADD_DAY( )
Adds a specified number of days to a date value.
Syntax Arguments
ADD_DAY(date, daysToAdd)
date
The number of days to add to the start date. If you specify a negative number, the result is as if the number is subtracted from the start date.
Returns Example
The date value that results from adding the specified number of days to the start date. The following example adds 15 days to each date value in the InvoiceDate data field.
ADD_DAY([InvoiceDate], 15)
146
ADD_HOUR( )
ADD_HOUR( )
Adds a specified number of hours to a date value.
Syntax Arguments
ADD_HOUR(date, hoursToAdd)
date
The date or date expression that represents the start date. If a start date does not have a time value, the function assumes the time is midnight, 12:00 AM.
hoursToAdd
The number of hours to add to the start date. If you specify a negative number, the result is as if the number is subtracted from the start date.
Returns Example
The date-and-time value that results from adding the specified number of hours to the start date. The following example adds eight hours to each date value in the ShipDate data field.
ADD_HOUR([ShipDate], 8)
ADD_MINUTE( )
Adds a specified number of minutes to a date value.
Syntax Arguments
ADD_MINUTE(date, minutesToAdd)
date
The date or date expression that represents the start date. If a start date does not have a time value, the function assumes the time is midnight, 12:00 AM.
minutesToAdd
The number of minutes to add to the start date. If you specify a negative number, the result is as if the number is subtracted from the start date.
Returns Example
The date-and-time value that results from adding the specified number of minutes to the start date. The following example subtracts 30 minutes from each date in the StartTime data field.
ADD_MINUTE([StartTime], -30)
ADD_MONTH( )
Adds a specified number of months to a date value.
147
ADD_QUARTER( )
Syntax Arguments
ADD_MONTH(date, monthsToAdd)
date
The number of months to add to the start date. If you specify a negative number, the result is as if the number is subtracted from the start date.
Returns
The date value that results from adding the specified number of months to the start date. This function always returns a valid date. If necessary, the day part of the resulting date is adjusted downward to the last day of the resulting month in the resulting year. For example, if you add 1 month to 1/31/08, ADD_MONTH( ) returns 2/29/08, not 2/31/08 or 2/28/08, because 2008 is a leap year. The following example adds two months to each date value in the InitialRelease data field.
ADD_MONTH([InitialRelease], 2)
Example
ADD_QUARTER( )
Adds a specified number of quarters to a date value.
Syntax Arguments
ADD_QUARTER(date, quartersToAdd)
date
The number of quarters to add to the start date. If you specify a negative number, the result is as if the number is subtracted from the start date.
Returns
The date value that results from adding the specified number of quarters to the start date. A quarter is equal to three months. For example, if you add 2 quarters to 9/22/08, ADD_QUARTER( ) returns 3/22/09. The following example adds two quarters to each date value in the ForecastClosing data field.
ADD_QUARTER([ForecastClosing], 2)
Example
ADD_SECOND( )
Adds a specified number of seconds to a date value.
Syntax
ADD_SECOND(date, secondsToAdd)
148
ADD_WEEK( )
Arguments
date
The date or date expression that represents the start date. If a start date does not have a time value, the function assumes the time is midnight, 12:00 AM.
secondsToAdd
The number of seconds to add to the start date. If you specify a negative number, the result is as if the number is subtracted from the start date.
Returns Example
The date-and-time value that results from adding the specified number of seconds to the start date. The following example adds 30 seconds to each date value in the StartTime data field.
ADD_SECOND([StartTime], 30)
ADD_WEEK( )
Adds a specified number of weeks to a date value.
Syntax Arguments
ADD_WEEK(date, weeksToAdd)
date
The number of weeks to add to the start date. If you specify a negative number, the result is as if the number is subtracted from the start date.
Returns Example
The date value that results from adding the number of weeks to the start date. The following example adds 2 weeks to each date value in the OrderDate data field.
ADD_WEEK([OrderDate], 2)
ADD_YEAR( )
Adds a specified number of years to a date value.
Syntax Arguments
ADD_YEAR(date, yearsToAdd)
date
The number of years to add to the start date. If you specify a negative number, the result is as if the number is subtracted from the start date.
Returns
The date value that results from adding the number of years to the start date.
149
AVERAGE( )
Example
The following example adds 5 years to each date value in the HireDate data field.
ADD_YEAR([HireDate], 5)
AVERAGE( )
Calculates the average value of a set of values.
Syntax
Arguments
expr
The expression that specifies the values to use in the calculation. The data type must be numeric.
groupLevel
The numeric index of the group whose values to use in the calculation. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function performs the calculation over all the values in the table.
Returns Examples
The average value of the specified set of values. The following example calculates the average of values in the CostPerUnit data field at the table level.
AVERAGE([CostPerUnit])
The following example calculates the average of values in the TotalCost data field for each group at the first level.
AVERAGE([TotalCost], 1)
The following example calculates the average of Price values + Tax values.
AVERAGE([Price]+[Tax])
BETWEEN( )
Tests if a value is between two specified values.
Syntax Arguments
The value to test. The value can be a string, numeric, or date value.
upperBound
The first value in the range of values to compare to. String and date values must be enclosed in double quotation marks (" ").
150
CEILING( )
lowerBound
The second value in the range of values to compare to. String and date values must be enclosed in double quotation marks (" ").
Returns Examples
True if value is between upperBound and lowerBound, or equal to upperBound or lowerBound; returns false otherwise. The following example tests each value in the SalesTotal data field to see if the value is between 10000 and 20000.
BETWEEN([SalesTotal], 10000, 20000)
The following example tests each value in the CustomerName data field to see if the value is between A and M.
BETWEEN([CustomerName], "A", "M")
The following example tests each value in the ReceiptDate data field to see if the value is between 10/01/07 and 12/31/07.
BETWEEN([ReceiptDate], "10/01/07 12:00 AM", "12/31/07 12:00 AM")
The following example uses BETWEEN( ) in conjunction with the IF( ) and ADD_DAY( ) functions to calculate a shipment date. If an orderDate value is in December 2007 (between 12/1/07 and 12/31/07), add 5 days to the orderDate value. If an orderDate value is in a month other than December, add 3 days to the orderDate value.
IF((BETWEEN([orderDate], "12/1/07 12:00 AM", "12/31/07 12:00 AM")), (ADD_DAY([orderDate], 5)), (ADD_DAY([orderDate], 3)))
CEILING( )
Rounds a number up to the nearest specified multiple.
Syntax Arguments
CEILING(num, significance)
num
The number that results from the rounding. If num is an exact multiple of significance, no rounding occurs. CEILING( ) is commonly used to round up prices. For example, to avoid dealing with pennies, you can round prices in a Price data field up to the nearest nickel with the following expression. If the Price value is 20.52, CEILING( ) returns 20.55.
CEILING([Price], 0.05)
151
COUNT( )
The following example rounds prices up to the nearest dime. If the Price value is 20.52, CEILING( ) returns 20.60. If the Price value is 20.40, CEILING( ) returns 20.40. No rounding occurs because 20.40 is already a multiple of 0.1.
CEILING([Price], 0.1)
The following example rounds prices up to the nearest dollar. If the Price value is 20.30, CEILING( ) returns 21.0.
CEILING([Price], 1)
COUNT( )
Counts the data rows in a table or in a specified group.
Syntax
COUNT( ) COUNT(groupLevel)
Argument
groupLevel
The numeric index of the group whose values to count. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function counts all the rows in the table.
Returns Example
The number of rows in the table or the specified group. The following example counts the number of rows for each group at the second level.
COUNT(2)
COUNTDISTINCT( )
Counts the number of unique values in a specified data field.
Syntax
Arguments
expr
The numeric index of the group whose values to use in the calculation. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function counts all the unique values in the specified data field in the table.
Returns
The number of unique values in the specified data field in the table or in the specified group.
152
DAY( )
Example
The following example counts the number of unique values in the Country data field in the table.
COUNTDISTINCT([Country])
The following example counts the number of unique values in the Country data field for each group at the first level.
COUNTDISTINCT([Country], 1)
DAY( )
Returns a number from 1 to 31 that represents the day of the month.
Syntax Argument Returns Example
DAY(date)
date
The date or date expression from which you want to extract the day. The number of the day of the month for the specified date value. The following example gets the number of the day for each date value in the ShipDate data field.
DAY([ShipDate])
DIFF_DAY( )
Calculates the number of days between two date values.
Syntax Arguments
DIFF_DAY(date1, date2)
date1
The number of days between date1 and date2. The following example calculates the number of days between each value in the invoiceDate data field and each value in the paymentDate data field. The results show how long it takes to pay invoices.
DIFF_DAY([invoiceDate],[paymentDate])
The following example calculates the number of days from an order date to Christmas.
DIFF_DAY([orderDate], "12/25/08")
153
DIFF_HOUR( )
The following example calculates the number of days from the current date to Christmas. TODAY( ) is a function that returns the current date.
DIFF_DAY(TODAY(), "12/25/08")
DIFF_HOUR( )
Calculates the number of hours between two date values.
Syntax Arguments
DIFF_HOUR(date1, date2)
date1
The first date or date expression to use in the calculation. If the date does not have a time value, the function assumes the time is midnight, 12:00 AM.
date2
The second date or date expression to use in the calculation. If the date does not have a time value, the function assumes the time is midnight, 12:00 AM.
Returns Example
The number of hours between date1 and date2. The following example calculates the number of hours between each value in the startTime data field and each value in the finishTime data field.
DIFF_HOUR([startTime],[finishTime])
The following example calculates the number of hours from the current date to Christmas. NOW( ) is a function that returns the current date and time. If you supply a literal date as an argument, you must include the time value, as shown in the following example.
DIFF_HOUR(NOW(), "12/25/08 12:00 AM")
DIFF_MINUTE( )
Calculates the number of minutes between two date values.
Syntax Arguments
DIFF_MINUTE(date1, date2)
date1
The first date or date expression to use in the calculation. If the date does not have a time value, the function assumes the time is midnight, 12:00 AM.
date2
The second date or date expression to use in the calculation. If the date does not have a time value, the function assumes the time is midnight, 12:00 AM.
Returns
154
DIFF_MONTH( )
Example
The following example calculates the number of minutes between each value in the startTime data field and each value in the finishTime data field.
DIFF_MINUTE([startTime],[finishTime])
The following example calculates the number of minutes from the current date to Christmas. NOW( ) is a function that returns the current date and time. If you supply a literal date as an argument, you must include the time value, as shown in the following example.
DIFF_MINUTE(NOW(), "12/25/08 12:00 AM")
DIFF_MONTH( )
Calculates the number of months between two date values.
Syntax Arguments
DIFF_MONTH(date1,date2)
date1
The number of months between date1 and date2. The function calculates the difference by subtracting the month number of date1 from the month number of date2. For example, if date1 is 8/1/08 and date2 is 8/31/08, DIFF_MONTH( ) returns 0. If date1 is 8/25/08 and date2 is 9/5/08, DIFF_MONTH( ) returns 1. The following example calculates the number of months between each value in the askByDate data field and each value in the ShipByDate data field.
DIFF_MONTH([askByDate],[shipByDate])
Example
The following example calculates the number of months from each value in the hireDate data field to the end of the year.
DIFF_MONTH([hireDate], "1/1/09")
DIFF_QUARTER( )
Calculates the number of quarters between two date values.
Syntax Arguments
DIFF_QUARTER(date1, date2)
date1
155
DIFF_SECOND( )
Returns
The number of quarters between date1 and date2. DIFF_QUARTER calculates the difference by subtracting the month number of date1 from the month number of date2. A difference of 3 months is equal to 1 quarter. For example, if date1 is 8/1/08 and date2 is 10/31/08, DIFF_QUARTER( ) returns 0. If date1 is 8/25/08 and date2 is 11/5/08, DIFF_QUARTER( ) returns 1. The following example calculates the number of quarters between each value in the PlanClosing data field and each value in the ActualClosing data field.
DIFF_QUARTER([PlanClosing],[ActualClosing])
Example
The following example calculates the number of quarters from each value in the orderDate data field to the end of the year.
DIFF_QUARTER([orderDate], "1/1/09")
DIFF_SECOND( )
Calculates the number of seconds between two date values.
Syntax Arguments
DIFF_SECOND(date1, date2)
date1
The first date or date expression to use in the calculation. If the date does not have a time value, the function assumes the time is midnight, 12:00 AM.
date2
The second date or date expression to use in the calculation. If the date does not have a time value, the function assumes the time is midnight, 12:00 AM.
Returns Example
The number of seconds between date1 and date2. The following example calculates the number of seconds between each value in the startTime data field and each value in the finishTime data field.
DIFF_SECOND([startTime],[finishTime])
The following example calculates the number of seconds from the current date to Christmas. NOW( ) is a function that returns the current date and time. If you supply a literal date as an argument, you must include the time value, as shown in the following example.
DIFF_SECOND(NOW(), "12/24/08 12:00 AM")
DIFF_WEEK( )
Calculates the number of weeks between two date values.
Syntax
DIFF_WEEK(date1, date2)
156
DIFF_YEAR( )
Arguments
date1
The number of weeks between date1 and date2. The function calculates the difference by subtracting the week number of date1 from the week number of date2. For example, if date1 is 1/3/08 (week 1 of the year), and date2 is 1/7/08 (week 2 of the year), DIFF_WEEK( ) returns 1. The following example calculates the number of weeks between each value in the askByDate data field and each value in the shipByDate data field.
DIFF_WEEK([askByDate],[shipByDate])
Example
The following example calculates the number of weeks from each value in the orderDate data field to the end of the year.
DIFF_WEEK([orderDate], "1/1/09")
DIFF_YEAR( )
Calculates the number of years between two date values.
Syntax Arguments
DIFF_YEAR(date1, date2)
date1
The number of years between date1 and date2. The function calculates the difference by subtracting the year number of date1 from the year number of date2. For example, if date1 is 1/1/08 and date2 is 12/31/08, DIFF_YEAR( ) returns 0. If date1 is 11/25/08 and date2 is 1/5/09, DIFF_YEAR( ) returns 1. The following example calculates the number of years between each value in the HireDate data field and each value in the TerminationDate data field.
DIFF_YEAR([HireDate],[TerminationDate])
Example
The following example calculates the number of years from each value in the HireDate data field to the current date. TODAY( ) is a function that returns the current date.
DIFF_YEAR([HireDate], TODAY())
157
FIND( )
FIND( )
Finds the location of a substring in a string.
Syntax
Arguments
strToFind
The numerical position of the substring in the string. The first character of a string starts at 0. If the substring is not found, FIND( ) returns -1. The following example searches for the substring, Ford, in each ProductName value. If the product name is 1969 Ford Falcon, FIND( ) returns 5.
FIND("Ford", [ProductName])
The following example searches for the first hyphen (-) in each product code. If the product code is ModelA-1234-567, FIND( ) returns 6.
FIND("-", [ProductCode])
The following example uses FIND( ) in conjunction with the LEFT( ) function to display the characters that precede the hyphen in a product code. The LEFT( ) function extracts a substring of a specified length, starting from the first character. In this example, the length of the substring to display is equal to the numerical position of the hyphen character.
LEFT([ProductCode], FIND("-", [ProductCode]))
FIRST( )
Returns the first value in a set of values.
Syntax
Arguments
expr
158
IF( )
groupLevel
The numeric index of the group whose first value to get. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function gets the first value in the specified data field in the table.
Returns Example
The first value in the specified data field in the table or in the specified group. The following example displays the first value in the customerID data field in the table.
FIRST([customerID])
The following example displays the first value in the customerID data field for each group at the first level.
FIRST([customerID], 1)
IF( )
Returns one value if a specified condition evaluates to TRUE, or another value if the condition evaluates to FALSE.
Syntax Arguments
Returns the doIfTrue value if condition is TRUE or the doIfFalse value if condition is FALSE. The following example calculates and displays different discount amounts based on the value in the Total data field. If the Total value is greater than 5000, the discount is 15%. Otherwise, the discount is 10%.
IF([Total]>5000, [Total]*15%, [Total]*10%)
The following example uses IF( ) in conjunction with the BETWEEN( ) and ADD_DAY( ) functions to calculate a shipment date. If an orderDate value is in December 2007 (between 12/1/07 and 12/31/07), add 5 days to the orderDate value. If a orderDate value is in a month other than December, add 3 days to the orderDate value.
IF((BETWEEN([orderDate], "12/1/07 12:00 AM", "12/31/07 12:00 AM")), (ADD_DAY([orderDate], 5)), (ADD_DAY([orderDate], 3)))
159
IN( )
The following example checks each value in the Office data field. If the value is Boston, San Francisco, or NYC, the computed column displays U.S. If the value is something other than Boston, San Francisco, or NYC, the computed column displays Europe and Asia Pacific.
IF([Office]="Boston" OR [Office]="San Francisco" OR [Office]="NYC", "U.S.", "Europe and Asia Pacific")
IN( )
Tests if a value is equal to a value in a list.
Syntax Arguments
The value to test. The value can be a string, numeric, or date value.
check1, ..., checkN
True if value is equal to one of the check values; returns false otherwise. The following example tests if New Haven, Baltimore, or Cooperstown are values in the city data field. If any one of the cities is in the data field, IN( ) returns true.
IN([city], "New Haven", "Baltimore", "Cooperstown")
The following example tests if 9/15/08 or 9/30/08 are values in the payDate data field. If you supply a literal date as an argument, you must include the time value, as shown in the following example.
IN([payDate], "9/15/08 12:00 AM", "9/30/08 12:00 AM")
The following example uses IN( ) in conjunction with the IF( ) function to test if Ships or Trains are values in the ProductLine data field. If Ships or Trains is a value in the field, the computed column displays Discontinued Item; otherwise, the product line value is displayed as it appears in the field.
IF(IN([ProductLine], "Ships", "Trains"),"Discontinued Item", [ProductLine])
ISBOTTOMN( )
Tests if a value is within the lowest n values in a set of values.
Syntax
160
ISBOTTOMNPERCENT( )
Arguments
expr
The expression that specifies the values to use in the calculation. The data type must be numeric.
n
The numeric index of the group whose values to use in the calculation. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function performs the calculation over all the values in the table.
Returns Example
True if a value is within the lowest n values in the specified data field in the table or in the specified group; returns false otherwise. The following example tests each value in the OrderTotal data field to see if the value is in the bottom 20 values.
ISBOTTOMN([OrderTotal], 20)
The following example tests each OrderTotal value to see if a value is in the bottom 5 values for each group at the second level.
ISBOTTOMN([OrderTotal], 5, 2)
The following example uses ISBOTTOMN( ) in conjunction with the IF( ) function to test if each value in the Total data field is in the bottom 10. If a value is in the bottom 10, the computed column displays a string, such as 1,234: Bottom 10 value. If a value is not in the bottom 10, the value is displayed as it appears in the field.
IF(ISBOTTOMN([Total], 10) , [Total]&": Bottom 10 value" , [Total])
ISBOTTOMNPERCENT( )
Tests if a value is within the lowest n percent in a set of values.
Syntax
Arguments
expr
The expression that specifies the values to use in the calculation. The data type must be numeric.
percent
161
ISNULL( )
groupLevel
The numeric index of the group whose values to use in the calculation. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function performs the calculation over all the values in the table.
Returns Example
True if a value is within the lowest n percent in the specified data field in the table or in the specified group; returns false otherwise. The following example tests each value in the OrderTotal data field to see if the value is in the bottom 20 percent.
ISBOTTOMNPERCENT([OrderTotal], 20)
The following example tests each OrderTotal value to see if a value is in the bottom 5 percent for each group at the second level.
ISBOTTOMNPERCENT([OrderTotal], 5, 2)
The following example uses ISBOTTOMNPERCENT( ) in conjunction with the IF( ) function to test if each value in the Total data field is in the bottom 10 percent. If a value is in the bottom 10%, the computed column displays a string, such as 1,234: Bottom 10% value. If a value is not in the bottom 10%, the value is displayed as it appears in the field.
IF(ISBOTTOMNPERCENT([Total], 10) , [Total]&": Bottom 10% value" , [Total])
ISNULL( )
Tests if a value in a specified data field is a null value. A null value means that no value exists.
Syntax Argument Returns Example
ISNULL(value)
value
The data field in which to check for null values. True if a value in the specified data field is a null value; returns false otherwise. The following example uses ISNULL( ) in conjunction with the IF( ) function to test for null values in the BirthDate data field. If there is a null value, the computed column displays No date specified; otherwise the BirthDate value is displayed.
IF(ISNULL([BirthDate]), "No date specified", [BirthDate])
ISTOPN( )
Tests if a value is within the highest n values in a set of values.
162
ISTOPNPERCENT( )
Syntax
Arguments
expr
The expression that specifies the values to use in the calculation. The data type must be numeric.
n
The numeric index of the group whose values to use in the calculation. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function performs the calculation over all the values in the table.
Returns Example
True if a value is within the highest n values in the specified data field in the table or in the specified group; returns false otherwise. The following example tests each value in the OrderTotal data field to see if the value is in the top 20 values.
ISTOPN([OrderTotal], 20)
The following example tests each OrderTotal value to see if a value is in the top 5 values for each group at the second level.
ISTOPN([OrderTotal], 5, 2)
The following example uses ISTOPN( ) in conjunction with the IF( ) function to test if each value in the Total data field is in the top 10. If a value is in the top 10, the computed column displays a string, such as 1,234: Top 10 value. If a value is not in the top 10, the value is displayed as it appears in the field.
IF(ISTOPN([Total], 10) , [Total]&": Top 10 value" , [Total])
ISTOPNPERCENT( )
Tests if a value is within the top n percent in a set of values.
Syntax
Arguments
expr
The expression that specifies the values to use in the calculation. The data type must be numeric.
percent
163
LAST( )
groupLevel
The numeric index of the group whose values to use in the calculation. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function performs the calculation over all the values in the table.
Returns Example
True if a value is within the top n percent in the specified data field in the table or in the specified group; returns false otherwise. The following example tests each value in the OrderTotal data field to see if the value is in the top 20 percent.
ISTOPNPERCENT([OrderTotal], 20)
The following example tests each OrderTotal value to see if a value is in the top 5 percent for each group at the second level.
ISTOPNPERCENT([OrderTotal], 5, 2)
The following example uses ISTOPNPERCENT( ) in conjunction with the IF( ) function to test if each value in the Total data field is in the top 10 percent. If a value is in the top 10%, the computed column displays a string, such as 1,234: Top 10% value. If a value is not in the top 10%, the value is displayed as it appears in the field.
IF(ISTOPNPERCENT([Total], 10) , [Total]&": Top 10% value" , [Total])
LAST( )
Returns the last value in a set of values.
Syntax
Argument
expr
The numeric index of the group whose first value to get. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function gets the last value in the specified data field in the table.
Returns Example
The last value in the specified data field in the table or in the specified group. The following example displays the last value in the customerID data field in the table.
LAST([customerID])
164
LEFT( )
The following example displays the last value in the customerID data field for each group at the first level.
LAST([customerID], 1)
LEFT( )
Extracts a substring from a string, starting from the left-most, or first, character.
Syntax
LEFT(str) LEFT(str, n)
Arguments
str
If you omit n, the number of characters to extract, the function returns the first character only. If n is zero, the function returns an empty string. If n is greater than the length of the string, the function returns the entire string.
Example
The following example displays the first letter of each name in the CustomerName data field.
LEFT([CustomerName])
The following example uses the LEFT( ) and FIND( ) functions to display the characters that precede the hyphen in a product code.
LEFT([ProductCode], FIND("-", [ProductCode]))
LEN( )
Counts the number of characters in a string.
Syntax Argument
LEN(str)
str
165
LIKE( )
Returns Example
The number of characters in the specified string. The following example returns the length of each value in the ProductCode data field.
LEN([ProductCode])
LIKE( )
Tests if a string matches a pattern.
Syntax
LIKE(str, pattern)
str
The string pattern to match. You must enclose the pattern in double quotation marks (" "). Use the correct case when typing the characters to match; the match is case-sensitive. You can use the following special characters in a pattern:
A percent character (%) matches zero or more characters. For example, %ace% matches any string value that contains the substring ace, such as Facebook, and MySpace. It does not match Ace Corporation because this string contains a capital A, and not the lowercase a. An underscore character (_) matches exactly one character. For example, t_n matches tan, ten, tin, and ton. It does not match teen or tn.
To match a literal percent (%), underscore (_), precede those characters with a backslash (\) character. For example, to see if a string contains M_10, specify the following pattern:
"%M\_10%" Returns Example
True if the string matches the pattern; returns false otherwise. The following example returns true for values in the customerName field that start with D.
LIKE([customerName], "D%")
The following example returns true for productCode values that contain the substring Ford.
LIKE([productCode], "%Ford%")
The following example uses two LIKE( ) expressions to look for the substrings Ford or Chevy in each ProductName value. If a product name contains either
166
LOWER( )
substring, the computed column displays U.S. Model; otherwise, it displays Imported Model.
if(((LIKE([ProductName], "%Ford%") = TRUE) OR (LIKE([ProductName], "%Chevy%") = TRUE)), "U.S. model", "Imported Model")
LOWER( )
Converts all letters in a string to lowercase.
Syntax Argument Returns Example
LOWER(str)
str
The string to convert to lowercase. The specified string in all lowercase letters. The following example displays all the string values in the productLine data field in lowercase.
LOWER([productLine])
MAX( )
Returns the highest value in a set of values.
Syntax
Arguments
expr
The expression that specifies the values to evaluate. The field can be of string, numeric, or date type.
groupLevel
The numeric index of the group whose highest value to get. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function gets the highest value in the specified data field in the table.
Returns Example
The highest value in the specified data field in the table or in the specified group. The following example displays the highest value in the orderTotal data field in the table.
MAX([orderTotal])
167
MEDIAN( )
The following example displays the highest value in the orderTotal data field for each group at the first level.
MAX([orderTotal], 1)
MEDIAN( )
Calculates the median, or mid-point, value of a set of values.
Syntax
Argument
expr
The expression that specifies the values to use in the calculation. The data type must be numeric.
groupLevel
The numeric index of the group whose values to use in the calculation. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function performs the calculation over all the values in the table.
Returns Examples
The median value in the specified data field in the table or in the specified group. The following example returns the median value for the Price data field at the table level.
MEDIAN([Price])
The following example returns the median value for the Price data field for each group at the first level.
MEDIAN([TotalCost], 1)
The following example compares each Total value with the median Total value. If the Total value is larger than the median value, the computed column displays Above median price; otherwise, the computed column displays Below median price.
IF([Total]>MEDIAN([Total]) , "Above median price" , "Below median price")
MIN( )
Returns the lowest value in a set of values.
Syntax
168
MOD( )
Arguments
expr
The expression that specifies the values to evaluate. The field can be of string, numeric, or date type.
groupLevel
The numeric index of the group whose lowest value to get. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function gets the lowest value in the specified data field in the table.
Returns Example
The lowest value in the specified data field in the table or in the specified group. The following example displays the lowest value in the orderTotal data field in the table.
MIN([orderTotal])
The following example displays the lowest value in the orderTotal data field for each group at the first level.
MIN([orderTotal], 1)
MOD( )
Returns the remainder after a number is divided by a divisor.
Syntax Arguments
MOD(num, div)
num
The number by which to divide num. You must specify a non-zero number.
Returns Example
The remainder after num is divided by div. The following example uses MOD( ) to check if numbers in the Grade data field are odd or even. When the divisor is 2, MOD( ) returns 0 for even numbers, and 1 for odd numbers.
MOD([Grade], 2)
The following example uses MOD( ) and YEAR( ) to get the last digit of a year. YEAR( ) returns the year number of a date. Dividing a number by 10 returns the last digit of the number.
MOD(YEAR([BirthDate]), 10)
169
MONTH( )
MONTH( )
Returns the month for a specified date value.
Syntax
Arguments
date
A number that represents the month format to return. Use one of the following values:
1 to get the month as a number from 1 to 12. 2 to get the full month name, for example, January. The result is locale-specific. 3 to get the abbreviated month name, for example, Jan. The result is localespecific.
The month for a specified date value. The following example returns the month (1 - 12) for each value in the ShipDate data field.
MONTH([ShipDate])
The following example returns the full month name for each ShipDate value.
MONTH([ShipDate], 2)
MOVINGAVERAGE( )
Calculates the moving average for a set of values over a specified interval or number of values.
Syntax Arguments
MOVINGAVERAGE(expr, window)
expr
The expression that specifies the values to use in the calculation. The data type must be numeric.
window
170
NOTNULL( )
Example
The following example calculates the moving average of values in the StockPrice data field. A window of 3 includes the current value and the two previous values in the calculation.
MOVINGAVERAGE([StockPrice], 3)
NOTNULL( )
Tests if a value in a specified data field is a non-null value.
Syntax Argument Returns Example
NOTNULL(value)
value
The data field in which to check for non-null values. True if a value in the specified data field is not a null value; returns false otherwise. The following example uses NOTNULL( ) in conjunction with the IF( ) function to test for non-null values in the BirthDate data field. If there is a non-null value, the BirthDate value is displayed; otherwise the string No date specified is displayed.
IF(NOTNULL([BirthDate]), [BirthDate], "No date specified")
NOW( )
Returns the current date and time.
Syntax Returns
Example
The following example uses the DIFF_MINUTE( ) and NOW( ) functions to calculate the number of minutes from the current date and time to Christmas.
DIFF_MINUTE(NOW(), "12/25/08 12:00 AM")
PERCENTILE( )
Returns a percentile value of a set of values, given a specified percent rank.
Syntax
171
PERCENTRANK( )
Arguments
expr
The expression that specifies the values to use in the calculation. The data type must be numeric.
pct
The percent rank for which to get the percentile value. The pct value must be a number between 0 and 1. For example, to get the 90th percentile value, specify 0.9. A pct value of 0 returns the lowest number. A pct value of 1 returns the highest number.
groupLevel
The numeric index of the group whose values to use in the calculation. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function performs the calculation over all the values in the table.
Returns Example
The percentile value for a specified percent rank. The following example returns the value that represents the 50th percentile of all values in the Score data field in the table.
PERCENTILE([Score], 0.5)
The following example returns the value that represents the 75th percentile of all values in the Score data field for each group at the second level.
PERCENTILE([Score], 0.75, 2)
PERCENTRANK( )
Returns the rank of a value in a set of values as a percentage of the set.
Syntax
Arguments
expr
The expression that specifies the values to use in the calculation. The data type must be numeric.
groupLevel
The numeric index of the group whose values to use in the calculation. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function performs the calculation over all the values in the table.
Returns
A number between 0 and 1 that represents the rank of a value as a percentage of all values in a data field.
172
PERCENTSUM( )
Example
The following example displays the rank of each value in the Score data field. Each rank is a percentage of all the Score values in the table.
PERCENTRANK([Score])
The following example displays the rank of each value in the Score data field. Each rank is a percentage of all the Score values in each group at the second level.
PERCENTRANK([Score], 2)
PERCENTSUM( )
For each value in a set of values, calculates the percentage of the total.
Syntax
Arguments
expr
The expression that specifies the values to use in the calculation. The data type must be numeric.
groupLevel
The numeric index of the group whose values to use in the calculation. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function performs the calculation over all the values in the table.
Returns Example
A number between 0 and 1 that represents the percentage of the total. For example, if a value is 10% of the total, PERCENTSUM( ) returns 0.10. The following example calculates for each value in the OrderAmount data field the percentage of the total of all OrderAmount values.
PERCENTSUM([OrderAmount])
The following example calculates for each value in the OrderAmount data field the percentage of the total of all OrderAmount values in each group at the second level.
PERCENTSUM([OrderAmount], 2)
QUARTER( )
Returns the quarter number for a specified date value.
Syntax Arguments
QUARTER(date)
date
173
QUARTILE( )
Returns Example
A number from 1 to 4 that represents the quarter for a specified date value. Quarter 1 starts in January. The following example displays the quarter number for each value in the CloseDate data field.
QUARTER([CloseDate])
The following example displays a stringQ1, Q2, Q3, or Q4for each value in the CloseDate data field.
"Q" & QUARTER([CloseDate])
QUARTILE( )
Calculates the quartile value in a set of values, given a specified quartile. A quartile divides numbers into four categories with each containing one fourth of the numbers.
Syntax
Arguments
expr
The expression that specifies the values to use in the calculation. The data type must be numeric.
quart
0 to get the smallest value 1 to get the first quartile value, which is the value in the 25th percentile 2 to get the second quartile value, which is the value in the 50th percentile 3 to get the third quartile value, which is the value in the 75th percentile 4 to get the largest value
groupLevel
The numeric index of the group whose values to use in the calculation. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function performs the calculation over all the values in the table.
Returns Example
A number that represents the quartile value for a specified quartile. The following example returns a number that is at the 75th percentile of all values in the Age data field in the table. For example, if the Age field contains 7, 8, 9 and 10, the function returns 9.25.
QUARTILE([Age], 3)
174
RANK( )
The following example returns a number that is at the 50th percentile of all values in the Age data field in each group at the second level.
QUARTILE([Age], 2, 2)
RANK( )
Returns the rank of a value in a set of values. The rank of a value ranges from 1 to the number of values in the set. If two values are identical, they have the same rank.
Syntax
Arguments
expr
The expression that specifies the values to evaluate. The field can be of string, numeric, or date type.
ascending
0 to rank values in descending order. In descending order, the highest value is ranked 1, and the lowest value is equal to the number of values in the set. 1 to rank values in ascending order. In ascending order, the lowest value is ranked 1, and the highest value is equal to the number of values in the set.
The numeric index of the group whose values to use in the calculation. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function performs the calculation over all the values in the table.
Returns Example
A number that represents the rank of a value in the specified data field in the table or in the specified group. The following example ranks each value in the Score data field. The ranking is performed over all the values in the table.
RANK([Score])
The following example ranks each value in the Score data field in ascending order. The ranking is performed over all the values in each group at the second level.
RANK([Score], 1, 2)
175
RIGHT( )
RIGHT( )
Extracts a substring from a string, starting from the right-most, or last, character.
Syntax
RIGHT(str) RIGHT(str, n)
Arguments
str
If you omit n, the number of characters to extract, the function returns the last character only. If n is zero, the function returns an empty string. If n is greater than the length of the string, the function returns the entire string.
Example
The following example displays the last four characters of each value in the ProductCode data field.
RIGHT([ProductCode], 4)
ROUND( )
Rounds a number to a specified number of digits.
Syntax
Arguments
num
The number of digits to round num to. If you omit dec, ROUND( ) assumes 0.
Returns Example
A number rounded to a specified number of digits. The following example rounds the numbers in the PriceEstimate data field to return an integer. For example, if the PriceEstimate value is 1545.50, ROUND( ) returns 1546. If the PriceEstimate value is 1545.25, ROUND( ) returns 1545.
ROUND([PriceEstimate])
176
ROUNDDOWN( )
The following example rounds the numbers in the PriceEstimate data field to one decimal place. For example, if the PriceEstimate value is 1545.56, ROUND( ) returns 1545.6. If the PriceEstimate value is 1545.23, ROUND( ) returns 1545.2.
ROUND([PriceEstimate], 1)
The following example rounds the numbers in the PriceEstimate data field to one digit to the left of the decimal point. For example, if the PriceEstimate value is 1545.56, ROUND( ) returns 1550. If the PriceEstimate value is 1338.50, ROUND( ) returns 1340.
ROUND([PriceEstimate], -1)
ROUNDDOWN( )
Rounds a number down to a specified number of digits.
Syntax
Arguments
num
The number of digits to round num down to. If you omit dec, ROUND( ) assumes 0.
Returns Example
A number rounded down to a specified number of digits. The following example rounds down the numbers in the PriceEstimate data field to return an integer. For example, if the PriceEstimate value is 1545.25, ROUNDDOWN( ) returns 1545. If the PriceEstimate value is 1545.90, ROUNDDOWN( ) returns 1545.
ROUNDDOWN([PriceEstimate])
The following example rounds down the numbers in the PriceEstimate data field to one decimal place. For example, if the PriceEstimate value is 1545.56, ROUNDDOWN( ) returns 1545.5. If the PriceEstimate value is 1545.23, ROUNDDOWN( ) returns 1545.2.
ROUNDDOWN([PriceEstimate], 1)
The following example rounds the numbers in the PriceEstimate data field down to one digit to the left of the decimal point. For example, if the PriceEstimate value is 1545.56, ROUNDDOWN( ) returns 1540. If the PriceEstimate value is 1338.50, ROUNDDOWN( ) returns 1330.
ROUNDDOWN([PriceEstimate], -1)
177
ROUNDUP( )
ROUNDUP( )
Rounds a number up to a specified number of digits.
Syntax
Arguments
num
The number of digits to round num up to. If you omit dec, ROUND( ) assumes 0.
Returns Example
A number rounded up to a specified number of digits. The following example rounds up the numbers in the PriceEstimate data field to return an integer. For example, if the PriceEstimate value is 1545.25, ROUNDUP( ) returns 1546. If the PriceEstimate value is 1545.90, ROUNDUP( ) returns 1546.
ROUNDUP([PriceEstimate])
The following example rounds up the numbers in the PriceEstimate data field to one decimal place. For example, if the PriceEstimate value is 1545.56, ROUNDUP( ) returns 1545.6. If the PriceEstimate value is 1545.23, ROUNDUP( ) returns 1545.3.
ROUNDUP([PriceEstimate], 1)
The following example rounds up the numbers in the PriceEstimate data field to one digit to the left of the decimal point. For example, if the PriceEstimate value is 1545.56, ROUNDUP( ) returns 1550. If the PriceEstimate value is 1338.50, ROUNDUP( ) returns 1340.
ROUNDUP([PriceEstimate], -1)
RUNNINGSUM( )
Calculates a running sum for each data row. A running sum is a total accumulated from row to row.
Syntax Arguments
RUNNINGSUM(expr)
expr
The expression that specifies the values to use in the calculation. The data type must be numeric.
Returns
178
SEARCH( )
Example
The following example calculates a running sum for each value in the LineItemTotal. For example, if the LineItemTotal field contains 50, 75, 80, 90, and 95, RUNNINGSUM( ) returns 50, 125, 205, 295, and 390 for each row, respectively.
RUNNINGSUM([LineItemTotal])
SEARCH( )
Finds the location of a substring in a string. The substring can contain wildcard characters.
Syntax
Arguments
pattern
The string pattern to search for. You must enclose the pattern in double quotation marks (" "). You can use the following special characters in a pattern:
An asterisk ( * ) matches zero or more characters, including spaces. For example, t*n matches tn, tin, and teen. A question mark (?) matches exactly one character. For example, t?n matches tan, ten, tin, and ton. It does not match teen or tn.
str
The numerical position of the string pattern in the string. The first character of a string starts at 0. If the substring is not found, FIND( ) returns -1. The following example searches for the string pattern, S*A, in each product code. If the product name is KBS5412A, SEARCH( ) returns 2.
SEARCH("S*0", [ProductCode])
The following example uses SEARCH( ) in conjunction with the LEFT( ) function to display the characters that precede the first space character in a product name. The LEFT( ) function extracts a substring of a specified length, starting from the first character. In this example, the length of the substring to display is equal to the numerical position of the space character.
LEFT([ProductName], SEARCH(" ", [ProductName]))
179
SQRT( )
SQRT( )
Calculates the square root of a number.
Syntax Argument
SQRT(num)
num
The number, or numeric expression that specifies the number, for which you want to find the square root. The number must be a positive number.
Returns Example
A number that is the square root of num. The following example calculates the square root of each value in the LotSize data field.
SQRT([LotSize])
The following example uses SQRT( ) to calculate the actual distance travelled uphill, given the base distance and elevation values. This example applies the 2 2 2 Pythagoras theorem, which states that a + b = c . Using this theorem, the actual distance travelled is c, which means we want to calculate
c = a +b
2 2
STDEV( )
Calculates the standard deviation of a set of values. Standard deviation is a statistic that shows how widely values are dispersed from the mean value.
Syntax
Arguments
expr
The expression that specifies the values to use in the calculation. The data type must be numeric.
groupLevel
The numeric index of the group whose values to use in the calculation. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function performs the calculation over all the values in the table.
Returns
180
SUM( )
Example
The following example calculates the standard deviation of values in the Population data field at the table level.
STDEV([Population])
The following example calculates the standard deviation of values in the Population data field for each group at the first level.
STDEV([Population], 1)
SUM( )
Adds all the values in a set of values.
Syntax
Arguments
expr
The expression that specifies the values to use in the calculation. The data type must be numeric.
groupLevel
The numeric index of the group whose values to use in the calculation. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If you do not supply a value for groupLevel, the function performs the calculation over all the values in the table.
Returns Examples
The total value of the specified set of values. The following example calculates the sum of values in the CostPerUnit data field at the table level.
SUM([CostPerUnit])
The following example calculates the sum of values in the TotalCost data field for each group at the first level.
SUM([TotalCost], 1)
The following example calculates the sum of Price values + Tax values.
SUM([Price]+[Tax])
TODAY( )
Returns the current date that includes a time value of midnight, 12:00 AM.
Syntax
TODAY( )
181
TRIM( )
Returns
Example
The following example calculates the number of days from the current date to Christmas.
DIFF_DAY(TODAY(), "12/25/08")
The following example calculates the number of years from each value in the HireDate data field to the current date.
DIFF_YEAR([HireDate], TODAY())
TRIM( )
Removes the leading and trailing blanks from a specified string. TRIM( ) does not remove blank characters between words.
Syntax Argument Returns Example
TRIM(str)
str
The string from which to remove leading and trailing blank characters. A string with all leading and trailing blank characters removed. The following example uses TRIM( ) to remove all leading and trailing blank characters from values in the FirstName and LastName data fields. The expression uses the & operator to concatenate each trimmed FirstName value with a space, then with each trimmed LastName value.
TRIM([FirstName]) & " " & TRIM([LastName])
TRIMLEFT( )
Removes the leading blanks from a specified string.
Syntax Arguments Returns Example
TRIMLEFT(str)
str
The string from which to remove the leading blank characters. A string with all leading blank characters removed. The following example concatenates a literal string with each value in the customerName data field. TRIMLEFT( ) removes all blank characters preceding the customerName value so that there are no extra blank characters between the literal string and the customerName value.
"Customer name: " & TRIMLEFT([customerName])
182
TRIMRIGHT( )
TRIMRIGHT( )
Removes the trailing blanks from a specified string.
Syntax Argument Returns Example
TRIMRIGHT(str)
str
The string from which to remove the trailing blank characters. A string with all trailing blank characters removed. The following example concatenates each value in the Comment data field with a semicolon, then with a value in the Action data field. TRIMRIGHT( ) removes all blank characters after the Comment value so that there are no extra blank characters between the Comment string and the semicolon.
TRIMRIGHT([Comment]) & "; " & [Action]
UPPER( )
Converts all letters in a string to uppercase.
Syntax Argument Returns Example
UPPER(str)
str
The string to convert to uppercase. The specified string in all uppercase letters. The following examples displays all the string values in the customerName data field in all uppercase.
UPPER([customerName])
VAR( )
Calculates the variance of a set of values. Variance is a statistical measure that expresses how large the differences among the values are. The variance increases as the differences among the numbers increase.
Syntax Arguments
VAR(expr)
expr
The expression that specifies the values to use in the calculation. The data type must be numeric.
groupLevel
The numeric index of the group whose values to use in the calculation. 0 indicates the table, 1 indicates the first group, 2 indicates the second group, and so on. If
183
WEEK( )
you do not supply a value for groupLevel, the function performs the calculation over all the values in the table.
Returns Example
The variance of the specified set of values. The following example calculates the variance of values in the StockPrice data field at the table level.
VAR([StockPrice])
The following example calculates the variance of values in the TotalCost data field for each group at the first level.
VAR([TotalCost], 1)
WEEK( )
Returns a number from 1 to 52 that represents the week of the year.
Syntax Argument Returns Example
WEEK(date)
date
The date or date expression whose week of the year to get. A number that represents the week of the year for the specified date value. The following example gets the week number of the year for each date value in the ShipDate data field.
WEEK([ShipDate])
WEEKDAY( )
Returns the day of the week for a specified date value.
Syntax Arguments
WEEKDAY(date, option)
date
The date or date expression from which you want to get the day of the week.
option
A number that represents the weekday format to return. Use one of the following values:
1 to get the day as a number from 1 (Sunday) to 7 (Saturday). 2 to get the day as a number from 1 (Monday) to 7 (Sunday). 3 to get the day as a number from 0 (Monday) to 6 (Sunday). 4 to get the full weekday name, for example, Wednesday. The result is localespecific.
184
WEIGHTEDAVERAGE( )
5 to get the abbreviated weekday name, for example Wed. The result is localespecific.
The day of the week for a specified date value. The following example gets the full weekday name for each date value in the DateSold data field.
WEEKDAY([DateSold], 4)
WEIGHTEDAVERAGE( )
Calculates the weighted average of a set of values, given specified weights. In a weighted average, some numbers carry more importance, or weight, than others.
Syntax Arguments
WEIGHTEDAVERAGE(value, weight)
value
The values to use in the calculation. The data type must be numeric.
weight
The weighted average of a set of values. The following example calculates the weighted average of values in the Score data field, given the weight values in the Weight data field.
WEIGHTEDAVERAGE([Score], [Weight])
For example, given the following set of scores and weights, WEIGHTEDAVERAGE( ) returns 81.75. Score 50 75 80 90 95 Weight (counts toward n% of grade) 10 25 15 30 20
YEAR( )
Returns the four-digit year value for a specified date value.
Syntax
YEAR(date)
date
The date or date expression from which you want to extract the year part.
185
YEAR( )
Returns Example
The number that represents the four-digit year for the specified date value. The following example gets the four-digit year for each date value in the ShipDate data field, and adds 15 to the four-digit year. If the ShipDate value is Sep 16, 2008, YEAR( ) returns 2023.
(YEAR([ShipDate]) + 15)
186
YEAR( )
Operators
This section is a complete reference to all of the operators that you can use when you create expressions. This reference organizes the operators into the following categories:
Operators in computed column expressions Operators in conditional formatting and filter condition expressions
Operator + * / ^ % =
Use to Add two or more numeric values together Subtract one numeric value from another Multiply numeric values Divide numeric values Raise a numeric value to a power Specify a percent Test if two values are equal
Example [OrderAmount] + [SalesTax] [OrderAmount] - [Discount] [Price] * [Quantity] [Profit]/12 [Length]^2 [Price] * 80% IF([ProductName] = "1919 Ford Falcon", "Discontinued Item", [ProductName]) IF([Total] > 5000, [Total]*15% , [Total]*10%) IF([SalePrice] < [MSRP] , "Below MSRP" , "Above MSRP") IF([Total] >= 5000, [Total]*15% , [Total]*10%) IF([SalePrice] <= [MSRP] , "Below or equal to MSRP" , "Above MSRP") IF([Country] <> "USA", "Imported product", "Domestic product")
> <
Test if one value is greater than another value Test if one value is less than another value Test if one value is greater than or equal to another value Test if one value is less than or equal to another value Test if two values are not equal
>= <=
<>
187
YEAR( )
Table 8-1
Operator AND
Example IF(([Gender] = "Male" AND [Salary] >= 150000 AND [Age] < 50), "Match found", "No match") IF(([City] = "Boston") OR ([City] = "San Francisco"), "U.S." , "Europe and Asia") [FirstName] & " " & [LastName]
OR
&
Operators in conditional formatting and filter condition expressions Use to Test if a column value is equal to any one of the specified values. Test if a column value is between two specified values. Test if a column value is among the lowest n values. Test if a column value is in the bottom n percent of all values. Test if a column value is equal to a specified value. Test if a column value is greater than a specified value. Test if a column value is greater than or equal to a specified value. Test if a column value is blank (" "). This operator applies only to string values. Test if a column value is False. Example Country Any Of USA, Canada, Mexico Profit Between 1000 and 2000 SalesAmount Bottom N 10 SalesAmount Bottom Percent 5 Country Equal to France Total Greater Than 5000 Total Greater Than or Equal to 5000 E-mail Is Blank
Operator Any Of Between Bottom N Bottom Percent Equal to Greater Than Greater Than or Equal to Is Blank
Is False
LoanApproved Is False
188
YEAR( )
Table 8-2
Operators in conditional formatting and filter condition expressions Use to Test if a column value is not blank. This operator applies only to string values. Test if a column value is not a null value. A null value means that no value is supplied. Tests if a column value is a null value. Test if a column value is True. Test if a column value is less than a specified value. Test if a column value is less than or equal to a specified value. Test if a column value matches a string pattern. Test if a column value is not between two specified values. Test if a column value is not equal to a specified value. Test if a column value does not match a string pattern. Test if a column value is among the top n values. Test if a column value is in the top n percent of all values. Example Email Is Not Blank
Is Not Null
Is Null Is True Less Than Less Than or Equal to Like Not Between Not Equal to Not Like Top N Top Percent
CreditLimit Is Null LoanApproved Is True Total Less Than 5000 Total Less Than or Equal to 5000 ProductName Like %Ford% Profit Not Between 1000 and 2000 Country Not Equal to France ProductName Not Like %Ford% SalesAmount Top N 10 SalesAmount Top Percent 5
189
YEAR( )
190
Part
2
Part 2
Chapter
9
Chapter 9
About BIRT Report Studio and the Actuate Information Console Overview of customization tasks Required Actuate software Understanding the context root
193
Servlet
Reports
JSP
JSP
Reportrelated objects
Figure 9-1
If you are using iServer Express, the Information Console installs with iServer Express. The Welcome page for the Information Console appears in your web browser as shown in Figure 9-2.
Figure 9-2
If you are using iServer, you can install the Information Console separately or with iServer. The Welcome page for the Information Console appears in your web browser as shown in Figure 9-3.
194
Figure 9-3
Create a suite of report templates on which users can base their reports. BIRT Report Studio includes a few predefined templates. Often, however, users request custom templates that better suit the types of reports they want to create. Provide sets of data that users can use in their reports. This task is required for BIRT Report Studio users to access the data they need for their reports. Customize the appearance and functionality of BIRT Report Studio. You can choose to enable and disable certain features. For example, if you do not want users to create computed fields in a report, you can disable that functionality. Deploy multiple instances of Actuate Information Console and BIRT Report Studio to provide different reporting services to different groups within your organization. For example, users in the marketing group can log into an Actuate Information Console instance that displays different pages and provides access to sales and marketing data only. Similarly, users in the customer service group can log into a different Actuate Information Console instance that provides access to customer issues data. This functionality is available with Actuate iServer, but not with Actuate iServer Express.
The rest of this part provides information about performing these customization tasks.
195
Actuate iServer and Actuate Information Console. You can install these products together or separately. Actuate iServer Express. Actuate Information Console installs with Actuate iServer Express. The Management Console. You use this web application to connect to an Actuate iServer Encyclopedia volume and perform administration tasks, such as creating folders for reports and report-related files, and assigning user privileges to folders and files. To perform administration tasks, you must log in as an administrator or as a user who belongs to the administrator security role. The Management Console installs with Actuate iServer or Actuate iServer Express. Actuate BIRT Report Designer Professional. You use this desktop application to create report templates and information objects, which provide data to reports.
For a typical Windows installation where Actuate Information Console is installed separately, the default context root is
C:\Program Files\Actuate10\iPortal\iportal
For a typical Windows installation where Actuate Information Console is installed with Actuate iServer or Actuate iServer Express, the default context root is
C:\Program Files\Actuate10\iServer\servletcontainer\iportal
196
For example, to change the category of report templates that appears by default in the Report Template dialog box, you edit web.xml, which is located in:
<context root>\WEB-INF
Some files that you modify to customize BIRT Report Studio are files whose content is cached while the application server runs. To view the changes that you make to these files requires that you restart a Windows service to refresh the user interface. Depending on the Actuate products in your installation, you complete one of the following tasks in Control PanelAdministrative ToolsServices to refresh the user interface:
For a Windows installation where Actuate Information Console is installed separately, restart the application server. If you are using the Apache Tomcat application server that installs with Actuate Information Console, restart the Apache Tomcat for Actuate Information Console service. For a Windows installation where Actuate Information Console is installed with Actuate iServer or Actuate iServer Express, restart the Actuate iServer service.
197
198
Chapter
10
Chapter 10
About report templates Design considerations Creating a report template Creating themes for a report template Publishing a template Publishing resources associated with a template
199
Design considerations
A template typically contains visual elements, such as tables, charts, and labels. It can, however, also contain defined data sets, which specify the data to display in a report. A template can even be a complete report that presents professionally formatted data. Before you begin creating templates, gather the following basic information:
What data will the BIRT Report Studio user use in a report? How does the user want to present the data? What does the user need as a starting point for a report?
The rest of this section provides tips for creating effective templates.
200
Designing themes
BIRT Report Studio provides several options for formatting the contents of a report. The standard toolbar provides the user with formatting options to modify the font, color, style, text alignment, and other properties of individual report items. The report design area on the left side of BIRT Report Studio displays themes, if any are provided, that the user can select to apply a set of styles to the entire report. A theme is a collection of styles. The concept and functionality of styles are similar to styles in Microsoft Word and cascading style sheets (CSS). Designers create a theme to apply a consistent style, or look and feel, to a report. A theme, for example, can specify the colors used in a report, the font used for different text, label, or data items, the spacing or alignment of items, border styles, and so on. BIRT Report Studio provides three themes with the default templates, as shown in Figure 10-1.
Figure 10-1
When you create a template, consider creating different themes so that the user can choose from multiple styles. While the creation of a theme is optional, it is standard practice among designers, similar to the use of cascading style sheets with web pages. Themes are stored in a BIRT library file, separate from the template file. Defining all the styles in a theme within a library, rather than applying formats to individual report items in the template, makes it easier to maintain and update the appearance of a template. When a user requests new or modified styles to use with a particular template, all you need to do is update the theme in the library, then publish the latest version of the library. You do not need to modify the template file.
Improving usability
A template should be intuitive to use. The user should be able to quickly determine how to use the elements in a template, and be able to freely edit most
201
elements. The following are some guidelines for improving the usability of a template:
The display name of the template A brief description of the template The image to use as the thumbnail image of the template
These properties are not required. However, if you do not specify a display name, the name of the template file is used. If you do not supply a description, the word null appears, and if you do not specify an image, the user sees a grey box with the x icon. Figure 10-2 shows what the user sees on the Report Template page when a templates properties are set and when the properties are not set.
Figure 10-2
Report Template page displays two templates, one with properties set, one without properties set
Decide which report elements in the template are editable, and which are not. Examples of editable elements include label elements for displaying report titles, section titles, or column headings, and empty tables into which users insert data. Examples of non-editable elements include company logos and standard copyright statements. Provide meaningful names for each report element so that the BIRT Report Studio user can easily identify the type and purpose of the element. If you do not specify a name, BIRT Report Studio displays the name of the element type, for example, Text or Label. If your template contains three labels, and you do not specify a name for any of the labels, BIRT Report Studio displays Label three times under Report Items. Report Items lists all the elements in the template so that users can choose whether or not to display the elements in the
202
report. Figure 10-3 shows one of the default templates with several elements listed under Report Items. The elements have descriptive names.
Figure 10-3
In BIRT Report Studio, Report Items lists all the template elements
Provide instructions for using each editable element. For example, a table can display a message, such as To insert data in this report, drag the columns you want from Available Data and drop them in this table. Figure 10-3 shows detailed instructions provided with a table.
203
template contains an editable table element, BIRT Report Studio prompts the user to select an information object after the user selects the template. If you are creating a template that includes data, create a data source and data set that specifies the data that the BIRT Report Studio user can display in the report. You can define multiple data sources and multiple data sets in a template. When the user selects a template with multiple data sets, BIRT Report Studio prompts the user to select one of the data sets to use for the report. For information about defining data sources and data sets, see BIRT: A Field Guide to Reporting.
How to create a report template
1 In the Report Design perspective, create a new template, using the following procedure: 1 Choose FileNewOther. 2 On New, expand Business Intelligence and Reporting Tools, then select Template. Choose Next. 3 In New TemplateTemplate, select the folder in which to create the template file, specify a file name, then choose Next. 4 In New TemplateSet Template Property: 1 In Display Name, specify a display name for the template. This name identifies the template when the template is displayed on the Report Template page in BIRT Report Studio. 2 In Description, provide a description of the template. This description appears as a ToolTip when the user hovers the mouse over the template in BIRT Report Studio. 3 In Template Image, browse to the thumbnail image of the template. This step assumes that you have already created the image you want to use as the thumbnail image and placed it in Shared Resources. You must use a path that is relative to the Actuate iServer Encyclopedia volumes resource folder. The following example is a typical example of a relative path:
\expense_rpt_template.jpg
The path example means that BIRT Report Studio expects the image file to be in the following location in the Actuate iServer Encyclopedia volume:
\<iServer resource folder>\expense_rpt_template.jpg
4 Choose Finish. A blank report page appears in the layout editor. 2 Drag elements from the palette and drop them in the layout editor.
204
3 For elements that you want BIRT Report Studio users to edit for their report designs, identify those elements as template report items. Only labels and tables can be edited in BIRT Report Studio. 1 Right-click the element, then choose Create Template Report Item. 2 Specify a descriptive name for the element, so that the BIRT Report Studio user can easily identify the purpose of the element. 3 Provide instructions for using the element. Figure 10-4 shows an example of an element name and instructions for using the element.
Figure 10-4
4 For elements that you do not want the BIRT Report Studio user to edit, you should also specify a descriptive name, so that the BIRT Report Studio user can easily identify the purpose of the element, and decide whether or not to include the element in the report. In Property Editor, type a name for the Name property. Figure 10-5 shows setting a labels name as Copyright.
Figure 10-5
You can use the BIRT Thumbnail feature to manage the thumbnail image. You can change the thumbnail image property from the General properties in Property Editor as shown on Figure 10-6.
205
Figure 10-6
General properties
Selecting the thumbnail button gives you three options for selecting the thumbnail image as shown on Figure 10-7.
Figure 10-7
Manage Thumbnail
Generate from report option auto-generates the image using the template design view and embeds the image in the template itself. It is a convenient feature for template developers. In this case you do not deploy the thumbnail image, you deploy only the template. Browse from file system option allows you to select the image from the file system. This option uses an absolute path to the image file and is not recommended when you deploy your template to iServer or iServer Express. Import from shared resources option allows you to select an image file from the BIRT report designer resource folder and embed the selected image in the
206
template design. If you use this option you do not need to publish the image file.
Create a custom style, and apply it to a report element. For example, you can create a style named Report Title, then apply the style to a label that displays the report title. Apply style properties to predefined style names, or selectors. These predefined style names correspond to the different types of report elements. For example, you can apply style properties to a predefined style named table-header, and all table headers in the report are formatted accordingly. This technique is similar to defining styles in CSS where you associate styles with HTML elements, such as <H1> or <P>.
1 Create a library: 1 Choose FileNewOther. 2 On New, expand Business Intelligence and Reporting Tools, then select Library. Choose Next. 3 In New Library, specify the folder in which to create the library, specify a file name, then choose Finish. If a message box appears, choose OK.
207
2 Choose the Outline view. The Outline view, shown in Figure 10-8, displays the types of report elements you can add to a library.
Figure 10-8
Outline view
3 In the Outline view, expand Themes. A default theme, named defaultTheme, has already been created. 4 Right-click defaultTheme and choose Rename to change the name of the theme. 5 Right-click the theme, and choose New Style to create a style for the theme. 6 On New Style, select one of the following options:
To apply style properties to a specific type of report element, select Predefined Style, and select a style from the drop-down list. To create a user-named style, select Custom Style and specify a unique descriptive name, such as Report Title or Copyright.
7 Set the desired properties for the style by selecting a property category on the left and specifying property values. 8 When you finish setting style properties, choose OK to save the style. 9 Repeat steps 5 to 8 to create additional styles for the theme. 10 To create a new theme, right-click Themes, and choose New Theme.
How to associate a library with a template
1 Place the library in the BIRT resource folder, so that it is available to the template. To specify a folder as the resource folder: 1 Choose WindowPreferences.
208
2 In Preferences, expand Report Design, then choose Resource, as shown in Figure 10-9.
Figure 10-9
3 Choose Select to select a folder to use as the resource folder. 4 On Browse For Folder, navigate to a folder on your computer or on the network, or choose Make New Folder to create a new folder. 5 Choose OK to confirm your folder selection. Preferences displays the path to the resource folder. 6 Choose OK to save the resource folder location information and close the Preferences window. 7 In the layout editor or Navigator, select the library, then choose FilePlace Library in Resource Folder. Publish Library displays the library name and the location of the resource folder. 8 Choose Finish to confirm placing a copy of the library in the resource folder. 2 Open the template file, and choose the Outline view.
209
3 In the Outline view, right-click Libraries, and choose Use Library, as shown in Figure 10-10.
Figure 10-10
4 In Use Library, expand Shared Resources to display the libraries placed in the BIRT resource folder. Figure 10-11 shows an example of Use Library displaying the libraries in the resource folder.
Figure 10-11
5 Select the library that contains the themes you want to use with the template, then choose OK.
Publishing a template
Templates must be published in specific locations. Otherwise, BIRT Report Studio cannot display the templates. BIRT Report Studio displays templates by categories. The default user interface has only one category named Standard. When you publish a template, you can create a new category or select an existing category in which to display your template. If you create and publish a wide variety of templates, you can organize the templates into different categories. You can, for example, organize templates by
210
report types (budget reports, expense reports, stock purchase plan reports) or by departments in your organization (Human resources, Sales, Customer Support). Figure 10-12 shows an example of BIRT Report Studio customized to display three template categories by report types. The Standard category appears at the top of the list because it is the default category supplied with BIRT Report Studio. All other categories that you create are listed in alphabetical order. You can designate a different template category as the default category. This task is described later in this section.
Figure 10-12
Templates must be published to the \<iServer resource folder> \BizRDRptTemplates folder on the Actuate iServer Encyclopedia volume. The general steps are: 1 Use the default resource folder, named Resources, at the root level of the Encyclopedia volume. Alternatively, you can create a different resource folder on the Encyclopedia volume, using the Management Console. 2 Publish the template, using Actuate BIRT Report Designer Professional. The first time you publish a template, the BizRDRptTemplates folder is created within the Encyclopedia volumes resource folder. Do not change the name of the BizRDRptTemplates folder. BIRT Report Studio looks for templates in this folder, and the folder name is not configurable. Each of these steps is described in detail next.
How to create a resource folder on the Encyclopedia volume
1 Log into the Management Console. 2 Create a new folder that you can designate as the resource folder. 3 Set the Encyclopedia volumes resource folder property. 1 Choose Volume.
211
2 On Volume, choose Properties. 3 On the General Properties page, in Resource folder, specify a resource folder name. The default resource folder name, Resources, appears in Figure 10-13.
Figure 10-13
1 In Actuate BIRT Report Designer Professional, in Navigator, right-click the template file, then choose Publish Template to iServer. Publish Templates appears with the template file selected, as shown in Figure 10-14.
Figure 10-14
Publish Templates
212
2 On Publish Templates, select an iServer profile from the drop-down list. An iServer profile specifies the connection properties to connect to a specific Encyclopedia volume. If there is no appropriate profile, create a new profile: 1 Choose Add. 2 Specify the connection information in New iServer Profile. 1 In Profile name, type a unique name that identifies the new profile. 2 In iServer, type the name or IP address of the computer on which Actuate iServer is installed. 3 In Port number, type the number of the port to access Actuate iServer. 4 In Volume, select the Actuate iServer Encyclopedia volume. 5 In User name, type the user name required to access the volume. 6 In Password, type the password required to access the volume. 3 Choose Finish to save the iServer profile. 3 On Publish Templates, in Template Category, select an existing category from the drop-down list in which to publish the template. Alternatively, create a new category by choosing Browse, then specifying the name of the new category. 4 In Version, select the desired versioning option. To copy the privileges from the last published version of the template, select Copy permissions from last version. 5 Choose Publish Files, then choose Close after the file is published. The first time you publish a template to an Encyclopedia volume, you must grant users access to the appropriate template folders and files. For more information about assigning privileges for folders and files on an Actuate iServer Encyclopedia volume, see Managing an Encyclopedia Volume.
213
2 Change the value of the DEFAULT_REPORT_TEMPLATE_CATEGORY _NAME parameter from Standard to the name of the category whose templates you want the Report Template dialog to display by default. The following example shows the Sales category set as the default template category:
<param-name>DEFAULT_REPORT_TEMPLATE_CATEGORY_NAME </param-name> <param-value>Sales</param-value>
3 Restart the appropriate Windows service for the change to take effect.
An image file that provides the user with a thumbnail image of the template A library file that contains the themes the user can select to apply to the report
If a template contains localized text and you have created resource files that translate text into different languages, you must also publish these resource (.properties) files. You publish resources used by a template to the resource folder on the Actuate iServer Encyclopedia volume. The procedure for creating and designating an Encyclopedia volume resource folder is described earlier in this section.
How to publish resources
1 Using the file system, put the image file in the BIRT resource folder (not to be confused with the Actuate iServer Encyclopedia volume resource folder). The location of the BIRT resource folder is specified in the Preferences page, which you access by choosing WindowPreferences, then choosing Report DesignResource. 2 Choose FilePublish Resource to iServer. Publish Resources displays the files in the BIRT resource folder. 3 Select the files to publish. 4 In iServer profile, select the profile that specifies the connection properties to the Encyclopedia volume where you want to publish the file. Publish location displays the name of the Actuate iServer Encyclopedia volumes resource folder. All BIRT resource files are published to the volumes resource folder. You cannot change the location.
214
Figure 10-15
5 Choose Publish Files, then choose Close after the file is published.
215
216
Chapter
11
Chapter 11
Providing data
Types of data sources Creating information objects Creating a custom data source
217
Create and publish information objects. Create and publish report templates that include defined data sets. Use this method if you want to provide templates that combine both presentation and data elements. Create a custom data source and integrate it with BIRT Report Studio. Use this method if the data is stored in a proprietary system, or if you want to design a custom user interface for selecting data.
This chapter describes the first and third methods. The second method is described in Chapter 10, Creating and publishing report templates.
Design considerations
Design information objects for the business user, not for other data experts. Take into account the experience levels of the users. The point of creating information objects is to shield the user from the complexities of data structures and relationships. Before you begin creating information objects, understand the types of reports users want to create, the data they need, and the different ways users can manipulate data in BIRT Report Studio. The rest of this section provides general guidelines for designing usable information objects.
218
that returns hundreds of columns of data from multiple database tables and even from disparate data sources. While it may be tempting to create a single information object that contains all the data that BIRT Report Studio users want, an information object that contains too much data is not usable. Once you determine the data the BIRT Report Studio users need, evaluate how best to organize the data into information objects, and how much data to include in each information object. For usability reasons, it is good practice to limit the number of columns per information object. One way to do so is to include only related data in each information object. For example, create one information object that contains customer data, and another information object that contains orders data. On the other hand, if a novice user wants to create a report that displays order totals for customers, and the relevant data is stored in an orders table and a customers table, you might want to create an information object that joins the data from the two tables and calculates the totals. A single report can display data from multiple information objects, so you do not need to create a single information object that provides all the data that a particular report requires. BIRT Report Studio provides two options for using data from multiple information objects:
The user can join data in information objects through a common column. To support this operation, the advanced data-manipulation option must be enabled for the user. The procedure for enabling this option is described in the nextchapter. The user can use a report template that includes more than one table, and associate a different information object with each table. This strategy requires coordination of the template design with the information object design.
Consider also that BIRT Report Studio provides the user with easy ways to select, sort, group, filter, and aggregate data. You can create an information object that provides more data than any one report needs, and let the user process the data further.
219
Figure 11-1 shows an example of a project in the Navigator view in the IO Design perspective. In the example, a single project named BIRT Report Studio Data contains two information objects that retrieve data from two different data sources.
Figure 11-1
Figure 11-2 shows the folder hierarchy that the BIRT Report Studio user traverses, by default, to select an information object for the report, assuming that you grant the user access to the information object project folders. In addition to planning the folder names and hierarchy of an information object project, you can simplify user access to information objects. This strategy is discussed later in this chapter.
Figure 11-2
220
For example, if you want information object columns to appear in the same order in which they appear in the IO Design perspective, uncomment the DATAFIELDS_DISPLAY_ORDER parameter and set it to none:
<context-param> <param-name>DATAFIELDS_DISPLAY_ORDER</param-name> <param-value>none</param-value> </context-param>
You can also set DATAFIELDS_DISPLAY_ORDER to ascending or descending. The default value is ascending. Restart the appropriate Windows service for the change to take effect.
221
Uncategorized columns
Figure 11-3
1 Create an information object project. An information object project organizes all the files required for the creation and use of information objects. You can create one project for all the information objects and their related objects, or you can organize information objects in multiple projects. 2 Create a data connection definition. A data connection definition specifies the properties to connect to a data source, as shown in Figure 11-4. The properties
222
include the data source type, user name, and password. A data connection definition file name has a .dcd extension.
Figure 11-4
3 Create a map. A map, as shown in Figure 11-5, represents the data in a discrete entity, for example, a single database table, a result set returned by a stored procedure, or an XML file or flat file. A map file name has a .sma extension.
Figure 11-5
4 Create an information object, using data from one or more maps. You can also build an information object from other information objects. Figure 11-6 shows an information object that uses data from two maps. An information object file name has an .iob extension. The tabs shown at the bottom of Figure 11-6 represent the different ways you can manipulate the data in an information object. For example, to organize
223
columns in categories, choose Column Categories. To limit the data that the information object returns, choose Filters.
Figure 11-6
224
definition (.dcd) files and map (.sma) files used by the information object are saved in subfolders within a subfolder named Data Sources. There are two ways to publish a project. In the Navigator view:
Select the project, then choose FilePublish To. When you choose this option, a Publish Project dialog, shown in Figure 11-7, prompts you to select the project, a folder, or individual files to publish, and the Encyclopedia volume folder in which to save the files.
Figure 11-7
Select the project, then choose FilePublish. All the files in the project are published to the Encyclopedia volume folder you specified the last time you published the project. If you are publishing the project for the first time, the Publish Project dialog appears.
The first time you publish a project to an Encyclopedia volume, you must grant users access to the appropriate folders and files. After that, the privileges are copied from the previous version. For more information about assigning privileges for folders and files on an Actuate iServer Encyclopedia volume, see Managing an Encyclopedia Volume.
225
Configure BIRT Report Studio so that the Select Information Object dialog initially shows the Information Object folder where the information objects reside. Hide the folders that are not required.
You can use both techniques, each described in the following sections.
The users home folder, if you or another administrator created a home folder for the user. The root folder in the volume, if the user does not have a home folder. Figure 11-2 shows an example of the folder hierarchy that the user traverses from the root folder to find information objects published to the volume.
You can simplify user navigation by setting the starting folder to the Information Objects folder where the information objects reside, as Figure 11-8 shows. Using this setting, the user sees all the information objects immediately.
226
Figure 11-8
You specify the Information Objects folder as the starting folder if all the information objects available to the user are stored in one folder. If, however, you organized your information objects in multiple projects, each project is a folder on the volume, and each project folder contains its own Information Objects folder. In this case, you typically set the starting folder at a higher level, so that the user first selects the desired project folder, then the Information Object folder within the project folder. Figure 11-9 shows an example of starting navigation from a folder that contains multiple information object project folders. If your installation of Actuate iServer supports multiple volumes, you can set a different starting folder for each volume. Setting a starting folder does not mean that the Select Information Object dialog displays only the specified folder and its contents. The user can still navigate up to other folders for which she has been granted access. In the example shown in Figure 11-9, the user can navigate to folders above the BIRT Report Studio Data folder. To set the starting folder from which the user navigates to find information objects, you edit erni_config.xml. erni_config.xml resides in the following location:
<context root>\WEB-INF
In erni_config.xml, the <iserverconfigs> element defines the Actuate iServer volumes for which you configure the starting folders. Each <iserverconfig> element under <iserverconfigs> defines the iServer name, iServer port, volume name, and starting folder name.
227
Figure 11-9
Listing 11-1 shows the two sample definitions of <iserverconfig>, which are commented out in erni_config.xml.
Listing 11-1 Sample <iserverconfig> elements defined in erni_config.xml
228
If you are working with a server that supports multiple volumes, and you want to set a different starting folder for each volume, define an <iserverconfig> entry for each volume. If you are configuring only one volume, or if you want to use the same starting folder for multiple volumes, specify the path to the starting folder in the <defaultIOStartingDir> element. Be careful when editing this section of erni_config.xml. Comment out <iserverconfig> elements that you do not use. Read the attribute descriptions provided in erni_config.xml to get information about valid values to supply for each element. Listing 11-2 shows an example of the <iserverconfigs> section edited to set the starting folder to the /ClassicModels Data/Information Objects folder. The changes are shown in bold. Notice that the sample <iserverconfig> elements are commented out. You would edit the <iserverconfigs> section as the example shows for a single-volume server, or if you want all volumes to use the same starting folder.
Listing 11-2 The <defaultIOStartingDir> element set to a folder
<iserverconfigs> <defaultIOStartingDir>/ClassicModels Data/Information Objects</defaultIOStartingDir> <!-<iserverconfig> <server>speedy</server> <port>8000</port> <volume>speedy</volume> <ioStartingDir>/AQ</ioStartingDir> </iserverconfig> <iserverconfig> <server>ddykm7b1</server> <port>8000</port> <volume>ddykm7b1</volume> <ioStartingDir>/design</ioStartingDir> </iserverconfig> --> </iserverconfigs>
229
2 Find the <iserverconfigs> section at the end of the file. This entire section is commented out. 3 Move the closing comment marker, -->, which appears after </iserverconfigs> to the line after the documentation about the feature. This edit keeps the documentation as a comment, and uncomments the <iserverconfigs> element. 4 Edit the <iserverconfigs> section to specify the starting folder for a single volume, or for multiple volumes. 5 Restart the appropriate Windows service for the changes to take effect.
Hiding folders
All the files in an information object project are required for a report to use data in an information object, therefore, you must publish all the files to an Actuate iServer Encyclopedia volume. The user, however, needs only to select the information object. You can simplify the users folder navigation by hiding the Data Sources folder and its contents and displaying only the Information Objects folder and the contents in this folder. You accomplish this task by using the Management Console to assign the appropriate folder and file privileges to the user, using these general steps: 1 Create a security role, for example, BRS User. 2 Create a user profile for each BIRT Report Studio user, and assign the BRS User role to the users. 3 Select each folder, and assign the appropriate privileges to the BRS User. By default, users do not have access to folders or files created by someone else. When you publish files, you must explicitly assign privileges to roles or users.
To enable the user to see the information objects, select the top-level project folder and the Information Objects subfolder, select the BRS User role, then assign the Visible privilege. To enable the user to execute an information object, assign the Trusted Execute privilege to the .iob file. The Trusted Execute privilege permits the user to execute an information object without having privileges on the information objects underlying data sources.
For more information about creating roles and users, and assigning privileges for folders and files in an Actuate iServer Encyclopedia volume, see Managing an Encyclopedia Volume.
230
Develop an Open Data Access (ODA) data driver to connect to and retrieve data from a data source. Develop a query builder that prompts the user to select data, processes the users selection, and creates the query to get the data. Configure the custom data source for use with BIRT Report Studio.
The following sections describe each task in more detail, referring to a sample implementation that installs with Information Console.
Listing 11-3 shows in bold the <enabledInEnterpriseMode> attribute whose value you change from false to true. Look for the ODA data source named OdaSample.
Listing 11-3 Configuration of the sample data source in erni_config.xml
... <odaconfig> <name>OdaSample</name> <displayName>Sample ODA data source</displayName> <description>A sample ODA data source</description> <datasetExtensionId> org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet </datasetExtensionId> <datasourceExtensionId> org.eclipse.birt.report.data.oda.jdbc </datasourceExtensionId> <enabledInWorkgroupMode>true</enabledInWorkgroupMode> <enabledInEnterpriseMode>true</enabledInEnterpriseMode> <entryPoint>/OdaSample</entryPoint> </odaconfig>
231
After you enable the sample data source, restart the appropriate Windows service, and open BIRT Report Studio. When prompted, select one of the standard report templates. The Data Source dialog, shown in Figure 11-1, prompts you to select a data source. Select Sample oda data source. (The second option, Actuate data integration service connection, is the data source component that connects to information objects.)
Figure 11-1
A query builder page, shown in Figure 11-2, prompts you to select the data to use in the report.
Figure 11-2
After you select the data and choose OK, the query builder closes, and the data you selected appears under Available Data, as shown in Figure 11-3.
232
Figure 11-3
The custom data source example uses a predefined ODA JDBC driver to connect to the ClassicModels sample database. The source code for this driver (org.eclipse.birt.report.data.oda.jdbc) is available in the Eclipse DTP CVS repository. After you develop a custom ODA driver, you enable its use with BIRT Report Studio by copying the driver to the following folder:
\Program Files\Actuate10\MyClasses\eclipse\plugins
This folder is the designated location for custom ODA drivers, as specified by the link file, customPlugins.link. The customPlugins.link file contains the following path information:
path=C:/Program Files/Actuate10/MyClasses
233
ClassicModelQueryBuilder.jsp. This JSP displays the page shown in Figure 11-2. It also contains JavaScript functions to build the string that contains information about the data that the user selected, and to send the request to a servlet. To view the code, see ClassicModelQueryBuilder.jsp in the following location:
<context root>\bizRD\oda\sample
SampleServlet.java. This servlet communicates with ClassicModelQueryBuilder.jsp, creates a design session, and creates the query using information from the JSP. To view the code, see SampleServlet.java in the following location:
<context root>\iportal\examples\oda\classes\com \actuate\erni\oda\ClassicModels
Manages design sessions for concurrent BIRT Report Studio users. Uses ODA API to define the basic methods for constructing a query, result set, and column objects. Processes the information sent by ClassicModelQueryBuilder.jsp and creates a query. Returns dynamic content that appears in Available Data, as shown in Figure 11-3.
The servlet contains declarations of the ODA data drivers data source and data set extensions:
private final static String Datasource_Extension_Id = "org.eclipse.birt.report.data.oda.jdbc"; private final static String Dataset_Extension_Id = "org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet";
These extension IDs are used to construct the definitions of the data source connection and data set query in the report design. The servlet supports the GET method only. Its doGet method retrieves request parameters, creates a unique ODA design session, and stores a session ID in the ODA session so that other requests in the same session can access the same ODA
234
session object. In any given session, the servlet can receive multiple requests with different parameter values. Table 11-1 describes the supported parameters.
Table 11-1 Session request parameters
Description Indicates whether the user has started editing the values on the query builder page. Values are null or true. Shows the editing status. Values are null, ok, or cancel. Contains information about the selected data fields. Contains the session ID.
The servlet executes a different action, depending on the parameter values. Table 11-2 describes the actions taken with the different inedit and state values.
Table 11-2 Actions corresponding to inedit and state values
Action Generates a new session ID. Stores the ID and the callback URL in the session map. Changes the inedit parameter to true and sends a response to the calling page. Redirects the response to ClassicModelQueryBuilder.jsp. The user has finished selecting the data fields. The servlet deletes the session ID, and parses the value in the selection parameter to build the query. The response is redirected to a BIRT Report Studio page. The user cancelled out of the query builder page. The servlet deletes the session ID.
null ok
not null
cancel
235
servlet.jar You can find this file in different places, depending on the Actuate products installed on your computer. For example, servlet.jar can be found in the following location:
\Program Files\Actuate10\oda\eclipse\plugins \com.actuate.data.oda.ais.ui_1.3.1.v20081028\lib
If you deploy the servlet as a class file, create a folder named classes, and copy the servlet class to the following location:
<context root>\WEB-INF\classes
The first entry, under the <servlet> element, defines a name for the servlet and specifies the compiled class that executes the servlet. The following example shows the <servlet> entry for the sample servlet:
<servlet> <servlet-name>OdaSampleServlet</servlet-name> <servlet-class> com.actuate.erni.oda.ClassicModels.SampleServlet </servlet-class> </servlet>
236
The second entry, under the <servlet-mapping> element, defines the URL pattern that calls this servlet. The following example shows the <servlet-mapping> entry for the sample servlet:
<servlet-mapping> <servlet-name>OdaSampleServlet</servlet-name> <url-pattern>/OdaSample</url-pattern> </servlet-mapping>
Listing 11-3 shows the definition of the sample data source. To add your custom data source, create a new <odaconfig> element in erni_config.xml. Table 11-3 describes each attribute, within the <odaconfig> element, that you configure.
Table 11-3 Attributes of a custom data source
Attribute <name>
Description The unique name of the data source. This name must follow certain naming conventions. There can be no spaces, for example. The data source name that appears in the Data Source dialog box, which prompts the user to select a data source. Figure 11-1 shows this dialog box. The data source description that appears in the user interface.. Identifies the ID of the data set extension created in the ODA data driver. The value should match the data set extension ID specified in the servlet. Identifies the ID of the data source extension created in the ODA data driver. The value should match the data source extension ID specified in the servlet. Not used. Indicates whether this data source is available to users.
<displayName>
<description> <datasetExtensionId>
<datasourceExtensionId>
<enabledInWorkgroupMode> <enabledInEnterpriseMode>
237
Table 11-3
Attribute <entryPoint>
Description A URL or servlet that points to the first web page of your custom query builder.
The HOME property shows the directory in which to place the CSV file.
238
Chapter
12
Chapter 12
239
Customizations you make to erni_config.xml apply at the application level. If you want different sets of functionality available to different groups of users, you need to create multiple instances of the web application, then customize the functionality of each BIRT Report Studio instance. Creating multiple instances of Information Console is not supported with iServer Express. In erni_config.xml, the <actionSets> element defines all the user actions that can be enabled or disabled. The actions are organized by category, for example, file operations, calculations, and formatting. The <actionSet> element defines the category, and the <action> element defines a specific action. Listing 12-1 shows the hierarchy of elements.
Listing 12-1 An example of an <actionSet> element defined in erni_config.xml
<actionSets> <actionSet> <name>FileOperations</name> <visible>true</visible> <action> <name>New</name> <enabled>true</enabled> </action> <action> <name>Open</name> <enabled>true</enabled> </action>
240
<action> <name>Save</name> <enabled>true</enabled> </action> <action> <name>SaveAs</name> <enabled>true</enabled> </action> <action> <name>Parameter</name> <enabled>true</enabled> </action> </actionSet>
By default, all actions are enabled. You can disable actions in the following ways:
To disable a particular action, change the actions <enabled> attribute from true to false. To disable all actions within a category in one step, change the action sets <visible> attribute from true to false.
For the changes to take effect, restart the appropriate Windows service. When you relaunch BIRT Report Studio, the toolbar displays different buttons and the context menus display different items, depending on which action or actions you disabled.
Configurable actions
Table 12-1 lists and describes briefly all the toolbar and context menu actions that you can enable or disable. Some of the actions appear in both the toolbar and context menus, and some appear in context menus only. While you can disable any of the actions defined in erni_config.xml, it does not make sense to disable some of the actions. For example, disabling both the New and Open actions under file operations makes BIRT Report Studio practically non-functional, because the user cannot create or open reports.
Table 12-1 User actions that can be enabled or disabled through erni_config.xml
Description Performs a calculation over a specified set of data rows Creates a calculated column based on a specified expression Inserts a chart
241
Table 12-1
Action Set
Description Shows the data fields in the report, and supports adding or deleting fields in the report Changes a calculated column Filters table rows based on a specified condition Deletes the row of the selected column header Inserts a row above or below the selected column header Merges the selected column header with the header on the right, left, or above Splits the selected merged columns Changes the width of the selected column Merges the selected columns If duplicate data values appear in the selected column, displays only the first instance Changes the order of the columns in the table Displays duplicate data values in the selected column Deletes a column from a table in the report Enables editing of the selected static text Creates a new report design file Opens an existing report design Displays the parameters, if any, for the current report Saves the current report design
ReorderColumns RepeatValues DeleteColumn EditText FileOperations DeleteColumn EditText New Open Parameter Save
242
Table 12-1
Action Set
Action SaveAs
Description Saves the current report design file under a different name or in a new location Centers the text in the selected column Aligns the left sides of text in the selected column Aligns the right sides of text in the selected column Draws a border around the selected column
Formatting
ConditionalFormat Formats data in the selected column based on a specified condition Data Font Grouping CreateSection Formats the display of data in the selected column Formats the font of data in the selected column Adds a report section, which provides an additional level of data grouping Removes the selected report section Groups table rows by values in the selected column Hides the detail rows in a report section Adds page breaks before or after a report section Shows the detail rows in a report section Removes groups in the selected column Shows help information Displays page layout toggle under toolbar. Disabled by default.
DeleteSection GroupBy HideDetail PageBreak ShowDetail UngroupBy Help PageLayout Help PageLayoutIn Toolbar
243
Table 12-1
Description Shows a preview of the report in HTML format Shows the data fields in the report, and supports adding fields to the selected section heading Sorts the table rows by the values of multiple columns Sorts, in ascending order, the table rows by the values of the selected column Sorts, in descending order, the table rows by the values of the selected column Redo the last action Undo the last action
Sorting
AdvancedSort SortAscending
SortDescending
UndoRedo
Redo Undo
Configuration examples
This section provides examples of editing attributes in erni_config.xml, and the resulting changes to the BIRT Report Studio page. Figure 12-1 shows the default BIRT Report Studio page with all actions enabled. The formatting actions on the toolbar and context menu are called out, so that you can see the difference in the toolbar and context menu when these actions are disabled. Listing 12-2 shows a change to the Formatting action set. Its <visible> attribute, shown in bold, is set to false. Note, however, that all the actions under the Formatting action set are still enabled.
244
Formatting actions
Formatting actions
Figure 12-1
Default BIRT Report Studio page Visibility of the Formatting action set changed to false
Listing 12-2
<actionSet> <name>Formatting</name> <visible>false</visible> <action> <name>AlignLeft</name> <enabled>true</enabled> </action> <action> <name>AlignCentert</name> <enabled>true</enabled> </action> <action> <name>AlignRight</name> <enabled>true</enabled> </action>
245
<action> <name>Font</name> <enabled>true</enabled> </action> <action> <name>Border</name> <enabled>true</enabled> </action> <action> <name>ConditionalFormat</name> <enabled>true</enabled> </action> <action> <name>Data</name> <enabled>true</enabled> </action> </actionSet>
Figure 12-2 shows the updated BIRT Report Studio page. None of the formatting actions appear in the toolbar or the context menu. Setting the <visible> attribute of an action set to false disables all actions within the action set.
Figure 12-2
Listing 12-3 shows changes to the Font and Data actions within the Formatting action set. The Formatting action sets <visible> attribute is set to true. The Font and Data actions are disabled. The other actions in the action set are still enabled.
Listing 12-3 Font and Data (formatting) actions disabled
246
<action> <name>AlignLeft</name> <enabled>true</enabled> </action> <action> <name>AlignCentert</name> <enabled>true</enabled> </action> <action> <name>AlignRight</name> <enabled>true</enabled> </action> <action> <name>Font</name> <enabled>false</enabled> </action> <action> <name>Border</name> <enabled>true</enabled> </action> <action> <name>ConditionalFormat</name> <enabled>true</enabled> </action> <action> <name>Data</name> <enabled>false</enabled> </action> </actionSet>
Figure 12-3 shows the updated BIRT Report Studio page. The alignment actions are available on the toolbar and on the context menu, but not the font and data formatting actions.
247
Alignment actions
Figure 12-3
Updated toolbar and context menu, without the font and data formatting actions
The Modify button enables the user to change the data set by joining it with one or more information objects. The Synchronize Data Sets button enables the user to update the data set in the report design with the current data in the information object on the volume.
248
Figure 12-4
By default, these data options are available only to users with the administrator or Active Portal Advanced security roles and they are in effect only when the data sources are information objects. When users with other roles log into BIRT Report Studio, the Modify and Synchronize Data Sets buttons do not appear. You can enable these options for users with different roles by editing attributes in one of Information Consoles configuration files, functionality_level.config. This configuration file defines roles, or levels, for Information Console users, from Basic to Administrator. Each role has a predefined set of functionality that the role can execute in Information Console. For information about all the functionality options listed in functionality_level.config, see Customizing and Integrating Actuate iServer Express Web Applications or Customizing and Integrating Actuate iServer Web Applications. Listing 12-4 shows the Intermediate and Advanced levels defined in functionality-level.config. The listing highlights in bold the advanced data option that is available to the Active Portal Advanced role but not the Active Portal Intermediate role.
Listing 12-4 Intermediate and Advanced levels defined in functionality-level.config
249
<FeatureID>Search</FeatureID> <SubfeatureID>DeleteFile</SubfeatureID> <SubfeatureID>SelfNotificationWithAttachment</ SubfeatureID> <SubfeatureID>SubscribeChannel</SubfeatureID> <SubfeatureID>InteractiveViewing</SubfeatureID> <AnalyticsExperienceLevel>Novice</ AnalyticsExperienceLevel> <AnalyticsExperienceLevel>Standard</ AnalyticsExperienceLevel> <AnalyticsExperienceLevel>Advanced</ AnalyticsExperienceLevel> </Level> <Level> <Name>Advanced</Name> <Role>Active Portal Advanced</Role> <FeatureID>Jobs</FeatureID> <FeatureID>Documents</FeatureID> <FeatureID>Channels</FeatureID> <FeatureID>Search</FeatureID> <SubfeatureID>DeleteFile</SubfeatureID> <SubfeatureID>SelfNotificationWithAttachment</ SubfeatureID> <SubfeatureID>SubscribeChannel</SubfeatureID> <SubfeatureID>CreateFolder</SubfeatureID> <SubfeatureID>DeleteFolder</SubfeatureID> <SubfeatureID>ShareFile</SubfeatureID> <SubfeatureID>JobPriority</SubfeatureID> <SubfeatureID>InteractiveViewing</SubfeatureID> <SubfeatureID>AdvancedData</SubfeatureID> <AnalyticsExperienceLevel>Novice</ AnalyticsExperienceLevel> <AnalyticsExperienceLevel>Standard</ AnalyticsExperienceLevel> <AnalyticsExperienceLevel>Advanced</ AnalyticsExperienceLevel> </Level>
To enable the advanced data options for other roles, add the following line in the corresponding <Level> definition:
<SubfeatureID>AdvancedData</SubfeatureID>
You must add this line after the last <SubfeatureID> element. For example, to add the line to the Intermediate level, you must add it after <SubfeatureID>InteractiveViewing</SubfeatureID>. Unlike the functionality options you set through erni_config.xml, the options you set in functionality_level.config apply at the user role level, not at the application
250
level. A single instance of BIRT Report Studio displays or hides the advanced data options, depending on the user login.
BIRT Report Studio parameters control how BIRT Report Studio operates a web application and how it interoperates with Information Console. Table 12-2 describes the configuration parameters for BIRT Report Studio.
Table 12-2 BIRT Report Studio web.xml parameters
Description Path to Actuate BIRT shared resources, including libraries and templates for Actuate BIRT report designs and BIRT Report Studio. The default value is <context root>\resources. Path to script libraries. The default value is <context root> \scriptlib. The number of data rows to display in BIRT Report Studio when designing a report. The default value is 100. The default BIRT Report template category to load when a user opens BIRT Report Studio. The default value is Standard.
DEFAULT_WORKGROUP_ Specifies the functionality role for all users of BIRT Report FUNCTIONALITY_ROLE Studio, and the BIRT Viewer. The default value is Active Portal Intermediate. MAX_BRSTUDIO_ DESIGN_SESSION MAX_BRSTUDIO_USER_ SESSION MAX_DATA_CACHE_ ROW_COUNT The maximum number of designs a user can edit concurrently in BIRT Report Studio. The default is 10. The maximum number of concurrent BIRT Report Studio sessions on the server. The default is 256. Limits the number of data rows that a user can choose to display in Actuate BIRT Report Studio when designing a report. The default value is 200.
251
Table 12-2
Description The number of values to be shown in the parameter dialog for a dynamic value parameter in BIRT Report Studio. A positive number value N means only the first N values are shown in the parameter dialog. A value of 0 means all values from the data source appear in the parameter dialog. 0 is the default value. A value of -1 means only the first N values are shown where N is the current data cache row count set for the current design session. MAX_NUMBER_OF_VALUES_FOR_DYNAMIC_ PARAMETER only applies to a dynamic value parameter. All the values are shown for a static value parameter no matter how many values it has. For a static value parameter, the full list appears in the parameter dialog when the user chooses Save And View. Specifies the number of data rows to be cached in memory. The default value is 50. Specifies the number of rows to fetch when a user chooses to filter a report on a column in BIRT Report Studio. The default value is 200. Indicates whether to include column headings in report search results when the output format is CSV or TSV. Set this parameter to True, the default value, to include column headings. Indicates whether to enclose search results in quotes when the output format is CSV or TSV. The default value is True, which encloses the results in quotes.
252
Chapter
13
Chapter 13
Accessing BIRT Report Studio using a URI Using the BIRT Report Studio servlet Using the BIRT Report Studio URLs
253
application server is the name of the machine hosting the application server. port is the port on which the application server listens for requests. context root is the BIRT Report Studio context root. wr is the name to which the servlet is mapped in the web applications web.xml file. A typical location for web.xml is C:\Program Files\Actuate10 \iPortal\iportal\WEB-INF.
Servlet names are case sensitive. Do not modify the servlets, their names, or their mapping in web.xml.
com.actuate.erni.servlet.ERNIViewerServlet Invoke the BIRT Report Studio servlet as: http://<web server>:<port>/<context root>/wr?<parameters> The BIRT Report Studio servlet requires repository parameters in order to operate. Table 13-1 lists and describes the URI parameters for the BIRT Report Studio servlet.
Table 13-1 BIRT Report Studio URI parameters
URI parameters
Description The repository type. Use Enterprise for an Encyclopedia volume. The URL of an iServer machine.
254
Table 13-1
Description The name of an Encyclopedia volume managed by the iServer URL to which you connect.
A specific report design A specific template A report design that accesses a specific information object A report design that accesses a specific information object and a report template
In the example URLs in the following topics, special characters are represented by codes as shown in Table 13-1.
Table 13-1 Codes for special characters in URLs
To access the BIRT Report Studio login page, use a URL like the one in the following example:
http://Athena:8700/iportal/wr?repositoryType=Enterprise &serverurl=https%3a%2f%2fptop.only.wip.la%3a443%2fhttp%2fAthena%3a8000&volume=Athena
where
Athena:8700 is the name of the computer on which Java Component is installed and the port you use to access Java Component. iportal is the context root for Java Component. wr is the default context root for accessing BIRT Report Studio.
255
? indicates the beginning of a parameter that indicates where to access BIRT Report Studio files. repositoryType=Enterprise indicates the repository type is Encyclopedia volume. &serverurl=https%3a%2f%2fptop.only.wip.la%3a443%2fhttp%2fAthena%3a8000&volume=Athena specifies the URL to the Actuate iServer and Encyclopedia volume in which you work.
To log in and go directly to the BIRT Report Studio design environment, add userid and password parameters to the URL, as shown in the following example:
http://Athena:8700/iportal/wr?repositoryType=Enterprise &userid=MyUser &password=MyPwd &serverurl=https%3a%2f%2fptop.only.wip.la%3a443%2fhttp%2fAthena%3a8000 &volume=Athena
Sending securty information such as the user name and password in a URL is not a recommended approach.
How to open BIRT Report Studio and load an existing report design
To open an existing report design in BIRT Report Studio, use a URL like the one shown in the following example:
http://athena:8700/iportal/wr?repositoryType=Enterprise &serverurl=https%3a%2f%2fptop.only.wip.la%3a443%2fhttp%2fathena%3a8000 &__report=%2fHome%2fPublic%2fCustomers%2erptdesign &pCountry=USA
__report=%2fHome%2fPublic%2fCustomers%2erptdesign is the path to the report design to use. pCountry=USA is a parameter-value pair for the report design.
256
Index
Symbols
! (exclamation point) character 26 " (double quotation mark) character 50 % (percent) character 81, 166 % operator 187 & operator 188 * (asterisk) character 179 * operator 187 + operator 187 . (period) character 237 / (forward slash) character 237 / operator 187 : (colon) character 237 < operator 187 <= operator 187 <> operator 187 = operator 187 > operator 187 >= operator 187 ? (question mark) character 51, 179 [ ] (square brackets) characters 45, 51 \ (backslash) characters 81, 166 ^ operator 187 _ (underscore) character 81, 166 operator 187 (single quotation mark) character 51 home page 246 ODA sample data source 215 report templates 6 reports 194 repository items 248 web applications 247 aciportal.jar 219 action element 224 action sets 225, 226, 230 actions 218, 224, 225, 237 actionSet element 224 actionSets element 224 Actuate Deployment Kit displaying information about 240 Actuate Viewer 12 Add Data Field link 49 Add Group button 58, 59 Add Join Condition dialog box 142 Add Section button 63 ADD_DAY function 50, 146 ADD_HOUR function 147 ADD_MINUTE function 147 ADD_MONTH function 147 ADD_QUARTER function 148 ADD_SECOND function 148 ADD_WEEK function 149 ADD_YEAR function 149 adding aggregate data 67 borders 39 charts 63, 96, 97 column headers 17, 37 computed columns 44, 46 data fields 10, 39, 48 data groups 56, 58, 59 filter conditions 74, 78, 82, 85 formatting rules 27, 29, 32 images 202, 206 labels 17 multiple fields 49 page breaks 72 report elements to libraries 208 report elements to templates 200, 202, 204
Numerics
2D With Depth setting 130
A
about page 238, 240 ABS function 146 absolute paths 206 absolute values 146 access privileges. See privileges accessing BIRT Report Studio 4, 194, 196 BIRT Report Studio functionality 16, 224 calendar 80 chart editor 97 data 214, 221
Index
257
report items 16 report sections 61, 63 tables 9 addresses 34 administrators 4 Advanced Filter dialog box changing conditions and 87 comparing values and 81 creating filters and 77 defining multiple conditions and 83 removing conditions and 87 Advanced Sort command 55 Advanced Sort dialog box 55, 56 AdvancedSort action 228 After property 72 ageDays parameter 245 ageHours parameter 245 aggregate data calculating values for 67 creating charts and 94 displaying 66, 67 aggregate functions 67, 68 See also specific function aggregating data 6669 Aggregation action 225 Aggregation button 68 Aggregation dialog box 68 AlignCenter action 227 aligning text 20, 33 AlignLeft action 227 alignment options 20 AlignRight action 227 AND operator 85, 188 Any Of operator 78, 89, 188 applications 195, 216, 232 accessing 247 applyFilter parameter 248 area charts 98, 111 See also charts ascending sort order 55 asterisk (*) character 179 authentication issuing URIs and 239 author names 17 Auto Expand Width setting 40 Available Data options 9, 10 AVERAGE function 67, 150
averages 150, 170 axes values. See category series; value series
B
backslash (\) character 81, 166 banner displaying 241 banner page 238, 241 bar charts 98, 100, 111 See also charts bar stick chart subtypes 108 Before property 72 BETWEEN function 150 Between operator 188 binary files 236 BIRT Report Designer Professional 196, 200 BIRT Report Studio accessing 194, 196 accessing functionality of 16, 224 configuring 232 creating custom data sources for 214, 220, 221 customizing 195, 196, 224, 228 designing reports and 4 disabling actions for 225, 230 enabling ODA drivers for 217 logging in to 237 starting 4, 236 updating changes to 197 BIRT Report Studio servlet 236 BIRT reports 250 BIRT reports. See reports BIRT servlet 250 BIRT_RESOURCE_PATH parameter 232 BIRT_SCRIPT_LIB_PATH parameter 232 BizRDRptTemplates folder 211 blank characters 45, 182, 183 blank values 79 Border action 227 Border command 39 Border dialog box 39 borders 39 Bottom N operator 80, 188 Bottom Percent operator 80, 188 breadcrumbs 246 browse file page 238, 242
258
browsing 242 Business reports. See reports BusinessReport Studio link 246 BusinessReport Studio pages 246
C
calculated columns. See computed columns calculated data 146 Calculation action 225 Calculation dialog box 46 calculations 44, 45, 46, 67 calculations action set 225 calendar 30, 80 candlestick chart subtypes 107 capitalization 25, 183 cascading style sheets. See styles case 25, 167, 183 case sensitivity 238 field names 45 pattern matching 166 servlet names 236 categories (templates) 6, 210, 211, 212 Category (X) Axis Title option 129 category series 109, 132, 133 See also data series; charts category series values. See x-axis values CEILING function 151 changing actions 225 column headers 17 configurations 197 data 27 filter conditions 87 font properties 20 grouping order 60 information objects 143 page layouts 40 reports 11, 16, 32 servlets 236 text 17, 25, 126 text alignment 20 character formats. See string formats character strings. See strings; substrings characters calculating data values and 50 counting 165
entering URLs and 237 finding matching 80, 166, 179 formatting string values and 25, 26 referencing data fields and 45, 51 removing leading or trailing 45, 182, 183 Chart action 225 chart editor 97 Chart icon 97 chart reports 95, 136 Chart Size options 127, 128 chart subtypes. See specific subtype Chart Title placeholder 129 chart titles 126, 129 chart types 98, 109 charts adding 63, 96, 97 controlling range of values for 134 creating 94, 95, 109 displaying scientific or statistical data and 106 displaying series values in 109, 125, 133 displaying small sets of values and 105 formatting 126, 129, 132 overlapping series in 99, 103 previewing 127 removing legends in 131 repositioning legends in 131 resizing 127128 selecting data for 108 setting dimensions for 130 showing percentages in 99, 101, 104 showing relationships in 106 showing side-by-side series in 100 stacking series in 99, 101, 104 tracking stock data and 107 viewing 136 class files 219 classes 219, 220 ClassicModelQueryBuilder.jsp 217 ClassicModels database 214, 216 classpaths 219 closing values 107, 108 See also stock charts code 216, 217 colon (:) character 237 colors 17, 32 column header rows 37
Index
259
column headers See also column names adding borders to 39 adding to tables 17, 37 aligning text in 20 changing 17 changing font properties for 20 creating 11, 46 merging 35, 36, 38 column names 64 See also field names Column Properties dialog box 42 Column Width command 42 ColumnHeaderOperations action set 226 ColumnOperations action set 226 columns See also computed columns; fields adjusting widths automatically 41 aggregating values in 66 aligning text in 20 comparing values between 31, 81 creating charts and 109 creating report sections and 63 creating reports and 11 filtering on 75, 80, 82 formatting data in 21, 23, 25, 27 formatting with conditions 27, 29, 32 grouping by 59, 60 inserting data fields and 39 merging 34, 36 removing report sections and 65 reordering 33 resizing 39, 41, 42 selecting 18 sorting on 55 spanning text across multiple 38 viewing numeric values in 21 ColumnWidth action 226 comma-separated values files 221 comparison operators 29, 78, 142 comparisons conditional formats and 29, 30 date-and-time values 80 filter conditions and 76 plotting data and 98 string patterns 80 values in multiple columns 81
compilers 219 compiling servlet classes 219 computed columns adding to designs 44, 46 calculating values for 187 creating 44, 46, 146 concatenating string values 49 conditional expressions 50, 159 conditional formats 2732 conditional formatting 188 Conditional Formatting command 27 Conditional Formatting dialog box comparing values and 30, 31 formatting data and 27, 29 ConditionalFormat action 227 conditions calculating values and 50, 159 filtering data and. See filter conditions formatting data and 29, 30, 32 joining information objects and 142 confidentiality statements 17 configuration files 197 configuration parameters 232 configurations accessing text file data and 221 changing 197 changing servlets and 236 changing user actions and 225 customizing BIRT Report Studio and 197, 224, 228 customizing data sources and 214, 220 registering servlets and 219 running BIRT Report Studio and 196, 232 specifying default template category and 212 connecting to ClassicModels sample database 216 data sources 218 connection definitions 218 connection information. See connection properties context menus 18, 224, 225 context roots 196 cookies 239 copyright statements 17, 205 COUNT function 67, 152 COUNTDISTINCT function 152
260
Create Template Report Item command 204 CreateSection action 227 creating aggregate data 67 charts 94, 95, 109 column headers 11, 46 computed columns 44, 46, 146 custom data sources 214221 custom query builders 217220 data filters 74, 75, 77, 82 data groups 56, 58, 59 expressions 4951 formatting rules 27, 29, 32 libraries 207 multi-line column headers 37 multi-line data fields 34 ODA drivers 216 prompts 88, 89 report sections 61, 63 report templates 200, 203207 reports 4, 5, 69, 214 resource folders 208 servlets 217 template categories 211 themes 201, 207210 criteria. See conditions CSV files 221 Currency format 22 current date and time 171, 181 custom templates 6 customizing applications 195 BIRT Report Studio 4, 195, 196, 224, 228 data formats 22, 24, 26 data sources 214221 query builder 217220 reports 16 styles 207, 208
D
dashboards 105 data See also values accessing 214, 221 aggregating 6669 changing 27
creating information objects for 138, 144 displaying 12, 98 filtering 74, 79, 80, 87 formatting 21, 23, 25, 27 grouping 56, 59, 60 hiding 69, 70, 71, 136 including in templates 200, 204 laying out 9 plotting 94, 95, 98, 108 previewing 4 redisplaying hidden 71 restoring presorted state 56 retrieving 7, 138, 217 selecting 10, 18, 19 sorting 54, 55, 57 Data action 227 data connection definitions 218 Data dialog box 8 data elements 200 data fields See also columns adding 10, 39, 48 calculating values in 44, 45 changing headers for 17 counting unique values in 152 creating multi-line 34 creating report sections and 64 creating unique values for 47 displaying 9, 48 joining information objects and 138, 142, 143, 144 naming. See field names referencing 45, 51 returning first value in 80, 158 returning highest value in 162, 163, 167 returning last value in 80, 164 returning lowest value in 160, 161, 168 returning median values in 168 testing for null values in 162 Data Fields action 226 Data Fields command 48 Data Fields dialog box 48 data filters applying 76, 88 comparing date-and-time values and 80 comparing string patterns and 80
Index
261
comparing values in multiple columns and 81 creating 74, 75, 77, 82 displaying top or bottom values and 80 excluding null or blank values and 79 excluding sets of values and 78, 85 prompting for 87, 88, 89 selecting multiple values for 78 setting evaluation order for 85 specifying conditions for. See filter conditions data groups. See groups data point markers 125 data points 106 data rows applying conditional formats and 32 calculating running totals for 178 counting 152 displaying 11 filtering blank values in 79 limiting number of 74, 83, 85 removing duplicate values from 57 returning unique values for 59, 63 selecting 19, 74 viewing null values in 79 data sections. See sections data series adding 108 displaying in multiple dials 105 displaying relationship between 106 displaying relationship to whole 106 displaying values of 125 labeling 132, 133 overlapping multiple 99, 103 rotating 132 scaling 134 showing distinct values for 105 showing high and low values 107, 108 showing open and close values 107, 108 showing percentage of whole 99, 101, 104 showing side-by-side comparisons of 100 stacking multiple 99, 101, 104 tracking single values and 105 Data Set dialog box 48 data set extensions 218, 221 data sets building templates and 204
calculating values for 44, 45 displaying charts and 98 displaying fields in 48 extracting values from 47 filtering data and 74, 77 retrieving from text files 221 selecting 7, 204 sorting data and 54 synchronizing 144 Data Source dialog box 220 data source extensions 218, 221 data sources accessing sample ODA 215, 216 configuring 220 connecting to 218 creating reports and 214 creating templates and 204 customizing 214221 naming 220 restoring default formats from 33 selecting 7, 221 viewing available fields in 9, 48 data types 21, 67, 142 databases 214 datasetExtensionId element 221 datasourceExtensionId element 221 data-sources element 221 date values adding days to 50, 146 adding months to 147 adding quarters to 148 adding time values to 147, 148 adding weeks to 149 adding years to 149 aggregating 67 calculating days between 50, 153 calculating months between 155 calculating quarters between 155 calculating time values between 154, 156 calculating weeks between 156 calculating years between 157 comparing 30 entering in expressions 50 filtering 80 formatting 23, 24 grouping 59 returning current 171, 181
262
returning month for 170 returning quarter in 173 returning weekdays for 153, 184 returning weeks for 184 returning year for 185 selecting 80 Date/Time Column Format dialog box 23 date-and-time formats 23, 24, 33 DAY function 153 days adding to date values 50, 146 calculating number of 50, 153 returning number in month 153 returning specific 184 default banner 241 default context root 196 default sort order 54 default template category 211 default themes 208 DEFAULT_DATA_CACHE_ROW_COUNT parameter 232 DEFAULT_REPORT_TEMPLATE_ CATEGORY_NAME parameter 212, 232 delete file status page 238, 242 Delete Group button 61 Delete Section button 65 DeleteColumn action 226 DeleteColumn action set 226 DeleteRow action 226 DeleteSection action 227 deleting blank characters 45, 182, 183 data groups 61 duplicate values 57 files 242, 243 filter conditions 87 folders 243 legends 131 report items 16 report sections 65 deploying query builder servlet 219 descending sort order 55 description element 220 Description property 204 design files 11 design tools 224 designing
report templates 200, 203 reports 9, 16, 224 designs See also page layouts adding page breaks to 72 adding sections to 61, 63, 64 applying themes to 18 displaying charts and 95, 98, 127 displaying data rows in 11 grouping data in 57, 58, 59, 60 hiding detail data in 69, 70, 71 including calculations in 44, 46 opening 237 redisplaying detail data in 71 removing groups from 61 removing sections from 65 saving as templates 203 selecting data for 10 selecting templates and 9 detail data 69, 70 detail pages 238, 242 detail rows 62, 70, 227 developing custom data sources 214 custom query builders 217220 ODA data drivers 216 dials 105 See also meter charts DIFF_DAY function 50, 153 DIFF_HOUR function 154 DIFF_MINUTE function 154 DIFF_MONTH function 155 DIFF_QUARTER function 155 DIFF_SECOND function 156 DIFF_WEEK function 156 DIFF_YEAR function 157 Dimension option 130 directories 221 directory paths image files 206 Information Console JSPs 196 report templates 204 script libraries 232 shared resources 232 Display Name property 204 display names 202, 220 displaying
Index
263
banners 241 calculated values 44, 47, 146 charts 136 data 12, 98 data fields 9, 48 data rows 11 date-and-time values 23, 59 distinct values 105 error messages 244 filter conditions 83 libraries 210 numeric values 21 prompts 88 report elements 202, 208 report items 16 report parameters 249 report templates 6, 202, 210 reports 40, 71 string values 25 summary values 66, 67, 94 themes 18 unique values 59, 63 displayName element 220 distinct values 105 See also unique values division 169 do directive 238 document files 243, 249 documentation ix double quotation mark (") character 50 drag-and-drop operations 33, 42 drivers 216 drop pages 238, 243 duplicate values 57, 105
enabledInWorkgroupMode element 214, 221 Encyclopedia volumes 239 entryPoint element 221 Equal to operator 188 erni_config.xml 220, 224 error detail page 242 error messages 244, 249 error page 238, 244 exclamation point (!) character 26 executable files 249 executableName parameter 245 execute report page 238, 245 executing reports 12 exporting reports 40 expressions adding functions to 47 adding reserved characters to 50 calculating data values and 44, 46, 49, 187 creating 4951 displaying unique values and 47 filtering data and 74, 78, 82, 188 formatting data and 29, 30, 32, 188 validating 47 extension IDs 218, 221
F
features 16, 224 field names 11, 45, 51 See also column headers; column names fields See also columns adding 10, 39, 48 calculating values in 44, 45 changing headers for 17 counting unique values in 152 creating multi-line 34 creating report sections and 64 creating unique values for 47 displaying 9, 48 joining information objects and 138, 142, 143, 144 referencing 45, 51 returning first value in 80, 158 returning highest value in 162, 163, 167 returning last value in 80, 164 returning lowest value in 160, 161, 168
E
editable report elements 202, 203, 204 editable report items 16, 17, 18 EditCalculation action 226 editing. See changing EditText action 226 EditText action set 226 empty values 79 See also null values enabled element 225 enabledInEnterpriseMode element 221
264
returning median values in 168 testing for null values in 162 file and folder index page 247 file and folder list page 248 file names 11 file or folder detail page 243 file or folder drop page 243 FileOperations action set 226 files 236 accessing 248 deleting 242, 243 filtering 248 getting information about 243 See also specific type Filter action 226 Filter button 75, 77 filter conditions adding 74, 78 changing 87 defining multiple 82, 83, 85 deleting 87 grouping 85 viewing 83 Filter dialog box 75, 88, 89 filter expressions 74, 78, 82, 188 Filter Pane 77 filter parameter 248 filtering report documents 248 report files 248 filtering data 74, 79, 80, 87 filtering options 74 filters applying 76, 88 comparing date-and-time values and 80 comparing string patterns and 80 comparing values in multiple columns and 81 creating 74, 75, 77, 82 displaying top or bottom values and 80 excluding null or blank values and 79 excluding sets of values and 78, 85 prompting for 87, 88, 89 selecting multiple values for 78 setting evaluation order for 85 specifying conditions for. See filter conditions
FIND function 158 FIRST function 158 Fixed format 22 Fixed Width setting 40 folder detail page 243 folder drop page 243 folder index page 247 folder list page 248 folder names 238 folder parameter 249 folders accessing 248 browsing contents 242 copying ODA driver files to 217 creating resource 208 deleting 243 deploying class files to 219 getting information about 243 linking to 246 publishing resource files to 212 publishing templates to 211 saving reports to 11 viewing library files in 210 Font action 227 font attributes. See font properties Font button 20 Font dialog box 20 font properties 20, 32, 129 fonts 17 footers. See group footers Format Chart dialog box formatting chart titles and 129 formatting charts and 126 repositioning legends and 131 resizing charts and 127, 128 rotating labels and 132 scaling y-axis values and 134 setting dimension options and 130 setting x-axis label intervals and 133 staggering x-axis labels and 133 Format Data button 21, 23, 25 format patterns 22, 24, 26 format symbols 22, 24, 26 formats adding column header rows and 37 applying with conditions 2732 changing page layouts and 40
Index
265
customizing 22, 24, 26 displaying data and 21, 23, 25, 224 resizing charts and 127 reverting to default 32 selecting 22, 23, 26 formatting charts 126, 129, 132 data 21, 23, 25, 27 report items 18, 201 text 25 Formatting action set 227 formatting options 22, 126, 201 formatting rules 27, 29, 32 forward slash (/) character 237 functionality options. See features; functionality levels functions 45, 47, 67, 146 See also specific function
redisplaying detail data in 71 returning highest values in 162, 163, 167 returning lowest values in 160, 161, 168 returning median values in 168 starting on new page 71, 72 GUIs. See graphical user interfaces
H
headers. See column headers; group headers headings. See section headings Help action 227 Help action set 227 Hide Detail command 70, 71 Hide Table command 136 HideDetail action 227 hiding data 69, 70, 71, 136 home folders 11, 246 home page 238, 246 HOME property 221 horizontal bar charts 102 hours adding to date values 147 calculating number of 154 HTTPServlet class 217
G
General Number format 22 generating images 206 graphical user interfaces 4, 197 See also BIRT Report Studio graphs. See charts Greater Than operator 188 Greater Than or Equal to operator 188 Group Details dialog box 59 group footers 68 group headers 68 GroupBy action 227 grouping data 56, 59, 60 report templates 6 Grouping action set 227 grouping intervals 59 grouping options 59 grouping order 60 groups adding report sections and 61, 63 aggregating data and 66, 68 changing order of 60 counting number of rows in 152 creating 56, 58, 59 deleting 61 hiding detail data in 69, 70
I
ID parameter 244 IF function 50, 159 image files 206, 212 images 202, 204, 205 IN function 160 index pages 247 inedit parameter 218 Information Console 194, 195, 196, 217 information object files 8 information objects adding to designs 143 building templates and 200 changing 143 joining 138, 139 removing data fields in 143, 144 retrieving data and 138 selecting 8, 140, 203 specifying as data source 8 updating data for 144 viewing available fields in 9
266
input 87, 88, 89 Insert Row Above command 37 Insert Row Below command 37 InsertRow action 226 installations 196, 197 invokeSubmit parameter 245 .iob files 8 iportal context root 196 Is Blank operator 79, 188 Is False operator 188 Is Not Blank operator 189 Is Not Null operator 79, 189 Is Null operator 79, 189 Is True operator 189 ISBOTTOMN function 160 ISBOTTOMNPERCENT function 161 iServer 194 iServer Express 194 ISNULL function 162 ISTOPN function 162 ISTOPNPERCENT function 163
J
Jakarta Struts action mapping 238 JAR files 219 Java servlets. See servlets javac compiler 219 JDBC drivers 216 jobs 249 join conditions 141 Join dialog box 140 joins 138, 139 JSPs 196, 217 mapping actions to 238 naming 238
L
Label Font option 129 labels aligning text in 20 changing font properties for 20, 129 displaying aggregate data and 68 displaying by interval 133 editing 17, 126 rotating 132 staggering 133
LAST function 164 laying out data 9 Layout Preference property 41 layouts. See page layouts leading characters 45, 182 LEFT function 165 legends 129, 131 LEN function 165 Less Than operator 189 Less Than or Equal to operator 189 libraries 201, 207, 208, 232 Library command 207 library files 212 LIKE function 166 Like operator 81, 189 line charts 98, 103, 111 See also charts linking to folders 246 links 241, 246 list pages 248 listing reports 9, 66 lists 249 displaying data and 56, 74 prompting for values and 89, 90 selecting values from 30, 78 testing for values in 160 literal characters 81, 166 literal values 29, 30, 49, 50 locale parameter 239 locales filtering date-and-time values and 80 formatting data and 21, 23, 24 selecting templates and 203, 212 specifying current 239 logging in to BIRT Report Studio 237 logical operators 85 login information 4 LOWER function 167 lowercase characters 26, 167 Lowercase format 26
M
Manage Thumbnail dialog box 206 Management Console 196 margins 41 matching character patterns 80, 166, 179
Index
267
mathematical operations 45, 50, 67 MAX function 67, 167 MAX_BRSTUDIO_DESIGN_SESSION parameter 233 MAX_BRSTUDIO_USER_SESSION parameter 233 MAX_DATA_CACHE_ROW_COUNT parameter 233 MAX_NUMBER_OF_VALUES_FOR_ DYNAMIC_PARAMETER parameter 233 maximum values 167 MEDIAN function 168 median values 168 MEMORY_DATA_CACHE_ROW_COUNT parameter 233 menus 18, 224, 225 Merge action 226 Merge Columns command 36 Merge Right command 38 Merge Up command 36 MergeColumns action 226 merging column headers 35, 36, 38 columns 34, 36 messages 203 meter charts 105, 118 See also charts methods 218 See also functions Microsoft Word documents. See Word documents MIN function 67, 168 minimum values 168 minutes adding to date values 147 calculating number of 154 missing values 79 MOD function 169 modulus 169 MONTH function 170 months adding to date values 147 calculating number of 155 returning 170 MORE_VALUE_ROW_COUNT parameter 233 moving through reports 58
MOVINGAVERAGE function 170 multi-column groups 60 multi-line column headers 37 multi-line data fields 34 multi-page reports 58, 69, 71 My Folder link 246
N
name element 220 name parameter 243, 244 Name property 205 names adding report sections and 64 containing reserved characters 51 creating computed columns and 46 labeling aggregate values and 68 predefining styles and 207 referencing field 45, 51 naming data sources 220 JSPs 238 report elements 202, 205 report templates 204 servlets 220, 236 naming restrictions 238 naming restrictions. See case sensitivity navigating reports 58 New action 226 New Computed Column button 46 New Library wizard 207 new pages 71, 72 New Style command 208 New Style wizard 208 New Template wizard 204 New Theme wizard 208 non-editable report elements 202, 205 non-editable report items 16, 17 non-null values 171 See also values NoRepeat action 226 Not Between operator 189 Not Equal to operator 189 Not keyword 85 Not Like operator 189 NOTNULL function 171 NOW function 171
268
null values 79, 162 Number Column Format dialog box 21 number formats 21, 22, 33 numeric values aggregating 67, 181 averaging 150, 170 calculating quartile of 174 calculating running totals for 178 calculating square root of 180 calculating standard deviation for 180 calculating variance of 183 calculating weighted average for 185 displaying 21 dividing 169, 174 entering in expressions 50 returning absolute 146 returning first 158 returning highest 162, 163 returning last 164 returning lowest 160, 161 returning median 168 returning percentile rank of 172 returning percentile value of 171 rounding 151, 176, 177, 178
optional values 89 OR operator 85, 188 orientation (page layouts) 41 Outline view 208 output changing page layouts and 40 resizing charts and 127 testing data filters and 76 output formats 40 outputDocName parameter 245 overlay chart subtypes 99, 103
P
Page Break command 72 page breaks 72 page layouts See also designs changing 40 resizing charts and 127 selecting templates and 9, 16 page names 238 page not found messages 248, 249 page not found page 238, 249 page orientation 41 Page Setup options 41 page size options 41 page-based output formats 40 PageBreak action 227 PageLayout action set 227 PageLayoutInToolbar action 227 paper size settings 41 Parameter action 226 Parameter button 88 parameters adding to URIs 239 creating custom data sources and 218 customizing BIRT Report Studio and 232 displaying 249 executing reports and 246 prompting for input and 87, 89 running BIRT Report Studio servlet and 236 Parameters dialog box 88 parameters list 249 parameters page 238, 249 paths
O
objectID parameter 243 ODA data sources 214, 218, 220 ODA drivers 216 ODA framework 216 ODA session IDs 218 odaconfig element 220 OdaOverview.htm 216 OdaSample data source 214, 216, 220 online reports 40 onlyLatest parameter 249 Open action 226 open data access. See ODA data sources; ODA drivers opening BIRT Report Studio 4 report designs 237 opening values 107, 108 See also stock charts operators 29, 76, 187 See also specific type
Index
269
home folders 246 image files 206 Information Console JSPs 196 report templates 204 script libraries 232 shared resources 232 pattern matching 80, 166, 179 PDF documents 40 percent (%) character 81, 166 Percent format 22 percent stacked chart subtypes 99, 101, 104 percentages 50, 98, 171, 172, 173 PERCENTILE function 171 PERCENTRANK function 172 PERCENTSUM function 173 performance 74 period (.) character 237 pie charts 98, 106, 114 See also charts Place Library in Resource Folder command 209 pop-up menus. See context menus predefined style names 207 predefined styles 208 predefined themes 201 presentations 200 Preview action set 228 PreviewHTML action 228 previewing charts 127 data 4 reports 11, 40 printing reports 40 priority parameter 245 priorityValue parameter 246 privileges saving reports and 11 selecting templates and 6 progressive parameter 246 prompting for input 87, 88, 89 prompts, testing 88 properties applying styles and 207, 208 changing font 20 creating templates and 202, 204 formatting charts and 129 reverting to default 32
Q
QUARTER function 173 quarters 148, 155, 173 QUARTILE function 174 queries 218 query builder 214, 217220, 221 question mark (?) character 51, 179
R
range of values 150, 175 RANK function 175 redirect parameter 244 Redo action 228 referencing data fields 45, 51 refreshing user interfaces 197 registering servlets 219 relative paths 204 remainders 169 removing. See deleting renaming themes 208 Reorder Columns command 33, 60 Re-order Columns dialog box 33 Reorder Columns dialog box 60 ReorderColumns action 226 repeated values. See duplicate values RepeatValues action 226 report design files 11 report design tools 224 report designs See also page layouts adding page breaks to 72 adding sections to 61, 63, 64 applying themes to 18 displaying charts and 95, 98, 127 displaying data rows in 11 grouping data in 57, 58, 59, 60 hiding detail data in 69, 70, 71 including calculations in 44, 46 opening 237 redisplaying detail data in 71 removing groups from 61 removing sections from 65
270
saving as templates 203 selecting data for 10 selecting templates and 9 report document files 243, 249 report elements adding to libraries 208 adding to templates 200, 202, 204 applying styles to 208 displaying 202 naming 202, 205 report executable files 249 report files accessing 248 deleting 242, 243 filtering 248 getting information about 243 See also specific type report items See also report elements deleting 16 displaying 16 formatting 18, 201 including in designs 16 including in templates 204 selecting 16, 18 Report Items list 16, 202 report parameters 87, 89, 249 report section headings 63, 64 report sections adding charts to 97 creating 61, 63 deleting 65 displaying summary data in 66, 96 hiding detail data in 69, 71 organizing data and 61, 63 redisplaying detail data in 71 starting on new page 71, 72 report template categories 6, 210, 211, 212 Report Template dialog box 6, 212 report template files 203, 211 Report Template page. See Report Template dialog box report templates accessing 6 accessing resources for 212 adding images to 206 adding report elements to 200, 202, 204
adding themes to 17, 18, 201, 207 associating libraries with 208 changing styles in 201 choosing data sources and 7 creating 200, 203207 designing reports and 9, 16, 200, 201 displaying 202, 210 grouping 6 localizing 203, 212 naming 204 overriding formats in 32 providing descriptions for 204 publishing 210212 selecting 6 setting properties for 202, 204 specifying default category for 212 viewing descriptions of 7 report titles 17 report viewers 12 reports accessing 194 changing 11, 16, 32 controlling content of 87 creating 4, 5, 69, 214 customizing 16 designing 9, 16, 224 developing custom data sources for 214 221 displaying 40, 71 entering descriptions for 11 filtering 248 generating table of contents for 58 moving through 58 organizing data in 54, 56, 61 previewing 11, 40 running 12, 245 saving 11, 12 selecting data sources for 7 setting page breaks for 72 standardizing 201 structuring 6, 200, 201 submitting requests for 245 viewing charts in 95, 136 viewing structure of 9 repositories 11, 236 accessing items in 248 getting information about 242
Index
271
See also Encyclopedia volumes repositoryType parameter 236 requests 218 submitting 245 reserved characters 50 reserved parameters 246 resetFilter parameter 249 resizing charts 127128 columns 39, 41, 42 resource folders 208, 212 resources accessing shared 232 publishing 212 RIGHT function 176 right-click menus. See context menus roles 144 Rotate Labels option 132 ROUND function 176 ROUNDDOWN function 177 rounding 151, 176, 177, 178 ROUNDUP function 178 rows applying conditional formats and 32 calculating running totals for 178 counting 152 creating multi-line column headers and 37 displaying 11 filtering blank values in 79 limiting number of 74, 83, 85 removing duplicate values from 57 returning unique values for 59, 63 selecting 19, 74 viewing null values in 79 .rptdesign files 11 .rpttemplate files 203 rules 27, 29, 32 running reports 245 running reports 12 running totals 178 RUNNINGSUM function 178 run-time interfaces 216
S
sample data 4
sample ODA data source 214, 216, 220 sample query builder 217 sample servlet 217, 219 sample templates 6 SampleServlet.class servlet 219 SampleServlet.java 217 Save action 226 Save Report Design dialog box 11, 12 SaveAs action 227 saving report designs 203 reports 11, 12 scaling options (charts) 134 scatter charts 98, 106, 121 See also charts Scientific format 22 script libraries 232 SEARCH function 179 search results 233 SEARCH_ENABLE_COLUMN_HEADERS parameter 233 SEARCH_USE_QUOTE_DELIMITER parameter 233 seconds adding to date values 148 calculating number of 156 section headings 63, 64 SectionHeading action 228 SectionOperations action set 228 sections adding charts to 97 creating 61, 63 deleting 65 displaying summary data in 66, 96 hiding detail data in 69, 71 organizing data and 61, 63 redisplaying detail data in 71 starting on new page 71, 72 sectors 106 See also pie charts security roles 144 Select Information Object dialog box 8 Select Information Objects dialog box 140 selection parameter 218 series adding 108 displaying in multiple dials 105
272
displaying relationship between 106 displaying relationship to whole 106 displaying values of 125 labeling 132, 133 overlapping multiple 99, 103 rotating 132 scaling 134 showing distinct values for 105 showing high and low values 107, 108 showing open and close values 107, 108 showing percentage of whole 99, 101, 104 showing side-by-side comparisons of 100 stacking multiple 99, 101, 104 tracking single values and 105 serverURL parameter 239, 246 servlet classes 219 servlet element 220 servlet names 220, 236 servlet.jar 219 servlet-mapping element 220 servlets creating query builder and 217220 running BIRT Report Studio and 236 session IDs 218 sessionId parameter 218 sessions 233 shared resources 232 shortcut menus. See context menus Show All command 136 Show Detail command 71 ShowDetail action 227 showDocument parameter 249 showExecutables parameter 249 showFolders parameter 249 side-by-side chart subtypes 100 single quotation mark () character 51 software 196 Sort Ascending button 55 Sort Descending button 55 sort order 54, 55 SortAscending action 228 SortDescending action 228 Sorting action set 228 sorting data 54, 55, 57 sorting options 55 source code 216, 217 space characters 237
special characters 81, 166, 179 Split action 226 SQRT function 180 square brackets ([ ]) characters 45, 51 square root 180 stacked chart subtypes 99, 101, 104 Stagger Labels option 133 standard chart subtypes 105 standard deviation 180 standard formats 22, 23, 26 starting BIRT Report Studio 4, 236 startUpMessage parameter 248 state parameter 218 static text 17 STDEV function 180 stock charts 107, 124 See also charts String Column Format dialog box 25 string formats 25, 26, 33 string functions 67 string patterns 80, 166, 179 string values 239 strings calculating values and 49, 67 comparing 30, 80 concatenating 49 converting to lowercase 26, 167 converting to uppercase 26, 183 counting characters in 165 displaying values 25 filtering null and blank values in 79 finding substrings in 158, 179 matching characters in 166 missing values in 79 referencing data fields and 45, 51 removing blank characters in 45, 182, 183 returning length of 165 returning substrings in 165, 176 Struts action mapping 238 styles 16, 201, 207, 208 subpage parameter 248 substrings extracting 165, 176 finding location of 158, 179 SUM function 67, 181 summary data 66, 67, 94 summary reports 69
Index
273
superimposed chart subtypes 105 Synchronize Data Sets button 144 synchronizing data sets 144 system administrators 4
T
table elements 203 table of contents 58 tables adding column headers to 17, 37 adding data fields to 10, 39, 48 adding to designs 9 changing data groups in 60 counting rows in 152 creating charts and 95, 97, 136 deleting data groups in 61 displaying summary data in 66, 67 filtering data in 74, 75 formatting items in 18 grouping data for 56, 59, 60 merging columns in 34, 36 reordering columns in 33 resizing charts in 127 resizing columns in 39, 41, 42 restoring presorted state 56 returning highest values in 162, 163, 167 returning lowest values in 160, 161, 168 returning median values in 168 sorting data in 54, 55, 57 tabular report types 9 template categories 6, 210, 211, 212 Template command 204 template error pages 242 template files 203, 211 Template Image property 204 template selection dialog box. See Report Template dialog box templates accessing 6 accessing resources for 212 adding images to 206 adding report elements to 200, 202, 204 adding themes to 17, 18, 201, 207 associating libraries with 208 changing styles in 201 choosing data sources and 7
creating 200, 203207 designing reports and 9, 16, 200, 201 displaying 202, 210 grouping 6 localizing 203, 212 naming 204 overriding formats in 32 providing descriptions for 204 publishing 210212 selecting 6 setting properties for 202, 204 specifying default category for 212 viewing descriptions of 7 testing custom data sources 215 data filters 76 prompts 88 text aggregating values for 67 aligning 20, 33 changing 17, 25, 126 formatting 25 selecting templates and 203 setting font properties for 20 spanning multiple columns 38 text files 221 text formats. See string formats text strings. See strings; substrings themes adding to templates 17, 18, 201 applying 18 changing reports and 16 creating 201, 207210 re-applying default formats and 33 selecting 18, 201 Themes list 18, 208 thumbnail images 204, 205 time continuums 98 time intervals (groups) 59 time values adding to date values 147, 148 aggregating 67 calculating number of 154, 156 filtering 80 formatting 23, 24 grouping 59 returning current 171, 181
274
time zones 239 timezone parameter 239 Title Font option 129 titles 17, 126, 129 TODAY function 181 toolbars 18, 224, 225 ToolTips 125, 204 Top N operator 80, 189 Top Percent operator 80, 189 totals 45, 178, 181 See also summary data trailing characters 45, 182, 183 trends 94, 98 TRIM function 45, 182 TRIMLEFT function 182 TRIMRIGHT function 183 truncated strings 239 types. See data types
U
underscore (_) character 81, 166 Undo action 228 UndoRedo action set 228 UngroupBy action 227 unique values 47, 59, 63, 152 updating BIRT Report Studio 197 UPPER function 183 uppercase characters 26, 183 Uppercase format 26 URI parameters 236 URIs 236 adding parameters to 239 overview 237, 238 viewing BIRT reports and 250 URIs reference 239 URLs 4, 220, 221, 237 viewing BIRT reports and 250 Use Library dialog box 210 user actions. See actions user interfaces 4, 197 See also BIRT Report Studio users accessing home page 246
V
Value (Y) Axis Title option 129
value series 108, 134 See also data series; charts value series values. See y-axis values values See also data calculating 44, 45, 46, 67 comparing. See comparisons conditionally formatting 27, 32 counting unique 152 determining rank 175 displaying distinct 105 displaying top or bottom 80 displaying unique 59, 63 filtering empty or blank 79 filtering on multiple 78 prompting for 88 removing duplicate 57 returning highest 167 returning lowest 168 selecting 19, 30 showing over time 98 showing relationship to whole 98 showing trends in 94, 98 testing for non-null 171 testing if null 162 testing range of 150 VAR function 183 variance 183 version parameter 243 viewers 12 viewing banners 241 calculated values 44, 47, 146 charts 136 data 12, 98 data fields 9, 48 data rows 11 date-and-time values 23, 59 distinct values 105 error messages 244 filter conditions 83 libraries 210 numeric values 21 prompts 88 report elements 202, 208 report items 16 report parameters 249
Index
275
report templates 6, 202, 210 reports 40, 71 string values 25 summary values 66, 67, 94 themes 18 unique values 59, 63 visible attribute 230 visible element 225 visual report elements 200 volume parameter 239
Y
Y Axis Title placeholder 129 y-axis labels 129 y-axis titles 126, 129 y-axis values 109, 134 See also value series YEAR function 185 years adding to date values 149 calculating number of 157 returning 185
W
wait parameter 246 web applications 195, 232 See also applications web browsers 4, 196, 236, 237 issuing URIs and 239 web pages creating banners for 241 web resources 232 web.xml 212, 219 WEEK function 184 WEEKDAY function 184 weekdays adding to date values 50, 146 calculating number of 153 returning number in month 153 returning specific 184 weeks adding to date values 149 calculating number of 156 returning 184 WEIGHTEDAVERAGE function 185 whitespace characters 237 wildcard characters 81, 166, 179 Word documents 40 workingFolder parameter 242
X
X Axis Title placeholder 129 x-axis labels 126, 129, 132, 133 x-axis titles 126, 129 x-axis values 109, 132, 133 See also category series XML files 221
276