Chapter 4. Designing Reports & Charts

4.1. Report Designer

4.1.1. Introduction to Report Designer

The Report Designer is a graphical user interface launched within the Organizer that allows users to create and customize reports. The simple drag and drop style interface and extensive editing/formatting capabilities makes the report design quick and easy.

4.1.1.1. Starting Report Designer

The Report Designer interface is always loaded from within the Organizer. To start a new report, you can click the Report Designer button on the toolbar or select Report Designer from the View menu. You can also start Report Designer when creating or editing data sources in the registry. The View button allows you to preview a data source and select to build a chart or report. In addition, you can open the Report Designer to edit a report template file in the Organizer. To do this, first select the file that you would like to open, then select Open File from the File menu, or press Ctrl+O. You can also right click on the file and then select Open File from the pop-up menu, or simply double click the file.

4.1.1.2. Selecting a Data Source

The first step in designing a report is to select the data source from which the report is to be drawn. The first time you select to start a new report you will be prompted to select the data registry that you would like to use. If there are not currently any available registries (meaning that you have not created any or you do not have privileges to view any), you will be prompted to go the Data Registry Manager to create one. For more on data sources, please see Section 3.1 - Data in Organizer.

Once you have selected a registry, the Data Source Manager window will open allowing you to select, add, or modify a data source that you would like to use for the chart or report. Note that the registry will not open if you are building a report from the registry in the Modify Data Sources dialogs.

Data Source Manager Window for Report Designer

To use a particular data source, select the query, XML query, text file, data view, or data view query that you would like to use, and click the NEXT button. With the exception of data views, which will require you to select fields and set conditions first, the next screen will present the first twenty records from the data source. From this screen you can see all of the records returned by the selected source, by checking the Show All Records box.

4.1.2. Report Types and Data Mapping

ReportDesigner supports five basic report types: simple columnar, summary break, crosstab, master & details, and mailing label. Each report type has slightly different mapping options and can be used to generate a different style of report.

4.1.2.1. Simple Columnar Report

The simple columnar report is the most basic report type supported by ReportDesigner. It displays columnar data in a single table without any grouping or breaks.

Simple Columnar Report

4.1.2.1.1. Data Mapping

The first step in data mapping for this type is to select the columns you want to include in your report from the Set Report Mapping window in the Report Wizard. The left side of the window lists all available columns from your query or data file and the right side lists columns that will be added to the report. Click on a column name to select it (Shift+Click for multiple selections) and press the ADD or REMOVE buttons to add it or to remove it from the report. The order in which you select columns in this window is the order in which they will appear in your report. You can change the order of the selected columns by highlighting the column you want to move and clicking the UP or DOWN buttons. Fields can also be moved by clicking and dragging the selected field.

The second step for report mapping is to set the column options. For simple columnar reports there is only one available option. The window displays a table showing all the columns you have selected for the report and all available options. The first field displays column names, the second one displays data type, and the third one displays a check box called Visible. Checking or un-checking this box will make the column visible or invisible within the body of the report (All columns are visible by default).

Click to view larger image

Simple Columnar Report Mapping

4.1.2.1.1.1. Top N Report

You can also create a Top N report using the columnar format. A Top N report will order and show you the highest set of values based on a particular column in the report. For example, you want to show top five customers based on total sales. To do this, check the Top N Report checkbox at the bottom of the data mapping window. You can then specify which column you want to use as the measure (for the above example, it would be total sales column), the number you want to retrieve (i.e. 10 or 20, etc), and whether you want to show the columns in ascending or descending order. The columnar report will then return the number of records specified sorted by the highest value for the specified column.

4.1.2.2. Summary Break Report

Like the simple columnar report, the summary break report type takes columnar data and presents it in a tabular form. However, unlike the simple columnar report, it allows you to break data into sections and insert summary fields.

Summary Break Report

4.1.2.2.1. Data Mapping

The first step in data mapping for this type is to select the columns you want to include in your report from the Set Mapping window in the Report Wizard. The left side of the window lists all available columns from your query or data file and the right side lists the columns that will be displayed in the report. Click on a column name to select it (SHIFT+Click for multiple selections) and press the ADD or REMOVE buttons to add it or remove it from the report. The order in which you select columns in this window is the order in which they will appear in your report. You can change the order of the selected columns by highlighting the column you want to move and clicking the UP or DOWN buttons. Fields can also be moved by clicking and dragging the selected field.

The second step in data mapping is to set column options. There are five column options available for summary break reports. The window displays a table showing all of the columns that you have selected for your report and all available options. The first field displays column names, the second one displays data type, and the third one displays a check box marked Visible. Checking or un-checking this box will make the column visible or invisible within the body of the report (All columns are visible by default). The fourth field is the row break field. Checking this box indicates that the report will break and insert column summaries every time the selected column field changes. By default, the first column selected for the report is the break field. The fifth field allows you to select aggregation. If the Perform Column Aggregation checkbox at the bottom of the window is checked, the selected aggregation will be performed on the entire column and the report will only contain summarized data. If the box is not checked, the report will display all data and only insert aggregations as summaries after each row break.

The drop-down menu allows you to select the aggregation operation to be performed for that column. The aggregation operations that can be performed are: none, sum, maximum, minimum, count, average, first, last, sum of squares, variance, standard deviation, and count distinct. If you select to perform column aggregation, you must select an aggregation option for each column. Columns selected as row break fields cannot be aggregated.

For example, suppose we have the following data table:

Order#ProductQuantity
12Chair2
12Table3
14Cabinet2
14Table5

Setting Order # as the row break field and the aggregation on Quantity to Sum without checking Perform Column Aggregation will produce the following report:

Order#ProductQuantity
12Chair2
 Table3
  5
14Cabinet2
 Table5
  7

However, selecting Perform Column Aggregation and changing the Product aggregation to Count will produce the following report:

Order#ProductQuantity
1225
1427
 25

The sixth field allows you to select whether to repeat a break field or not. By default, a row break column will only print each distinct value in the column once (i.e. once for each group). Selecting this option will cause the break fields to repeat for each row of data in the group.

Click to view larger image

Summary Break Report Mapping

Click to view larger image

Summary Break Report Mapping

If you want to keep the data ordering specified in the data source, select the Keep Data Source Order option. To learn more about this feature, see Section 4.1.2.9 - Keep Data Source Order.

4.1.2.2.1.1. Top N Report

You can also create a Top N report using the summary break format. A Top N report will order and show you to highest set of values based on a particular column in the report. For summary break reports, you can also specify to show the highest values for each group. For example, you may want to show the top five customers in each region based on total sales. To do this, check the Top N Report checkbox at the bottom of the data mapping window. You can then specify which column you want to use as the measure (for the above example, it would be total sales column), the number that you want to retrieve (i.e. 10 or 20, etc), and whether you want to display the columns in ascending or descending order. The summary break report will then return the number of records specified (or number of records specified for each row break) sorted by the highest value for the specified column.

4.1.2.3. Crosstab Report

A crosstab report is a report format that shows and summarizes columnar data in a matrix-like form. Crosstab reports often resemble spreadsheets. Both rows and columns are summarized, allowing multi-dimensional data to be displayed in a two-dimensional format.

Click to view larger image

Crosstab Report

The actual report is only constructed during running or preview. Since the crosstab table is essentially constructed from scratch every time the report is run, it is easier to create a smoothly collapsing and expanding crosstab table.

4.1.2.3.1. Data Mapping

Report mapping for crosstab reports is more complicated than other report types and may require some planning to be able to execute it correctly.

The first step in data mapping for this type is to select the columns you want to include in your report from the Set Report Mapping window in the Wizard. The left side of the window lists all available columns from your query or data file and the right side lists the columns that will be displayed in the report. Click on a column name to select it (Ctrl+click for multiple selections) and press the ADD or REMOVE buttons to add it or remove it from the report. The order in which you select columns in this window is the order in which they will appear in your report. Once you select the columns, click the Next button.

The second step in data mapping is to set column options.

The top of the column options window displays a table showing all of the columns that you have selected for your report and all available options.

  • The first field displays the Column Name.

  • The second field displays the Data Type.

  • The third field displays a checkbox marked Visible. Checking or un-checking this box will make the column visible or invisible within the body of the report.

  • The fourth field is the Row Break field. Selecting a column as the row break field will cause the report to insert a new crosstab row for each unique entry in the selected column.

  • The fifth field is the Column Break field. Selecting a column as a column break field will cause the report to create a new column for each unique entry in the database.

  • The sixth field is the Column Break Value field. Columns that you select as column break values become the fields that are summarized in the report.

  • The seventh field allows you to select column Aggregation. A drop-down menu allows you to select the aggregation to be performed for that column. The aggregation operations that can be performed are: sum, maximum, minimum, count, average, first, last, sum of squares, variance, standard deviation, and count distinct. Columns that have been selected as Row Break or Column Break fields cannot be aggregated.

  • The eighth field Order allows you to specify ordering for the column break column. This order will determine how the crosstab columns are drawn from left to right. Ordering options are not sorted, ascending, and descending.

[Note]Note

The aggregation that will be performed depends on the aggregation of the Column Break Value column(s). For example: if you use the MAX aggregation, the greatest value from the row will be displayed in the Grand Total column.

Keep Data Source Order:

If you want to keep the data ordering specified in the data source, select this option. To learn more about this feature, see Section 4.1.2.9 - Keep Data Source Order.

Show Column Aggregation Grand Total:

If this option is enabled, a column will be added into the report. Each row of the column will aggregate all values from the corresponding row into a single value.

Column Aggregation Subtotal:

Subtotal column is very similar to the Grand Total column, except it doesn't aggregate the whole row, but each one of the Column Break group. This option allows you to disable the subtotal column or set its position (right or left to the Column Break group).

Row Aggregation:

This is also very similar to the Grand Total column. The main difference is that this option doesn't aggregate rows, but columns. Also, it doesn't add a column to the report, but it adds a row instead. Use this options to disable the Row Aggregation row, or to adjust it's position (on top of the table or below the table).

Align Column Break Value:

If you select more than one Column Break Value columns, use this option to choose whether the values will be aligned in rows or columns.

For example, assume we have following crosstab mapping:

Click to view larger image
Click to view larger image

Crosstab Fixed-Field Mapping

Setting CATEGORYNAME and PRODUCTNAME as Row Break fields, PRODUCTID as a Column Break Value field with an aggregation of SUM, and CATEGORYNAME as a Column Break field with the Show Column Aggregation Grand Total option enabled will produce a report from the beginning of the Crosstab Report section.

You can easily change the crosstab settings using the Change Data Mapping option under the Data menu. This will open the crosstab report mapping dialog again. To learn more about this feature, see Section 4.1.2.8 - Change Data Mapping.

The following table shows various formatting in crosstab reports:

 Column Aggregation SubtotalRow AggregationAlign Column Break ValueTemplate
Report ARightFooterHorizontalTemplate A
Report BRightHeaderHorizontalTemplate B
Report CLeftFooterHorizontalTemplate C
Report DLeftHeaderVerticalTemplate D
Report ELeftNoneVerticalTemplate E
4.1.2.3.2. Transposing Data

The crosstab report also provides a unique feature that allows users to create a transposed report. Data transposition allows users to create a report presentation where the input data is essentially rotated by 90 degrees. Columns become rows and rows become columns. For example, you have a following set of data:

RegionForcastSales
East2410025050
Midwest2311022400
South2230026500
West1875019220

The data transposition feature can be used to create a report that will look like this:

 EastMidwestSouthWest
Forcast24100231102230018750
Sales25050224002650019220

To transpose the data, click the Transpose Data option at the bottom of the result screen that first appears when you select a data source for the report. The following dialog shows the initial result set from the sample data in the example above.

Data Table Dialog

When you check the option at the bottom, a new dialog will appear allowing you to select the columns that you want to transpose. In this example, you would select the Forecast and Sales columns. Note that in order to perform transposition, the selected columns must have the same data type.

Select Transpose Dialog

After making your selections, click the OK button to apply the changes. You will see the transposition in the data table dialog. The Sales and Forecast headers are transposed into a column called ColumnLabel and their values are merged into a column called Value. Now you can map this result set using a crosstab report where ColumnLabel is the Row Break, Region is the Column Break, and Value is the Column Break Value to create the final transposed report layout.

Data After Transposition

4.1.2.4. Master & Details Report

A Master & Details report is a set of tabular data that is grouped according to a master field. This report type is most commonly used when you have fields in your data table that have a one to many relationship. A good example of this is an invoice. For each order number in a database there will be customer information and several items with pricing information. A Master & Details report would be used to group the information according to order number.

Master & Details Report

4.1.2.4.1. Data Mapping

The first step in data mapping for this type is to select the columns you want to include in your report from the Set Mapping Window in the Report Wizard. The left side of the window lists all available columns from your query or data file and the right side lists columns that will be displayed in the report. Click on a column name to select it (Ctrl+click for multiple selections) and press the ADD or REMOVE buttons to add it or remove it from the report. The order in which you select columns in this window is the order in which they will appear in your report.

The second step in data mapping is to set the column options. There are three column options available for Master & Details reports. There is a drop-down menu at the bottom of the column options window. It is labeled primary key. The drop-down menu contains all of the columns that you have selected for the report. Selecting a column as the primary key will group the report according to that column. A new group will be created every time the value in the selected column changes.

The top of the column options window displays a table showing all of the columns that you have selected for your report and the available options. The first field displays column names, the second one displays data type, and the third one displays a checkbox marked Visible. Checking or un-checking this box will make the column visible or invisible within the body of the report. The fourth field is the Master field field. Selecting a column as a Master field will place the column value in the column header instead of the data section of the report.

A checkbox at the bottom of the data mapping window allows you to change the layout of the report. Checking the Side-By-Side Layout box will arrange the report so that the master section is displayed next to the details section rather than above it.

For example, suppose we have the following data table:

Order #Customer NameProductUnit PriceQuantity
12Paul CampbellChair$24.954
12Paul CampbellTable$127.501
14Sally HayesCabinet$227.252
14Sally HayesChair$24.952
14Sally HayesTable$127.501

Setting Order # as the primary key and Customer Name as a Master field without using side-by-side layout will result in the following report:

Order #12 
Customer NamePaul Campbell 
ProductUnit PriceQuantity
Chair$24.954
Table $127.501
Order #14 
Customer NameSally Hayes 
ProductUnit PriceQuantity
Cabinet$227.252
Chair$24.952
Table$127.501

However, the same report with side-by-side layout would look like this:

  ProductUnitPriceQuantity
Order #:12Chair$24.954
Customer Name:Paul CampbellTable$127.501
Order#:14Cabinet$227.252
Customer Name:Sally HayesChair$24.952
  Table$127.501
Click to view larger image

Master & Details Report Mapping

Master & Details Report Mapping

If you want to keep the data ordering specified in the data source, select the Keep Data Source Order option. To learn more about this feature, see Section 4.1.2.9 - Keep Data Source Order.

4.1.2.4.1.1. Top N Report

You can also create a Top N report using the Master & Details format. A Top N report will order and show you the highest set of values based on a particular column in the report. For Master & Details reports you can also specify to show the highest values for each group. For example, you may want to show the top five customers in each region based on total sales. To do this, check the Top N Report checkbox at the bottom of the data mapping window. You can then specify which column you want to use as the measure (for the above example it would be total sales column), the number that you want to retrieve (i.e. 10 or 20, etc), and whether you want to display the columns in ascending or descending order. The master & details report will then return the number of records specified (or number of records specified for each row break) sorted by the highest value for the specified column.

4.1.2.5. Mailing Label Report

A mailing label report is similar to a simple columnar report; however, it pre-arranges data in a way that allows you to create mailing labels. Data is arranged within the data table vertically and is wrapped automatically, making it easy to create a report showing an address list for mailing labels.

Mailing Label Report

4.1.2.5.1. Data Mapping

Data Mapping for this type is exactly the same as for simple columnar report. The first step is to select the columns you want to include in your report from the Set Report Mapping window in the Report Wizard. The left side of the window lists all available columns from your query or data file and the right side lists columns that will be displayed in the report. Click on a column name to select it (SHIFT+Click for multiple selections) and press the ADD or REMOVE buttons to add it or remove it from the report. The order in which you select columns in this window is the order in which they will appear in your report.

The second step for data mapping is to set the column options. For mailing label reports there is only one available option. The window displays a table showing all of the columns you have selected for the report and all available options. The first field displays column names, the second one displays data type, and the third one displays a checkbox marked visible. Checking or un-checking this box will make the column visible or invisible within the body of the report (all columns are visible by default).

Click to view larger image

Mailing Label Report Mapping

Mailing Label Report Mapping

4.1.2.6. Additional Formatting Options

After you finish specifying mapping options, you can dismiss the Wizard and begin editing/modifying the report. To exit the Wizard, click the Done button in the last data mapping window. This will take you back to the main designer window where a blank (unformatted) report will be generated based on your mapping specifications.

Instead of generating an unformatted report, ReportDesigner also provides several additional options in the Wizard that allows you to automatically place some elements in the report, as well as provide a default style for the report elements. To continue on in the Wizard, click the Next button in the last data mapping window. This will bring up a dialog prompting you to add several elements to the report.

Add Elements Dialog

This dialog allows you to specify a report title and a logo for the report header. If you select to add a report title, you will be able to type in the title text. If you specify to add a logo, you can specify the location of the image file either using a file or URL path. You can also specify whether to place the logo in the upper right or upper left corner of the page.

You can also specify to add page numbers and date to the page headers and footers. You can select format and position of the elements either in the page header or footer and align them to the right, left, or center of the page.

After you finish specifying the elements, you can again click the Done button to dismiss the Wizard and begin editing/modifying the report with the added elements. If you click Next, you will be taken back to the last dialog in the Report Wizard. This dialog allows you to select a style for the report.

Click to view larger image

Report Style Dialog

From here you can pick a pre-defined style or a custom style you want to use for the report. Selecting a style will apply formats to the report elements, as well as change the default attributes of new report elements. Below are examples of each of the pre-defined report styles when applied to the same summary break report:

Click to view larger image

Block Left-Align

This style sets text alignment to the left and draws the report on a gray background with blue headers.

Click to view larger image

Break Right-Align

This style sets text alignment to the right and draws lines to demarcate the headers.

Click to view larger image

Center Table

This style centers text and draws table borders around the report cells.

Click to view larger image

List Left-Align

This style sets text alignment to the left and draws alternating color for each row.

Click to view larger image

List Break-Left

This style sets text alignment to the left, adds lines to demarcate column headers, and draws alternating color for each row.

Report styles will only effect the appearance properties of the report elements and will not change the report type or data mapping options that were selected earlier. Once you specify a style, click the Done button to dismiss the Wizard and continue to the main designer window.

4.1.2.6.1. Custom Styles

In addition to the five pre-defined styles included with ReportDesigner, users can create their own style definitions. Style definitions are special versions of report templates that are saved with a .stl extension. Users can create a style definition using any report template.

4.1.2.6.1.1. Creating a Custom Style

The first step in creating a custom style is to set the global formats. This allows you to control the default look and feel for all elements the user inserts into the report. For more information about global formats, see Section 4.1.3.9.1 - Global Formatting.

The second step in creating a custom style is to select the look and feel for the elements in each section of the report. To do this, select the report element whose formats you want to apply to all elements in the section when the style is applied and select Set Attributes as Section Style from the pop-up menu.

Once you finish setting the attributes, save the report template as a custom style by checking the Create Style option in the save as dialog.

4.1.2.7. Fit Columns to Page Width

Often when you finish with the Report Wizard, your created report will be wider than the default page width (8.5"). When this happens, you will be presented with a warning.

Auto-Fit Columns Dialog

The dialog gives you an option to shrink the report to fit within the page. If you select Yes, all columns will automatically shrink to fit the width of the page. The page boundary is indicated by a vertical bar within the design window. If you select to keep the columns overlapping the page boundary, the overflow will be printed on a new page when you preview the report. You can auto-fit the columns anytime you are editing the report by selecting Auto Fit Columns from the Format menu. The page width can also be adjusted by selecting Page Setup from the Option menu.

4.1.2.8. Change Data Mapping

Once you complete the data mapping, a rough version of the report will be generated. If it is not correct, you can change the data mapping by selecting Change Data Mapping from the Data menu, or clicking the Change Data Mapping button on the toolbar. This will take you back to the Report Wizard (starting with data mapping), allowing you to go back to change the report type and data mapping.

Click to view larger image

Change Data Mapping window

When you change the data mapping, there will be two checkboxes at the bottom of the last screen in the Report Wizard. One is marked Apply Template and the other Apply Formula and Script. Checking the first box will retain the formatting of your report; however, the labels and formulas may not be correct. Un-checking this box will create a blank report with the new data mapping. If you did not format lot of the report objects, it is recommended that you un-check this box. This will ensure that the new data mapping is completely accurate. The second box allows you to include functions and scripts placed in the data table section to be applied (formulas and scripts in other sections are always applied), when you select the Apply Template option. Please note that if you have changed the number of columns or the data types of certain columns, the functions and/or scripts may no longer work.

4.1.2.9. Keep Data Source Order

Summary Break, Cross-tab and Master&Details reports use memory-optimized query processing which can unfortunately change the order of the data. In other words: the data in the report may be displayed in different order than the data in the data source. To prevent this from happening, choose the Keep Data Source Order option in the report mapping dialog. This will disable the memory-optimized query processing which means that the data will be passed to the report without any optimalization (i.e. the original data ordering will be preserved).

Click to view larger image

Keep Data Source Order option

[Note]Note

If you choose the Keep Data Source Order option, the Top N Report option for Master&Details and Summary Break reports will be disabled.

4.1.3. The Designer Interface

Users who have some familiarity with other report writers will recognize the banded-style interface of the Report Designer. Report elements can be added and modified within the Designer window and then the resulting report can be previewed in the preview window.

Click to view larger image

Report Designer Interface

4.1.3.1. Report Sections

Each group within the designer interface represents a different report section. The section names are listed on the buttons to the left of each report group.

Report Header:

This section is like the title of the report. It appears only once at the top of the report.

Page Header:

Any element placed in this section will appear at the top of every page of the report.

Table Header:

This section serves as a header to the detail or data section of the report. By default, it only appears once in the report.

Group Header:

This section appears in reports with grouped data (i.e. master & details report), or data with row breaks inserted (i.e. summary break report). It repeats at the top of each grouping within the report.

Table Data:

This is the main section of the report that contains most of the data. Data columns that have been selected for the report are placed in this section and are repeated for each entry in the column.

Group Footer:

This section appears on reports with grouped data (i.e. Master & Details report) or data with row breaks inserted (i.e. summary break report). It repeats at the bottom of each grouping within the report.

Table Footer:

This section serves as the footer or data section of the report. By default, it appears only once in the report.

Page Footer:

Any element placed in this section will appear at the bottom of every page of the report.

Report Footer:

This is the last summary of footer section of the report. It only appears once at the end of the report.

4.1.3.1.1. Nested Sections

There can also be nested sections in addition to the Report Header, Table Header, Group Header, Group Footer, Table Footer, and Report Footer sections. Nested sections are useful for placing sub-reports and rich text fields with variable lengths. This allows these type of elements to resize without overlapping any elements below. Nested sections inherit most of the section options from their parent sections, including page-breaking and repeating options.

To add a nested section, select Insert Section from the section options pop-up menu for the parent section. For more information about section options, options see Section 4.1.3.3 - Section Options. Note that if you select to insert a section from a nested section, it will inherit the same parent section (i.e. nested sections cannot be a parent).

4.1.3.2. Resizing Sections

To resize section height, place your mouse over the section divider within the design window. The pointer will change to a resize pointer. Click and drag the mouse to expand or decrease the section height.

4.1.3.3. Section Options

There are several formatting and display options available for each report section. You can access the section options menu by clicking the button with the section name at the left side of the Designer or by right clicking on a blank portion of the section field.

Background Color:

This option is available for every section of the report. It allows you to set background color for the entire section. Selecting this option will bring up a dialog box prompting you to specify whether or not to set the background transparent. If you do not want a transparent background, uncheck the checkbox and click the button. This will bring up a dialog prompting you to specify the background color. You can select font color from swatches or enter HSB/RGB values. You can also directly enter a HEX color value to the Hex # field.

[Note]Note

If there are no elements placed in a section, that section will not display. Hence, changing a section background color will have no effect on the finished report if the section is blank.

Background Color Dialog

Section Height:

This option is available for every section of the report. It allows you to set the section height. It has the same effect as dragging the section's bottom edge, but unlike the drag&drop method, this option allows you to set the section height precisely in inches.

Insert Section:

This option is available for Report Header, Table Header, Group Header, Group Footer, Table Footer, and Report Footer sections. Selecting this option will add a nested section to the currently selected report section.

Remove Section:

This option is only available for nested sections that you have added to the report (regular sections can only be rendered invisible). This option will remove the nested section from the report and delete its contents.

Repeat On Every Page:

This option is available for Table Header and Group Header sections. Selecting this option causes the section to repeat again after every page break (group headers will only repeat if the data for that group exceeds one page).

Print On a New Page:

This option is available for Table Header, Group Header, Table Data, Group Footer, Table Footer, and Report Footer sections. For the Table Data section, a new dialog will pop-up allowing you to select the number of rows to display on each page. This number will be set as a new maximum of table data rows for the page. After this amount of rows a page break will be inserted. This count does not include any formulas in the footer sections. For example, if the report contained row breaks and an aggregation calculated for each group, this element will not count towards the number of rows.

Print on New Page Dialog

Selecting this option for any other section inserts a page break each time the section appears.

New Excel Sheet:

This option is only available for Group Header section(s). Selecting this option causes each group to be printed on a separate worksheet when the report is exported to Excel (XLS) or Excel 2007 (XLSX) format.

Reset Page Number:

This option is only available for Group Header section(s). Selecting this option causes the report pagination to reset each time the section is run. Hence, each time the Group Header section runs, the current page number goes to 1. Note that setting this option will automatically enable the print on a new page option.

Fit Group On Page:

This option is only available for Group Header section(s). It allows you to control some of the pagination for grouped data. Selecting this option will cause ReportDesigner to try to fit the entire group on a page. If the entire group cannot print on a page, it will print on a new page. If the group cannot fit on any page, (the fields are longer than the page height), it will be broken up into multiple pages.

Skip First Value:

This option is available for Table Header, Group Header, Group Footer, and Table Footer sections. This option is a subset of the print on a new page option. Selecting this option will ignore the page break for the very first time a section is run. For example, setting this option for the Group Header section will cause the report not to insert a page break for the first time the section is run. The page break will only occur when the report runs the Group Header for a second time.

Skip First Group Value:

This option is only available for Group Header section. This option is a subset of the print on a new page option. Selecting this option will ignore the page break for the first value of each group of data. This option is used for nested grouping in a report where more than one group is set to print on a new page. To prevent a blank page for records where more than one grouped column value changes, the 'Skip First Group Value' can be set for the inner Group Header section.

Resize Cells Proportionally:

This option only applies if you have set cells within the section to resize to fit content. If this option is selected, all cells in the section will resize with the variable height cells.

Invisible:

This option is available for every section of the report. Selecting this option hides the entire section. To make the section visible again, click on the Format menu at the top of the designer and select Make Section Visible option.

HTML Border:

This option is available for every section and only takes effect if the report is exported to HTML. Since tabular HTML (not DHTML CSS formatting) does not allow selective cell borders within a table, users can select to turn on or off a border for all cells in a section when the report is rendered in HTML. If you select this option, the following dialog will appear allowing you to set options for the HTML border:

HTML Border Options

In this dialog, you can set thickness and border color by clicking the Border Color button. This will open the color palette dialog allowing you to pick a color for the HTML border.

Scripting:

This option will bring up scripting interfaces allowing you to write, modify, or apply a script to dynamically modify certain section attributes. For more information about this feature, please see Section 4.1.7.2.7 - Section Scripts.

4.1.3.4. Rulers

The Report Designer has two rulers in the top left corner of the Design window. The rulers measure how the report will look in terms of the physical page dimensions. Please note that the dimensions do not include page margins. The rulers helps you to get a good idea of how the printed report will look like. You can also use the rulers to adjust the bounds of elements in your report. Selected element bounds will appear as shaded areas within the rulers and can be adjusted by clicking on and dragging the markers.

Rulers and in/cm button

4.1.3.4.1. Toggling Between Inches and Centimeters

The button in the upper left corner of the Design window allows you to toggle between inches and centimeters. By default, ReportDesigner uses inches for measurement. Depressing the button will change the ruler measures to centimeters. If centimeter is selected, all of the manually entered values like element bounds and page margins will also be entered and displayed in centimeters.

4.1.3.5. Designer Menus

Most of the Report Designer's features can be controlled using the drop-down menus at the top of the designer.

4.1.3.5.1. File Menu

This menu performs most of the file operations.

New:

Creates a new report.

Open:

Opens an existing report (.pak/.rpt/.xml/.qrp/.stl format).

Close:

Closes the current report.

Apply Template:

Imports and applies a template (.pak/.rpt/.qrp or .xml) file to the current report. All of the report attributes are changed to those of the template.

Save:

Saves the current report.

Save As:

Allows you to name and save the current report as a template (.pak) file. A checkbox within the Save As window allows you to generate an applet page with the Report Viewer embedded, as well as generate an XML template or a report style (.stl).

Export:

This option exports the report to a selected format. Options include DHTML, PDF, CSV (data file), Excel (XLS), Excel 2007 (XLSX), RTF, TXT, and XML.

Print:

Prints the current report (This option is only executable from Preview tab.)

Exit:

Closes the application.

4.1.3.5.2. Edit Menu

This menu allows you to edit and cut/paste report elements.

Undo:

Cancels the last operation performed in the Designer and reverts back to the previous state. The Designer will remember last 10 actions made.

Redo:

Reverses the action of the undo command. For example, if you change the font color from black to red, you can undo this command to change it back to black and then redo this command to have it changed back to red again.

Edit:

This option is available for labels, formulas, images, and charts. For labels, it will prompt you to change the label text. For formulas, it will prompt you to change the formula. For images, it will prompt you to change the image file URL. For charts, it will bring up Chart Designer to edit your chart.

Copy:

This option makes a copy of the selected element and places it on the clipboard.

Cut:

This option removes the selected element and places it on the clipboard.

Paste:

This option pastes the current clipboard element into the report.

Delete:

This will delete the selected element, except for elements in the Table Data section. It will not delete these, but render them invisible.

Remove Sub-Report:

Removes a sub-report from the current report.

4.1.3.5.3. Insert Menu

This menu allows you to insert elements into the current report.

Insert Label:

Inserts a label element into the current report.

Insert Formula:

Inserts a formula element into the current report.

Insert Column Field:

Inserts a column field into the report from the available fields (Available fields are those that have been selected for the report. See data mapping: Section 4.1.2 - Report Types and Data Mapping).

Insert Database Field:

This option is only available if the template's data source is a database. It allows you to insert a field from a database that is not part of the original query.

Insert Column Header:

Inserts a column header for one of the report fields.

Insert Parameter Value:

Inserts a formula that returns the supplied value for a report parameter.

Insert Chart:

Inserts a new chart into the current report.

Insert Image:

Inserts an image from a file into the report. Images can be in JPEG, GIF, or PNG format.

Insert Rich Text Field:

Inserts a new rich text into the current report.

Insert Table of Contents:

Inserts a table of contents into the report.

Insert Line:

Inserts a vertical or horizontal line into the report.

Insert Rectangle:

Inserts a grid rectangle.

Insert Guideline:

Inserts a guideline into the report. Guidelines can help you move and position elements in the report. For more information about guidelines, please see Section 4.1.3.7.14 - Guidelines.

Today's Date:

Inserts the current date into the report in one of three ways: Date, Date & Time, or Time. The date function is actually a formula and the format can be adjusted after it is inserted. For more information about formula formatting, please see Section 4.1.3.7.3 - Data Formatting for Formulas and Column Fields.

Page Number:

Inserts the page number into the report in one of two ways: Page Number or Page Number of Total Pages (i.e. page X of Y). The page number function is actually a formula and it can be formatted after it is inserted. For more information about formula formatting, please see Section 4.1.3.7.3 - Data Formatting for Formulas and Column Fields.

Insert Sub-Report:

Inserts a new or pre-existing sub-report into the current report. For more information about sub-reports, please see Section 4.1.9 - Sub-Reports.

4.1.3.5.4. Format Menu

The format menu contains formatting options for the currently selected element within the report. Some menu options will not work depending on the type of element which is currently selected.

Data Format:

This option is available for formulas and column fields. It will bring up the data format editor for the data type of the selected element, either string, numeric, date/time, or Boolean.

Chart Export Format:

This option is only available for charts. When reports are exported to DHTML format, charts are converted to static images. This option allows you to specify the image properties for the chart upon export.

Edit Attributes:

This option is available for every report element. It will bring up a dialog box that allows you to adjust attributes depending on the selected element (e.g. bounds, background color, alignment, font style and size, rotation, border/round corners, data format).

Font Style and Size:

This option is available for labels, formulas, and column fields. It brings up a dialog box prompting you to change the font appearance and the size of the selected element.

Background Color:

This option is available for labels, formulas, and column fields. It allows you to adjust the background color of the selected element.

Dual Colors:

This option is only available for elements in the Table Data section of the report. It allows you to specify alternating background colors, font colors, and font styles for the selected column, as well as the number of rows between changes or on which column field to base the change.

Line Color & Thickness:

This option is only available for lines. It allows you to set the color and the thickness for the selected line(s).

Border:

This option is available for every report element. It allows you to specify thickness (in pixels), and color and shape of corners (sharp or round) of the border drawn around the selected element. The border thickness/corners can be set individually for the each side/corner of the element.

HyperLink:

This option is available for all elements except column fields. It allows you to hyperlink an element to a web page or another report.

Scripting:

This option is available for all labels, formulas, and column fields. It allows you to create a script and apply conditional formatting to the selected element.

Rotation:

This option is available for all labels, formulas, and column fields. It allows you to rotate the element 90 degrees clockwise or counter-clockwise.

Z-Index:

This option allows you to set the z index for the selected report element. The z index controls how report elements behave (i.e. which one appears first) when placed on top of each other.

Bounds:

This option is available for every report element. This feature allows you to manually enter the boundaries of an element. The measurements will be in inches or centimeters depending on which unit is selected with the toggle button in the upper left corner of the Designer window where the rulers meet.

Alignment:

This option is available for labels, formulas, and column fields. It allows you to align the selected element horizontally to the left, center,right, as well as vertically to the top, middle,or bottom.

Wordwrap:

This option is available for labels, formulas, and column fields. It allows users to enable or disable word wrapping within report elements.

Resize To Fit Content:

This option is available for labels, formulas, and column fields. It causes the height of the selected element to adjust dynamically to fit its content.

Make Column Visible:

This option is only available if you deleted an element in the Table Data section, or if you selected an invisible data column from the column options screen of the Report Wizard. It allows you to render any invisible column visible.

Make Section Visible:

This option is only available if you rendered a report section invisible (See Section 4.1.3.3 - Section Options). It will make the section visible again.

Invisible:

This option is available for elements in the Table Data section or for report sections. It will make the selected element invisible.

Column Wrap:

This option allows column fields to be wrapped, so rather than breaking to the next page at the end of the page, they will continue next to the original column field within the current page.

Auto Fit Columns:

This option will shrink all elements within the report to fit the report within the page width.

Swap Columns:

This option allows the position of two elements to be swapped in the report. Elements must first be selected using CTRL+Click.

4.1.3.5.5. View Menu

The view menu contains options allowing you to navigate through the report in the Preview window and sort the data. It is only active when you are previewing the report.

First Page:

This option will navigate to the first page of the report within the Preview window.

Previous Page:

This option will scroll back one page within the Preview window.

Next Page:

This option will scroll forward one page within the Preview window.

Last Page:

This option will navigate to the last page of the report within the Preview window.

Go To Page...:

This option will prompt you to enter a page number and then navigate to that page of the report within the Preview window.

Sort by (ascend):

This option opens up a second menu allowing you to select one of the report columns to sort the report in ascending order (either numeric or alphabetical).

Sort by (descend):

This option opens up a second menu allowing you to select one of the report columns to sort the report in descending order (either numeric or alphabetical).

Sort by...

This opens a dialog which allows you to select nested sorting in a report (by more than one column). The direction of the sorting can be set for each column.

Launch Page Viewer:

This will load the entire report in the page viewer window. For more information about this feature, see Section 4.1.4.2.4 - Using Page Viewer.

4.1.3.5.6. Data Menu

The data menu contains options that allow you to see and manipulate the data used in the current report and its properties.

Refresh:

This option will re-query the data source used for the current report and then update the report.

Change Data Mapping:

This will re-open the Report Wizard, allowing you to change data mapping for the current report.

Change Data Source:

This will re-launch the Data Source Manager, allowing you to modify or change the report's data source.

Modify Database:

If the report uses a database as the data source, this option allows you to modify the connection information that the report uses to connect to the database. For more information about this feature, please see Section 3.1.3.5 - Editing Database Connections.

Modify Query:

If the report uses a database as the data source, this option allows you to modify the query used to retrieve the report data. For more information about this feature, please see Section 3.1.3.4 - Editing Queries.

View Column Mapping:

This option will bring up a window that displays column mapping for the current report. The window displays the column index, name, data type, options, and whether it is currently visible or invisible.

View Table:

This option will bring up a window containing the data table from which the current report is generated. The table will initially display only the first 20 records. Clicking on the Show All Records checkbox will display all of the records in the data table.

View Data Source Info:

This option will bring up a window containing information about the data source that was used to create the template. The data source type, location, and the data registry location will be displayed.

Sub-Report Parameter Sharing:

This allows you to link parameters defined within sub-reports to parameters in the main report or to the parameters defined in other sub-report. With this feature enabled, reports can share a user supplied parameter value automatically without having to pass the value to each sub-report. For more information about sub-report, see Section 4.1.9 - Sub-Reports.

Sub-Report Parameter Mapping:

This allows you to link parameterized sub-reports to column fields in the primary report. For more information about sub-reports, see Section 4.1.9 - Sub-Reports.

Chart Parameter Mapping:

This allows you to link parameterized charts (with an independent data source) to column fields in the report. For more information about this features, see Section 4.2.1.3.1 - Chart Parameter Linking.

Select Multiple Drill-Down Values:

This option is only available when you preview a multi-value drill-down report. It allows you to select values to use when drilling to the next level. For more information about drill-down reports, please see Section 4.1.8 - Drill-Down.

Security:

This will bring up the security settings dialog for the currently selected cell. For more information about the template security, please see Section 4.1.10 - Template Security.

Cell Properties:

This option is available for all elements in the report. It will bring up a window displaying the properties of the selected element including its ID value, as well as column index, name, and data type for column fields.

Set Preview Security Level:

This option allows you to specify which defined security level you want to use when previewing the template. For more information about the template security, please see Section 4.1.10 - Template Security.

Set Preview Data Options:

This option allows you to turn on/off live data for the preview window as well as set the maximum number of records that should be returned when previewing the report.

Secured Query Parameters:

This will bring up the parameter security dialog, allowing you to assign parameter values to security levels. For more information about the template security, please see Section 4.1.10 - Template Security.

Preview Parameter Prompt:

This option allows you to enable/disable parameter prompting when you preview the report.

4.1.3.5.7. Drill-Down Menu

The drill-down menu contains options that allow you to add, remove, and navigate layers of drill-down within the report. For more information about drill-downs, please see Section 4.1.8 - Drill-Down.

Navigate:

This option brings up the drill-down navigation window allowing you to edit, add, and remove layers of drill-down.

Drill-Down Link:

This option allows you to link the currently selected element to a drill-down layer.

4.1.3.5.8. Option Menu

This menu contains display and printing options

Report Explorer:

This option turns on/off the report explorer display. For more information about the explorer interface, see Section 4.1.3.8 - The Report Explorer.

Page Setup:

This option allows you to customize the page size and margins. The measurements will be in inches or centimeters depending on which unit is selected with the toggle button in upper left corner of the designer window where the rulers meet.

HTML Page Title:

This option allows you to specify the page title that is generated when the report is exported to DHTML format.

Background Color:

This option allows you to set the page background color for the report. Specifying a color here will color the entire page in Report Viewer and when exporting to DHTML or PDF. Any non-transparent section color or report element background color will draw over the background color.

Background Image:

This option allows you to specify a background image for the report.

Snap to grid:

This option allows you to control the settings for the snap to grid feature. You can turn the feature on/off, as well as control the step size.

Font Mapping:

This allows you to map system (true type) font files for the PDF export. For more information about this feature, please see Section 4.1.5.2.1 - PDF Font Mapping.

Viewer Font Setup:

This option allows the font size for text in the Report Designer and Report Viewer to be relative to the screen resolution. Turned on by default, this feature allows for more precise conversions of reports to various export formats and between installations.

Export Style Sheet:

This option allows you to export the style sheet (.css) file with the style definitions for the elements in the report. This style sheet file can be used to apply the DHTML export settings onto other reports. For more information about working with CSS, please see Section 4.1.5.2.2 - CSS Options.

Show Cell Outline:

This option draws the outline for all the elements in the report. It allows you to see the boundaries of all elements, as well as see elements where the text may not be visible.

Shift On/Off:

This option allows you to turn the cell shifting mode on or off. If the shift mode is on, resizing and moving report elements will cause the surrounding elements to shift: accommodating the resized or repositioned element.

Show Formula Name:

This option allows you to enable/disable displaying the function name, rather than the text of the function in the Design window. For more information about working with formulas, see Section 4.1.6 - Using Formulas & the Formula Builder.

Enable Table of Contents:

This option allows you to show/hide a table of contents (if it is inserted).

Global Format:

This option allows you to set formatting for each of the different type of report elements. It will apply changes to elements currently in the report, as well as change the default properties.

Null Data Handler:

This option allows you to specify the treatment of null data within the report.

4.1.3.5.9. Help Menu

This menu allows you to view program version and open the User's Guide.

About:

This option shows you information about the program version.

Contents:

This option opens the EspressReport ES User's Guide.

4.1.3.6. Designer Toolbar

The toolbar at the top of the designer offers easy access to ReportDesigner's most commonly used features. The first row of buttons perform the following functions:

Start a new report

Open an existing report

Save the current report

Export the current report

Apply a template to the current report

Undo the last change

Redo the last undone change

Cut the selected element and place it on the clipboard

Copy the selected element

Paste the current clipboard object into the report

Delete the selected element

Insert a label

Insert a formula

Insert a column field

Insert a rich text field

Insert a sub-report

Insert a horizontal line

Insert a vertical line

Insert a grid rectangle

Insert a chart

Insert an image

Insert the current date

Insert page number

Change Data Mapping

Change Data Source

Edit Query

The first two boxes in the second row of the toolbar allows you to select font face and size for the currently selected element. Buttons in the second row perform the following functions:

Set the font style to bold

Set the font style to italic

Underline the text

Set the horizontal alignment to left

Set the horizontal alignment to center

Set the horizontal alignment to right

Edit the selected element

Set data format for the current element

Apply a script to the current element

Set font style, size and color for the current element

Set background color for the current element

Set border thickness, color and corner rounding for the current element

Set dual colors for the current element

Set bounds for the current element

Page setup

Limit preview display rows

4.1.3.7. Inserting and Manipulating Report Elements

When you finish with the Report Wizard, a rough version of your report will be generated based on the mapping and it will display the options you selected. To polish the report, you may want to insert new report elements, as well as format the existing ones.

4.1.3.7.1. Inserting Elements
Labels:

You can insert a label in one of two ways: by selecting Insert Label from the Insert menu or by clicking the Insert Label button on the toolbar. After you select the Insert Label option, a small box will follow your mouse pointer around the Design window. Position the box where you want to insert the label and click. A dialog box will appear prompting you to enter the label text. Click the OK button and the label will appear in your report.

Insert Label Dialog

Formulas:

You can insert a formula in one of two ways: by selecting Insert Formula from the Insert menu or by clicking the Insert Formula button on the toolbar. After you select the Insert Formula option, a dialog box will open allowing to select a formula to insert. To insert a formula, select a formula from the list and click the Insert button. A small box will follow your mouse pointer around the Design window. Position the box where you want to insert the formula and click. The formula will be added. You can use an existing formula or create a new one. To create a new formula, click the New button in the formula list dialog. After entering a name for the new formula, the Formula Builder window will open allowing you to construct the formula (See Section 4.1.6 - Using Formulas & the Formula Builder for more information about using the formula builder and formula syntax). Any formula is automatically anchored to the report section in which it is inserted. This means that the formula will reset each time the section repeats.

[Note]Note

Only the text of the formula will appear in the design window (unless the formula is inserted in the Table Data section). You can choose to display the formula names instead of the text by selecting Show Formula Name from the Option menu.

Formula List

Click to view larger image

Formula Editor

Column Fields:

You can insert a column field in one of two ways: by selecting Insert Column Field from the Insert menu or by clicking the Insert Column Field button on the toolbar. After you select the Insert Column Field option, a dialog box will appear with two drop-down menus. The first one allows you to select the column field you want to insert into the report. The second one allows you to select aggregation (if any) for the column field. After you select the desired column field, click the OK button and a small box will follow your mouse pointer around the design window. Position the box where you want to place the column field and click. The column field will appear in the report. The column field is automatically anchored to the report section in which it is inserted. This means that each time the section repeats, the column field will display the next row in the data column.

[Note]Note

The column value will not appear in the Design window (unless it is placed in the Data Table section). All that will show is the column name {name}. You can see the column field value in the preview window.

Insert Column Field

Database Field:

This option is only available if the current report uses a database as the data source. It allows you to add a field from the database into the report that may not have been initially selected by the query or as part of the data mapping. To insert a database field, select Insert Database Field from the Insert menu. This will open a dialog with all of the tables you have included in your query and their respective fields, allowing you to select the field you want to add. Another option allows you to select the aggregation (if any) that you want to perform on the field.

Insert Database Field Dialog

[Note]Note

If the template's query contains aggregation or a Group by clause, a third option will appear in the dialog prompting you to select Database Aggregation for the field. This can either be group by or any aggregation supported by the database.

Column Header:

Column headers are a unique report element that will dynamically display column header from the data source. You can add a column header by selecting Insert Column Header from the Insert menu. This will bring up a dialog prompting you to select the column for which you want to retrieve the header.

Insert Column Header Dialog

Select a desired column and click the Ok button. A box will then allow you to position the header wherever you want in the report. Click to add the column header.

Parameter Values:

You can insert user supplied values to query or formula parameters directly into the report. To insert a parameter value, select Insert Parameter Value from the Insert menu. This will bring up a dialog prompting you to select which parameter you want to display the value for.

Insert Parameter Value Dialog

Parameter values are also accessible through formulas. For more information about formulas, please see Section 4.1.6 - Using Formulas & the Formula Builder.

Images:

You can insert an image in one of two ways: by selecting Insert Image from the Insert menu or by clicking the Insert Image button on the toolbar. After you select this option, a small box will follow your mouse pointer around the Design window. Position the box where you would like to place the image and click. A new window will appear prompting you to enter the URL of the image you want to insert.

There are two ways of inserting images: either locate the image on your hard drive or retrieve it from an URL.

To locate an image on your hard drive, click the Browse button. If you want to use an image from a different location, insert its URL.

To retrieve image from an URL, enter the URL in the Image URL text field. After that, click the Refresh Preview button to verify the URL. If the image from the URL appears in the Preview section, the URL is correct.

[Note]Note

You have to insert complete URL with protocol (e.g. http://).

If you save the report as PAK, the image will be stored in the PAK file along with the report.

If you want to re-open a RPT file (from an older ERES version) with a background image, please note that the image itself is not stored within the report. Only the path or URL is saved. If you move a RPT report, you need to be sure that it can still access the image using the specified path.

You can manually set the image dimensions in pixels, inches, or millimeters in the Dimension section.

[Note]Note

If the image dimension exceeds the page dimension, the image will not be shown (although space will be allocated for that image).

ReportDesigner also supports database images. You can add images from a database (BLOB format) by selecting the BLOB field as part of the query for the report. The images will be added as a column in the report. You can also retrieve images in the Table Data section via URL instead of using a BLOB field. For more information about this, please see Section 4.1.3.7.3 - Data Formatting for Formulas and Column Fields.

Insert Image Dialog

Background Images:

ReportDesigner allows you to add background images to a report. Background images will underlay all other report elements and will repeat on every page. To add a background image, select Background Image from the Option menu. This will bring up a dialog prompting you to specify location of the image, as well as several display options.

Background Image Dialog

To insert a new image, select the Enable Background Image option. If you want to remove an existing background image and use simple background color instead, unselect this option.

This dialog also allows you to choose one of the Display options (Center, Fit and Tile).

The rest of this dialog is the same as the Insert image dialog described in the previous section.

Lines/Rectangles:

To insert a line or a grid rectangle, select either Insert Line or Insert Rectangle from the Insert Menu. If you select a line, you can further select whether you want to insert a vertical or horizontal line. You can also select the corresponding icons on the toolbar. After you select a line or rectangle, a cross or a box will follow the mouse pointer around the Design window. Position the cross/box where you would like to insert the line/rectangle and click, then drag the cross to draw the line or rectangle. A line or grid will then be inserted into the report.

[Note]Note

The line or grid will appear thicker than it actually is in the Design window.

4.1.3.7.1.1. Inserting Charts

You can insert a chart in one of two ways: by selecting Insert Chart from the Insert menu or by clicking the Insert Chart button on the toolbar. After you select this option, a small box will follow your mouse pointer around the design window. Position the box where you want to place the chart and click. You will see the following dialog box:

Insert Chart Dialog

You have an option to use data from the current report or use an external data source. If you choose to use the data from the report, you will be shown a preview of your dataset and you will be taken directly to the chart selection window in the Chart Designer. Otherwise, you will be given an option to either select a different data source for your chart or import a chart file created before.

Once you select your options, the Chart Designer will open in a new window, allowing you to design and customize your chart. Please see the Section 4.2.1 - Introduction to Chart Designer for more information about using the Chart Designer.

[Note]Note

The actual chart will not appear in the Design window. Instead, you will see a gray rectangle with the chart URL. You can see the actual chart in the preview window.

If your report contains grouping (Summary Break, CrossTab, or Master & Detail Reports), you will also have the option to Include Section Data. If you select this option, you will be able to use group aggregations that are located within any section that the chart encompasses. This means that you can create charts using data from any aggregation located in the same section as the chart or in any inner sections.

For example, if you were to create a Summary Break Report with two row break columns, this will result in two group header and two group footer sections. Assuming we have a group aggregation for a column in your report, the report might look like this:

Summary Break Report with Two Row Break Columns

If you position the chart in the inner group header (Group Header 1) or inner group footer (group footer 1), you will only be able to use the group aggregation for the inner section in your chart (the aggregation in Group Footer 1). If you positioned the chart in the outer group header (Group Header 0) or outer group footer (Group Footer 0), you will be able to use the aggregation for the outer section as well as the inner section in your chart because the outer section encompasses the inner section. Positioning the chart in the table header or table footer sections will allow you to use any group aggregation in the report.

Suppose you moved the column headers to Group Header 1 and positioned the chart in Group Header 0 as shown below.

Insert Chart in Outer Group Header

When you see the data mapping window in Chart Designer, you will be able to use the summary data from both Group Footer 0 (TBL0_F_SEC0_FORM0) and Group Footer 1 (TBL0_F_SEC1_FORM0).

Chart Mapping with Section Data

To make the aggregation easier to recognize, you can use Custom IDs. For more information about using Custom IDs, see Section 4.1.6.2.1 - Using Column Field Data.

The resulting report will look like the image below. Notice that the chart plots the aggregation for each company. If you used the aggregation from Group Footer 0, the chart would have shown the aggregation for each region instead.

Report with Chart Using Section Data (East)

Since the chart is placed in Group Header 0, a new chart will be displayed for every region. The above image shows the chart for the East region only, but the report will contain charts corresponding to each of the other regions as well. Here is the chart for the Midwest region:

Report with Chart Using Section Data (Midwest)

Keep in mind that if you select the Include Section Data option, the data available for the chart will vary between sections, so moving the chart between sections is not recommended. If you need to move the chart after it is made, make sure that the data mapped to the chart is also available from the location where you are moving the chart to.

Here is another example using Include Section Data. Suppose you had the following CrossTab report and you wanted to use the aggregation for each column as data points in your chart.

Click to view larger image

CrossTab Report with Group Aggregation

To make the aggregations easier for later use, give each group aggregation a Custom ID that matches their column header. For example, give SUM(COL(1)) the ID SumEast, give SUM(COL(2)) SumMidwest and so on. For more information about Custom IDs, see Section 4.1.6.2.1 - Using Column Field Data. Then insert the chart in the Table Footer Section using Report Data and Include Section Data.

Click to view larger image

Insert Chart in Table Footer

The formulas with custom IDs will be visible in the data source preview (if you selected the Include section data option).

Click to view larger image

Data source preview with section data

Since the data points are in different aggregations, you will need to use the transpose feature. To learn more about data transposition in charts, see the Section 4.2.3.1.1 - Data Transposition chapter.

In the data mapping window, select the Multi Selection option for the Category (X). This option allows you to select multiple columns for the category. Select all the formulas with custom IDs. The Value (Y) should be automatically set to Value.

Chart Mapping for Transposed Data

Depending on the type of chart you select, the finished report might look like this:

Click to view larger image

Report with Chart Using Section Data

4.1.3.7.1.1.1. Inserting Summary Charts into Crosstab Reports

You can also insert summary charts into crosstab reports. A summary chart is a type of chart that is created from summarized data of a fixed-field crosstab report. For more information about crosstab reports, please see Section 4.1.2.3 - Crosstab Report.

When you are going to insert a chart into a crosstab report, you will still have the option to use data from the current report or use an external data source. Otherwise, you will be given an option to select a summary data source for your chart or import a chart file created before. Note that a summary chart can only be inserted into the Table Header/Footer sections, depending on the Formula Position. For example, if you created a fixed-field crosstab report with the formula position set to be drawn in the Header section, you can only insert a summary chart into the Table Header section. If you try to insert a chart to other report sections, the Summary Data option will not be available in the Insert Chart dialog.

Insert Chart Dialog

For example, say we have the following data mapping for a crosstab report:

Click to view larger image

Data Mapping

We selected Day as a Row Break field, Drink and Timing as Column Break fields, Quantity as a Column Break Value field with an aggregation of Sum. We also chose the Formula Position to be drawn in the Table Footer section of the report, which means we have to insert the summary chart into the Table Footer section in which data will be summarized.

Inserting a summary chart into the table footer section and selecting the Summary Data as datasource in the Insert Chart dialog will show the following Query Result dialog. The dialog shows data that will be used for a summary chart.

Query Result

Depending on the type of chart and formatting you select, the finished report might look like this:

Report Preview

4.1.3.7.1.2. Inserting Elements into the Table Data Section

Generally, when elements are inserted into a report section, they will repeat each time that the report section repeats. However, this does not apply when certain elements are inserted into the Table Data section. Charts, images, and sub-reports do not repeat for each row of data (labels, column fields, and formulas do) when inserted into the Table Data section. This allows you to design a report in a side-by-side configuration where you might have a chart or in sub-report placed next to a data table as pictured below.

Side-by-Side Data Table & Chart

Normally, when you insert a chart, image, or sub-report into a report section, you will want to resize the section so that the entire element fits within the section (otherwise it is truncated). This is not the case for charts, images, or sub-reports inserted into the Table Data section. In this situation, you will want to keep the section the same height as your column fields regardless of the size of the element you're placing in the section.

Side-By-Side Data Table & Chart (Designer)

You can resize an element in the Table Data section using the rulers or by temporarily resizing the section to adjust the element size.

4.1.3.7.2. Editing Elements

You can edit elements in one of four ways: by selecting Edit from the Edit menu, clicking on the Edit button in the toolbar, right clicking on the element, and then selecting Edit from the pop-up menu, or by double clicking on the element.

Editing Labels:

When you select the Edit option for a label a dialog box will appear prompting you to change the label text. Click on OK and the label will be changed.

Editing Formulas:

When you select the Edit option for a formula, the Formula Builder will appear prompting you to change the formula. Make any changes you want, then click the OK button and the formula will be changed.

[Note]Note

If you use the same formula in more than one place in the report, modifying the formula will change it everywhere. You can avoid this by clicking the Save As button in the Formula Builder. This will allow you to specify a new name for the modified formula and modify it only for the particular element.

Editing Charts:

When you select the Edit option for a chart, the Chart Designer will open, allowing you to edit and format the chart.

Editing Images:

When you select the Edit option for an image, a new window appears prompting you to select a new image or directory URL. After selecting the new image, click the OK button and the new image will replace the old one.

Editing Column Headers:

Column header is a unique type of report element that is generated when you first create the report. By default, column headers are dynamic and will display the name of the column even when the column changes (by changing data mapping, source, or applying a template). When you select to edit a column header, a dialog box will appear prompting you to change the text of the header.

Edit Column Header Dialog

When you edit the header, a new text will be displayed. However, the header will no longer be dynamic. You can return the header to display the (dynamic) column name by right clicking on it and selecting Original Column Header from the pop-up menu.

You can also copy and paste cell attributes between report elements. This will apply all attributes including data formatting (assuming the data types are the same), alignment, font, color, and border attributes, as well as the bounds of a cell.

To copy the attributes of an element, right click on the element and select Element Appearance from the pop-up menu. This will expand into two additional choices. Select Copy from the second menu. To apply the copied attributes to another cell, repeat the same steps as before and select Paste from the secondary menu.

4.1.3.7.2.1. Editing Element Attributes

In addition to directly editing an element, you can directly access all of the element's attributes by selecting Edit Attributes option from the Format menu, or by right clicking on an element and selecting Edit Attributes from the pop-up menu. This will bring up a tabbed dialog that allows you to set a number of properties for the element at once.

Click to view larger image

Multi-Attribute Editing Dialog

The options will vary depending on what type of element you select. For each tab in the dialog, you can set the option you want and then click the Apply button to set the changes for that attribute.

4.1.3.7.2.2. Word Wrapping

By default, any text within report elements, including labels, formulas, and columns will wrap to the next line if the cell boundaries are not wide enough to fit the text. However, this behavior can be disabled. To set text wrapping, select an element and select FormatWordwrap, or right click on an element and select the option from the pop-up menu. This will disable/enable text wrapping.

Word Wrapping Dialog

To disable word wrapping, un-check the option. Note that when word wrapping is disabled, the entire contents of the cell will be printed regardless of the cell boundaries. This can overlap and obscure other report elements. Also, word wrapping cannot be disabled for rich text fields as the rich text and Excel-based exports will still display the wrapped text.

4.1.3.7.2.3. Editing Side-By-Side Master & Details Reports

As noted in Section 4.1.2.4 - Master & Details Report of this guide, you can specify a side-by-side layout for master & details reports. This will print the master field (group header) next to the details section (table data), rather than its traditional position above the details section. When you select this report format, the master section will appear as a gray rectangle next to the column fields within the table data section of the report.

Side-by-Side Master & Details

The master section can be moved in free-form like any other report element. You can edit the contents of the master field in one of three ways: selecting it and clicking the Edit button on the toolbar, right clicking it and selecting Edit from the pop-up menu, or double clicking it. The master section will open in a new window, allowing you to modify its contents.

Edit Master Section Dialog

The elements in this section can be moved, resized, and edited in the same way as other elements in the report. The master section acts the same as a group header section. It repeats for each unique value in the primary key column. After you finish editing the contents of the master section, it can be closed by selecting Close from the File menu.

[Note]Note

After you finish editing the master section, it will automatically resize to fit its contents.

4.1.3.7.3. Data Formatting for Formulas and Column Fields

You can change the output of formulas and column fields in one of three ways: clicking the Data Format icon in the toolbar, selecting Data Format from the Format menu, or right clicking on a formula or column field and selecting Edit Attributes from the pop-up menu. When you select the format option, a dialog box will appear (or the format tab of the multi-attribute editing dialog). The box that appears depends on what type of data is present in the selected element: numeric, string, date/time, or logical/boolean.

Formatting Numeric Data:

The dialog box for numeric data contains four primary options for the data: locale-specific fixed point, fixed point, bar code, and scientific. You can select the option you want and then click on format for additional options.

Numeric Format Dialog

Locale-Specific Fixed Point:

This will change the data format depending on the locale in which it is being viewed. Additional formatting for this option allows you to specify whether the data should be displayed as a number, currency, or percentage. Additionally, you can set the maximum and minimum number of integer digits and fraction digits. Other display attributes will vary depending on locale.

Locale-Specific Formatting

Fixed Point:

This will keep the data format consistent, regardless of locale. Additional formatting for this option allows you to set the number of decimals, rounding for digit number, unit symbols, negative sign positions, decimals and thousands separator, and specify leading zeroes for fractions.

Fixed Point Formatting

Bar Code:

This will convert the data into a bar code. Additional formatting for this option allows you to select the symbology to use for the bar code. Supported symbologies are Code 39 with and without checksum, Interleave 2 of 5, UPC A, EAN 13, EAN 128, Standard 2 of 5 with and without check digit, Code 128, Code 128A, Code 128B, Code 128C, USD 3 with/without checksum, Code 3 of 9 with and without checksum, Global Trade Item Number, Random Weight UPCA, SCC 14 Shipping Code, Shipment Identification Number, SSCC 18, and US Postal Service.

Bar Code Formatting

Scientific:

This will display the data in scientific notation. Additional formatting for this option allows you to set the number of decimals.

Scientific Formatting

After you finish selecting additional options, click the OK button to return to the main dialog box. Click the OK button and the data format will be changed.

Formatting String Data:

The dialog box for string data contains four primary options: string, image URL, text URL, and bar code. You can select the option you want and in the case of string or bar code, click Format for additional options.

String Data Format

String:

This dialog allows you to format the appearance of the string. The checkbox labeled Show Original Text controls whether the complete string for each data entry will be displayed. If you un-check it, you can then specify the maximum number of characters to be displayed. Click the OK button to return to the previous dialog.

String Formatting

Image URL:

This will convert the string into an image. This is used in situations where instead of storing an image as an object in a database (BLOB), you have stored URLs that point to image files on a server. Selecting this option will read the URL and retrieve the images to be placed in the report.

Text URL:

This will convert the string into a large text object. This is used in situations where instead of storing a large text file as an object in a database (CLOB), you have stored URLs that point to files on a server. Selecting this option will read the URL and retrieve the text files to be placed in the report.

Bar Code:

This will convert the data into a bar code. Additional formatting for this option allows you to select the symbology to use for the bar code. Available symbologies for string data are Code 39 with/without checksum, Code 2 of 7 (Codabar), Codabar, EAN 128, Code 128, Code 128A, Code 128B, Code 128C, Global Trade Item Number, Monarch, NW 7, SCC 14 Shipping Code, Shipment Identification Number, SSCC 18, US Postal Service, and USD 4.

Bar Code Formatting

[Note]Note

Codabar will not accept start/stop characters in the data. If the input data is incorrect, the bar code may not be readable.

Formatting Date/Time Data:

The dialog box for date/time data contains two primary options for the data: locale-specific and standard. You can select the option you want and click the Format button for additional options. The available additional options will vary depending on the nature of your data. Date, time, and timestamp data will bring up date, time, and date & time options respectively.

Date/Time Data Format

Locale Specific:

This will change the format of the data depending on the locale in which it is being viewed. Additional formatting for this option allows you to select full, long, medium, or short notations for date and time information. Other display attributes will vary depending on locale.

Locale-Specific Formatting

Standard:

This will keep the data format consistent, regardless of locale. Additional formatting for this option allows you to select year and month displays, as well as the order in which month, day, and year information is presented. You can also select the characters to be used as separators. Time options allow you to display hours, minutes, and/or seconds, and select the separators between them. For timestamp data, you can select to display the time before or after the date and the separator to be used between them.

Standard Formatting

After you finish selecting additional options, click the OK button to return to the main dialog box. Click the OK button and the data format will be changed.

Formatting Logical Data:

The dialog box for Logical or Boolean data contains five options for displaying the data. They are: T/F, True/False, Yes/No, Y/N, and 1/0. Select the format you want to use and then click the OK button to change the data format.

Boolean Data Format

4.1.3.7.3.1. Formatting Null Data

By default, null data will display in a report as Null. You can change the appearance of null data by selecting Null Data Handler from the Option menu. This will bring up a dialog, prompting you to specify a string to be displayed for nulls.

Null Data Handler

Enter a value you want and click the OK button. All the null values in the report will be displayed as the value you specified.

4.1.3.7.4. Line/Rectangle Format

You can format the appearance of lines and rectangles in the report by right clicking on a line or rectangle element. The pop-up menu will contain a list of available options.

Lines:

There are three formatting options for lines. Line Color & Thickness allows you to set the color and thickness of the line. Line Style allows you to select the style of line - either solid, dotted, or double. Set Bounds allows you to specify the length and thickness of the line, as well as the X and Y coordinates of its origin. In addition, you can set the width of horizontal lines to match the aggregate width of columns in the report. This feature is useful for crosstab reports where the number of columns can vary and also for user-defined report styles. For vertical lines, you can set the length to match the section height.

Bounds Dialog for Horizontal Lines

Rectangles:

There are four formatting options for grid rectangles. Border allows you to set the border thickness and color for the grid rectangle. Background allows you to set a background color for the fill area of the rectangle. Set Bounds allows you to specify the width and height of the grid rectangle, the X and Y coordinates of its origin, as well as the degree of rounding for the corners. Border Style allows you to select the line style of the border - either solid, dotted, or double.

4.1.3.7.5. Chart Export Format

This option allows you to specify attributes for charts exported to DHTML. You can format the chart export properties by selecting Chart Export Format from the Format menu or by right clicking on a chart and selecting Export Format from the pop-up menu. When you select this option, a dialog box will appear. You can select GIF, PNG, JPEG, or FLASH for the image type and set some options for each type. For GIF images, you can set the background to be transparent. For PNG images, you can set the compression. For JPEG images, you can set the quality (Image quality is directly proportional to file size). For FLASH images, you can enable animation and set the frame count and frame rate.

You can also specify to create an image map when the report is exported. If you create an image map, the hyperlinks defined in the chart will be active when the report is exported. If no hyperlinks are defined, the map will contain display pop-up labels for the chart containing data point information. Note that FLASH images do not support image maps.

Chart Export Format

4.1.3.7.6. Font, Color, and Border Options

You can change the appearance of report elements by changing the font, color, and border properties.

Font Style and Size:

The font style and size can be adjusted for labels, formulas, and column fields in one of three ways. You can directly modify the font style and size using the options in the Report Designer toolbar. In addition, you can also select Font Style and Size from the Format menu or right click on a report element and select Edit Attributes from the pop-up menu. The latter two options will invoke a separate dialog prompting you to select the font style and font size or in the attribute editing dialog, where font options can be set in the 'Font Style and Size' tab.

Font Style and Size Dialog

[Note]Note

You can use any fonts from the system when designing a report. However, these fonts may no longer be present when you move reports between platforms. Also, you will have to explicitly map font files (.ttf) to font styles when exporting a report to PDF. For more information about this, please see Section 4.1.5.2.1 - PDF Font Mapping.

Alignment:

The alignment for labels, formulas and column fields can be adjusted in one of three ways. You can directly adjust the horizontal alignment for an element by selecting the option(s) from the toolbar. You can also select Alignment from the Format menu, or right click on the element and select Edit Attributes from the pop-up menu. The latter two options also allow you to select vertical as well as horizontal alignment for the element text.

Font Color:

The font color can be adjusted for labels, formulas, and column fields in one of three ways: selecting Font Style And Size from the Format menu, clicking the Font Style And Size button on the toolbar, or right clicking on the element and selecting Edit Attributes from the pop-up menu. Selecting this option will bring up a dialog box (or the multi-attribute editing dialog where options can be set in the Font Style And Size tab). To change the font color, click the Click button next to the Current Color: field. The Set Font Color dialog will appear allowing you to select font color from swatches. You can also enter HSB, HEX, or RGB values.

Font Color Dialog

Background Color:

The background color can be adjusted for labels, formulas, and column fields in one of three ways: selecting Background Color from the Format menu, clicking the Background Color button on the toolbar, or right clicking on the element and selecting Edit Attributes from the pop-up menu. Selecting this option will bring up a dialog box (or the multi-attribute editing dialog where options can be set in the Background Color tab) prompting you to specify whether or not to set the background transparent. If you do not want a transparent background, uncheck the checkbox and click the button. This will bring up a dialog prompting you to specify the background color. You can select font color from swatches, or enter HSB or RGB values. You can also directly enter HEX color value to the Hex # field.

Background Color Dialog

Dual Colors:

You can specify alternating color for labels, formulas, or column fields that are in the data table section of the report in one of three ways: selecting Dual Colors from the Format menu, clicking the Dual Color button on the toolbar, or right clicking on the element and selecting Edit Attributes from the pop-up menu. Selecting this option will bring up a dialog box (or the multi-attribute editing dialog where options can be set in the Dual Colors tab), allowing you to specify the number of rows between alternating colors. Instead of specifying alternate row numbers, you can also set dual colors to change on the row break (for summary break or crosstab reports) or as a particular column value changes. Using this feature, you can set the cell attributes to change when you reach a new group in a summary break report.

For alternate rows, you can set the background color, the font color, as well as the font style and size. Set the primary attributes as you would for any other report element.

Dual Colors Dialog

Border:

You can specify the thickness and color of the border to be drawn around any report element in one of three ways: selecting Borders from the Format menu, selecting the Border button on the toolbar, or right clicking on the element and selecting Edit Attributes from the pop-up menu. Selecting this option will bring up a dialog box (or the multi-attribute editing dialog where options can be set in the Border/Round Corners tab) prompting you to enter the border thickness in pixels and to choose a color. Entering 0 as the border thickness value will remove the border.

Border Dialog

To change the border color, click the Click button next to the Color: field. The Set Border Color dialog will appear allowing you to select border color from swatches. You can also enter HSB, HEX, or RGB values.

Border Color Dialog

To set the border thickness of the each side of the report element, check the Set Thickness Individually option. Then type the thickness (in pixels) in the text fields near the sides of the rectangle representing a selected element.

Border / Individual Thickness

To set round corners to an element, the elements need to have either non-transparent background color or a visible border, otherwise you will not see any changes. There are four checkboxes near the corners and each checkbox represents an element corner. To make a corner round, check its checkbox (you can also select several corners at once), then type a radius (in pixels) into the Radius text field.

Border / Round Corners Dialog

[Note]Note

If you plan on exporting reports with round corners, please note that round corners are available for DHTML and PDF export formats only.

4.1.3.7.6.1. Show Cell Outline

Sometimes you may want to show the boundaries or borders of report elements in the Design window, without actually turning on the borders. This is especially important if you have blank place-holder cells or columns where the first record is empty. To turn on the cell boundaries, select Show Cell Outline from the Option menu. This will draw a gray dotted border around each report element in the Design window.

4.1.3.7.7. Rich Text Fields

One of the common reporting needs is the ability to create form letters or other blocks of formatted text to a report and merge in data fields and functions. This functionality is available using rich text fields. Rich text fields, unlike labels or string function fields, allow for complex paragraph, font, and color formatting within the cell. They also allow the ability to embed column fields and functions directly in the text flow.

To add a rich text field to a report, select Insert Rich Text Field from the Insert menu, or click the Rich Text Field button on the toolbar. After you select this option, a small box will follow your mouse pointer around the design window. Position the box where you want to insert the field and click. A new window will open, allowing you to enter the rich text field.

Click to view larger image

Rich Text Editor

The rich text editor works like a small word processor. The first drop-down box allows you to select the font and the font size. The three buttons allows you to specify bold, italic, or underlined text. The next drop-down-box allows you to specify font color. The last one allows you to select function or column field formats.

You can specify a columnar layout for the text by selecting Columns from the Option menu. This will bring up a dialog allowing you to specify the number of columns for the rich text field, as well as the spacing between the columns.

Rich Text Column Options Dialog

You can add in-line images to the text flow in rich text fields as well. To add an image, select Insert Image from the File menu. This will bring up a dialog prompting you to specify the image file you want to import. After you specify it, a new dialog will open, allowing you to specify the size for the in-line image in pixels. After you set the size, click the Ok button and the image will be added to the rich text field.

You can import any rich text file (.rtf format) into a rich text field. To do this, select Import from the File menu in the editor. This will bring up a dialog prompting you to specify the file you want to import.

[Note]Note

Certain paragraph settings will be lost when you import a rich text file.

4.1.3.7.7.1. Adding Formulas

You can add any formula directly into the text flow in a rich text field. It is also possible to add column fields and parameter values. To insert a formula, column field or a parameter value, click on the Insert menu, select a category (column, formula or parameter), and choose an item from the list of all available fields/parameters/formulas. The following syntax will be added into the text: <% formula name/parameter name/column field name %>.

The InsertFormula list contains all formulas from the report. You can also create a custom formula directly in the rich text. To do so, simply type the <%Formula Syntax%> syntax (replace the Formula Syntax by the actual formula syntax). For more information about formula syntax, please see Section 4.1.6 - Using Formulas & the Formula Builder. This approach is recommended for simple formulas only. If you want to insert a more complex formula, you can create it in the report using the Formula Builder and then add it to the rich text field by selecting it from the InsertFormula menu. See Section 4.1.6 - Using Formulas & the Formula Builder chapter to learn how to create formulas in the Formula Builder.

To format formulas and column fields, you must first pre-define a format. To do this, select New from the editor Format menu and select the data type for which you want to create a format. This will bring up the formatting dialog for that data type, allowing you to define the format. After you close the formatting dialog, you will be prompted to specify a name for the formatting. For example, you could define a format called Currency that uses locale-specific currency formatting for numbers.

To apply a pre-defined format of a formula, select the formula and then select the format that you want to apply from the drop-down box on the right side of the rich text editor.

4.1.3.7.8. Hyperlinks

You can apply a hyperlink to any report element except column fields. To apply a hyperlink to an element, select it and then select HyperLink from the Format menu or right click on the element and select HyperLink from the pop-up menu. A dialog box will then pop-up asking you to enter the link, hint, and target. You can enter any URL as the link or another .pak file. The hint will display text in a hint box on mouse over when the report is viewed.

If you are running ReportDesigner in stand-alone mode, then hyperlinks to URLs will not work from the Preview window. If you export to DHTML or PDF, links to .pak files will no longer work.

Hyperlink Dialog

You can also apply dynamic hyperlinks to report elements, including column fields, by using cell scripting. For more information about cell scripting, please see Section 4.1.7 - Scripting.

4.1.3.7.9. Column Wrapping

This feature is useful for reports that have few or narrow columns of data that are longer than one page. Rather than have the data take up only a portion of the page width and extend over multiple pages in length, you can 'wrap' the columns so that they will continue to the right of the original columns on the first page of the report.

For example, say you have the following report listing product names, and the number of units ordered:

Product NameUnits Ordered
Adad Chair4
Addad Dresser5
Amon Table2
An Chair5
Anahita Dresser3
Anubis Table7
Apep Table10
Apsu Dresser3
Asherat Dresser2
Atun Table4
Bast Table4
Bes Table3
Cula Chair10
Enki Chair12
Enlil Chair7
......
......

Assuming this report is long enough to encompass multiple pages, it is ideal to use column wrapping because it uses fewer pages and fills the blank space in the page width. The report will look like this with column wrapping:

Product NameUnits OrderedProduct NameUnits Ordered
Adad Chair4Bast Table4
Addad Dresser5Bes Table3
Amon Table2Cula Chair10
An Chair5Enki Chair12
Anahita Dresser3Enlil Chair7
Anubis Table7......
Apep Table10......
Apsu Dresser3  
Asherat Dresser2  
Atun Table4  

Column wrapping is available for simple columnar and summary break report types. To implement column wrapping, select Column Wrap from the Format menu. A gray vertical bar will be drawn across the middle of the Design window indicating the column wrapping placement.

Column Wrapping in Design Window

Column wrapping begins immediately to the right of the bar, so be sure to allow adequate space. Also, anything to the right of the column wrap bar will be truncated.

You can edit the column wrap properties by first selecting the column wrap bar and then selecting Column Wrap from the Format menu. You can also right click on the column wrap bar and then select Column Wrap from the pop-up menu. A dialog box will then appear allowing you to edit the properties of the column wrapping.

Column Wrapping Options

From this dialog, you can specify the X position of the column wrapping, as well as the number of times you want the columns to wrap in the page. The X position is the distance (in inches or centimeters) from the right side of the page where column wrapping is to begin. By default, column wrapping occurs once. Setting Repeat Wrap to -1 will cause the wrapping to occur as many times as can fit within the page width.

[Note]Note

You can not specify column wrapping to occur more times than can fit within the page width. For example, if you specify three times, and the resultant report would be wider than the page, it will only repeat the wrapping twice.

4.1.3.7.10. Table of Contents

ERES has an ability to generate a table of contents for your report. The table of contents can either show the defined groups in the report, or a list of user-defined bookmarks. The TOC will display in Report Viewer, Page Viewer, DHTML, and PDF exports.

4.1.3.7.10.1. Adding a Table of Contents

To add a table of contents to a report, select Insert Table of Contents from the Insert menu. Your cursor will turn into a cross. Click to place the table of contents in either the Report Header or Table Header sections. You can not add it to any other section. A dialog will open asking you if you would like to use groups or bookmarks for the table of contents.

TOC Type Dialog

If you select to use groups, the table of contents will generate an entry for each group (and sub-group) in the report. In order to use this option, your report must contain grouped data (i.e. summary break, crosstab, master & details reports) with detail records. A crosstab report with one row break or a summary break report with column aggregation may be grouped, but because there are no detail records, you cannot create a table of contents for this presentation. If you select to use bookmarks, a one-level table of contents will be generated for each bookmark that is defined in the report. Bookmarks are defined using cell scripts. For more information about setting bookmarks, please see Section 4.1.7.2.1 - Formatting Actions.

The next dialog that appears allows you to specify options for the table of contents.

TOC Options Dialog

The first option in this dialog allows you to set the font for each level of the table of contents. When you click the Select Font button, a new dialog will open that allows you to specify font options.

TOC Font Dialog

For each level you can set the font face, style, size, and color. Note that a level corresponds with a level of nested grouping in the report. If you select to create a report with bookmarks, only the top level will be available. Sub-levels can inherit the font from the parent level. After you make changes to the font for a particular level, click the Apply button to save the changes.

The next option allows you to select whether to show numbering for the table of contents and which style to use. You can customize each style by clicking the Customize button. The following styles are supported:

Decimal:

This will use a numbered configuration for the table of contents entries with whole numbers for the outermost group and decimals for each sub-group. If you click the Customize button for this option, the following dialog will appear:

Customization Options for TOC Decimal Format

The first drop-down list allows you to select how the number should be formatted. The second option allows you to select the starting number. After you make your choices, click the Apply button to apply the changes.

Outline:

This option will use an outline format allowing you to select numbers, letters, or Roman numerals for each level of the table of contents. If you click the Customize button for this option, the following dialog will appear:

Customization options for TOC Outline Format

The list on the left side allows you to select the level for which you would like to apply formatting. The first drop-down allows you to select the number format (this will apply whether you select numbers letters or Roman numerals for the level). The second drop-down allows you to pick the format for that level - either numbers, capital letters, lower-case letters, capital Roman numerals, or lower-case Roman numerals. The last option allows you to select the starting point for the selected style. After you make your choices, click the Apply button to apply the changes.

Bulleted:

This option will use bullets for each entry. There are now additional customization options for this format.

The next option allows you to specify indentation for sub-groups. You can turn on/off the indentation and specify the number of spaces to use.

The next option allows you to specify whether to show the page number in the table of contents and whether to draw a spacer to the page number. You can draw a dotted line or a solid line for the spacer.

The last option in the dialog allows you to set the layout for the table of contents, either right to left, or left to right. After you finish setting options for the table of contents, click the Done button and it will be added to the report.

In the report, the table of contents will appear as a small grey rectangle. By default, the resize to fit content option will be turned on, but the width of the table of contents will be based on whatever size you allot for it in the section. Generally, you want to make this at least as wide as your report.

TOC in Design Window

You can see the complete table of contents when you preview the report. The table of contents is only supported for the DHTML and PDF exports. It will not appear if you export the report to other formats.

Click to view larger image

TOC in Preview Window

4.1.3.7.11. Moving and Resizing Report Elements

There are several ways to move and resize report elements. You can use rulers, mouse, or you can manually enter the element bounds.

Rulers:

You can resize and move elements using the rulers located in upper left corner of the Design window. When you select a report element by clicking on it with your mouse, a shaded area will appear on each ruler, marking the element's horizontal and vertical bounds.

On the ruler at the top of the Design window, clicking and dragging the left-hand marker will move the element horizontally. Clicking and dragging the right-hand marker will stretch the element horizontally.

On the ruler on the left side of the Design window, clicking and dragging the top marker will move the element vertically. Clicking and dragging the bottom marker will stretch the element vertically.

Mouse:

You can resize and move elements using your mouse. To move an element, simply click and drag it. To resize an element, click and drag on any of the sizing handles that appear around the edge of an object when it is selected. You can also right click and drag within the cell to resize it.

Manually Set Bounds:

You can manually set the bounds for any report element by clicking the Bounds icon on the toolbar, or by selecting Bounds from the Format menu (You can also set bounds via the Edit Attributes dialog that you can open from the Format menu or by right-clicking an object and selecting it from the pop-up menu). A dialog box will appear prompting you to enter the new element bounds. The measurements will be in inches or centimeters, depending on which unit is selected with the toggle button in the upper left corner of the designer window where the rulers meet. The X and Y coordinates are for each specific report section. The point that marks an element's X and Y position is in the upper left corner of the element.

From the same dialog, you can also set round corners for the selected element. To learn more about round corners, please see Section 4.1.3.7.6 - Font, Color, and Border Options.

Set Bounds Dialog

Resizing To Fit Contents:

Often, you may have a column field that contains data of varying length. In this case the data may be truncated, or there may be a great deal of blank space within the cell when the field is short. To alleviate this problem, you can set the element to resize its height dynamically to encompass its contents. To do this, first select the cell you want to resize and then select FormatResize To Fit Content. The element will dynamically resize to fit its content. Note that only the height of the cell will resize. The width will remain the same.

Dynamic Resize Dialog

You can also invoke the section option called Resize Cells Proportionally to cause all of the other cells in the section to adjust their height with the resized cell. For more information about section options, please see Section 4.1.3.3 - Section Options.

Group Move/Resize:

You can move or resize a group of elements by selecting the elements first. Multiple elements in a report can be selected by drawing a selection box around them or by selecting them using CTRL+Click. You can draw a selection box by clicking and dragging on empty space in a report section. Once the elements are selected, click and drag on any element in the group to move that group. Click and drag on one of the re-sizing handles to adjust the size of elements in the group.

Group Alignment:

You can align a group of elements to the left side, right side, top, or bottom of a group. Select a group of elements and then right click on it. The Group Edit dialog box will appear giving you the option to align the group. Select Group Left Alignment, Group Right Alignment, Group Top Alignment, or Group Bottom Alignment and click the Apply button. All of the elements in the group will move to the left, top, or bottom edge of the group. You can also select the Center Across Page option. This will take the selected group of cells and center them in the page.

Group Options/Alignment Pop-up Dialog

Moving Elements Between Sections:

You can move a single element or group of elements between report sections by dragging them over the section boundaries. Note that elements cannot be dragged into the Table Data section.

Column Swap:

You can swap the position of two elements within a report section. This is primarily used to rearrange the position of column fields in the report. To swap two elements, select the elements using CTRL+Click or the selection box and then select Swap Columns from the Format menu. The positions of the two elements will be switched and the surrounding elements will be moved to accommodate the swap.

Rotate:

Text elements like labels, formulas, column headers, and column fields can be rotated 90 degrees clockwise or counter-clockwise. There are two ways to rotate elements. The first way to rotate an element is to right click on it and then move the mouse pointer over the Rotate option. A sub-menu will pop-up containing three options - None, Clockwise and CounterClockwise. The second way to rotate an element is to select it and then choose Rotation option from Format menu.

Rotation dialog

[Note]Note

Text rotation is available for DHTML, PDF, XSLX, and XLS export formats only.

4.1.3.7.11.1. Controlling Element Overlapping

In ReportDesigner, each element in a report has an associated Z index. This Z index number determines how elements behave when placed in the same space (on top of each other). When elements are placed in the same space, the element with the highest Z index will appear on top and all subsequent elements with lower Z indexes will be drawn successively below each other. To set the Z index for a report element, right click on it and select Set Z-Index from the pop-up menu. This will bring up a dialog allowing you to specify a number for the index of that element.

Z Index Dialog

[Note]Note

Certain export formats that require a tabular layout, like HTML and Excel, may not appear correctly if the report has elements that overlap each other.

4.1.3.7.11.2. Locking Element Position

In Report Designer, you can lock a cell position by right clicking on the element and selecting Lock Position from the pop-up menu. When this feature is enabled, the report element cannot be moved with mouse, rulers, or any of the group formatting or alignment features. It can only be moved when the lock position option is turned off.

4.1.3.7.12. Snap to Grid

By default, Report Designer operates in Snap to Grid mode. This forces report elements to move only in set increments. The grid layout is represented by small dots drawn in the Design window. By default, the grid step size is 0.1 in or 0.25 cm (depending on which measurement is selected).

To modify snap to grid options, select Snap To Grid from the Option menu. A dialog will open allowing you to set grid properties.

Snap To Grid Options

In this dialog, you can change the grid step size or disable the snap to grid feature. If you disable it, the report elements can be moved in free-form around the Design window.

4.1.3.7.13. Shift Mode

Shift mode is toggled on and off by selecting Shift On/Off from the Option menu. When shift mode is enabled, report elements will move to accommodate changes in other report elements. Hence, if you resize the width of one report element from 1" to 2", the elements next to the current element will shift to the right. If shift mode is not selected, other report elements will not move, even if the resized element ends up overlapping another.

[Note]Note

Shift mode works best if you only resize elements or move them by a small amount. If you move elements a pronounced distance with shift mode enabled, it will displace other report elements by a pronounced distance as well, giving the report an odd appearance.

4.1.3.7.14. Guidelines

Another way to position and move groups of elements is to use guidelines. Guidelines allow you to place arbitrary position lines within the Design window and snap report elements to those lines. Guidelines allow you to precisely line up and position report elements without worrying about performing precise movements.

Elements Positioned with Guidelines

4.1.3.7.14.1. Inserting Guidelines

You can insert both horizontal and vertical guidelines by selecting Insert Guideline from the Insert menu. This option will open a sub-menu, prompting you to select whether you want a vertical or horizontal guideline. After you select your desired option, click in the design panel where you would like the guideline to be drawn. The guideline will appear as a dotted line with a marker in the upper or left ruler. You can move the guideline by clicking and dragging the marker in the ruler.

You can remove any guideline from a report by right clicking on the guideline (or the guideline marker in the ruler) and selecting Delete from the pop-up menu.

[Note]Note

Horizontal guidelines cannot be moved between report sections. If you wish to move your guideline to a new report section, you will need to insert a new guideline.

4.1.3.7.14.2. Positioning Elements with Guidelines

There are two ways in which objects can be snapped to guidelines. The first option is to snap all the elements that are near the guideline. To do this, right click on the guideline (or the guideline marker in the ruler) and select Snap Elements in Range. You can then further select to snap the cells left edge, right edge, or center. This will snap all the cells that are up to 0.1 inches away from the guideline.

The other option is to selectively snap elements to guidelines. To do this, first select the elements you want to snap to the guideline using CTRL+Click (you can select only one element, but you must use CTRL+Click to select it), then right click on the guideline (or the guideline marker in the ruler) to which you want to snap it. You can specify to snap the cell's left edge, right edge, or center to the guideline for both horizontal and vertical guidelines. Select the option you want from the pop-up menu and the cell(s) will snap to the guideline.

Guideline Positioning Options

Once an element is attached to a guideline, moving the guideline will cause the element to move as well. You can also snap an element to multiple guidelines. Snapping an element to two guidelines will cause it to stretch to fit.

Element Snapped to Two Guidelines

When you have an element attached to two guidelines, moving either guideline will cause the element to resize (either stretch or shrink).

To release an element from a guideline, right click on it and select Separate From Guidelines from the pop-up menu. This will release the element from any guidelines to which it is attached. You can also release all of the elements attached to a guideline by right clicking on the guideline (or the guideline marker in the ruler) and selecting Separate All from the pop-up menu.

4.1.3.8. The Report Explorer

In addition to the main Design window, ReportDesigner provides another interface to select and edit the elements in a report - the Report Explorer. The Report Explorer displays all elements in the report as a tree structure on the left side of the Designer. It can be turned on and off by selecting Report Explorer from the Option menu.

Click to view larger image

Report Explorer Window

Each parent node in the tree represents a section in the report. Inside each section, an icon indicates element type and element ID. If you specified a custom ID for the element, it will display instead. For more information about custom IDs, see Section 4.1.6.2.1 - Using Column Field Data.

You can also edit report elements from within the Explorer. When you select an element in the tree, the element will also be selected in the Design window and the Design window will scroll in order to display that element on your screen. You can then use toolbars, menus, or pop-up menu to set any of the element properties. The pop-up menu can also be activated by right clicking on any element in the tree.

4.1.3.9. Global Formatting, Group Formatting, and Templates

To this point, you have only seen how to edit and format the properties of individual report elements. However, sometimes you may want to format multiple elements at once. To do this, you can use global formatting, group formatting, and templates.

4.1.3.9.1. Global Formatting

The global formatting feature allows you to give all the elements in your report a consistent look and feel. To set the global formats, select Global Format from Option menu. This will bring up a second menu with each of the different report element types listed: chart, column, formula, image, label, line, rectangle, column header, and title. Selecting one of these will bring up a tabbed dialog box prompting you to set the formats for those elements. Each tab contains formatting options for an element attribute. The formatting options are as follows:

Chart:

border color, border thickness, set bounds.

Column:

data format, font style and size, font color, background color, border color, border thickness, dual colors, set bounds, alignment, rotation, script.

Formula:

data format, font color, font style and size, background color, border color, border thickness, set bounds, alignment, rotation, script.

Image:

border thickness, border color, set bounds, script.

Label:

font color, font style and size, background color, border color, border thickness, set bounds, alignment, rotation, script.

Line:

line color, set bounds, script.

Rectangle:

background color, border color, border thickness, set bounds, script.

Column Header:

font color, font style and size, background color, border color, border thickness, set bounds, alignment, rotation, script.

Title:

font color, font style and size, background color, border color, border thickness, set bounds, alignment.

At the bottom of each tab is a checkbox marked Apply Property. Checking this box will apply the property to the global formats when you click OK. The box automatically becomes checked when you change a property. After you make all the property changes, clicking the OK button will change the properties of all elements of that type in the entire report. It will also become the default attribute for any additional elements placed in the report.

[Note]Note

You have an option to insert images in the original size (default attribute). This can be done using the checkbox labeled Default Size in the Set Bounds tab of the image global format dialog.

Global Format Dialog

4.1.3.9.1.1. Global Format Import/Export

You can pass global formats from one report to another using the Import/Export feature. You can export global formats by selecting Export from the Global Format sub-menu. This will bring up a dialog box prompting you to specify a filename. The global formats will then be saved as an XML file. You can load a global format XML file by selecting the Import option from the Global Format sub-menu. This will bring up a dialog box prompting you to specify the XML file you want to import. Click the OK button and the formats stored in the XML file will be applied to the current report.

You can also specify this global format XML export as the default look and feel for blank reports by setting the corresponding server option. For more information about this feature, see Section 1.4.1.3 - Server Options.

4.1.3.9.1.2. Global Formatting & Crosstab Reports

Global formatting is very important when dealing with crosstab reports. Due to the nature of the report, the number of columns can increase or decrease depending on changes in the data, data source, or filtering criteria. When new columns are generated in a crosstab report, they will inherit the default formatting. In order to control the appearance of new columns in a crosstab report, you will need to set the default formatting using global formats.

Global formatting is also important because it controls the intervals in which new columns appear in the report. New columns will appear in intervals defined by the column width in the global formats. Therefore, if you set the default width to be inch, new columns in the crosstab report will appear at one inch intervals. Because of this, it is recommended that you maintain consistent widths for the data columns in a crosstab report. Setting different widths can result in unexpected behavior when new columns are added to the report.

4.1.3.9.2. Group Formatting

To apply formatting to a group of elements, first select a group of elements either by drawing a selection box around them or using CTRL+Click. You can also select a row or column of cells by right clicking on a cell and selecting the Select Column or Select Row option from the pop-up menu.

Once you select the group, format the properties as you would for a single element. Formatting will only take effect on elements where it is applicable. For example, if you select four elements, two labels, a formula, and a chart, and then change the font size, it will have no effect on the chart.

4.1.3.9.3. Applying a Template

The features and elements of any report (.pak, .qrp, .rpt or .xml) file can be applied to another report. This is accomplished using the apply template feature. To apply a template to the current report, select Apply Template from the File menu or click on the Apply Template Button on the toolbar. A dialog box will appear, prompting you to select the file you want to apply. When you apply a template, all of the elements and their respective formatting will be applied to the current report. Only the data source information is not carried over (this includes functions and scripts in the table data section of the report).

Apply Template Dialog

There are two additional options available in the dialog.

Apply Formula and Scripts:

This option will apply the formulaic columns and cell scripts from the template onto the report. By default, they do not apply. Note that formulas and scripts from the template may not work correctly if the data types of the columns in the new report are different from those in the template.

Apply Empty Section:

This option indicates whether or not to apply the blank sections from the template to the report. If you apply blank sections, they will overwrite sections in your report, essentially removing any elements you may have in the section. This option is generally used if you want to completely replicate the template that you are applying with the new report. If you do not apply blank sections, those sections in your report will not be overwritten. Only sections in the template with elements will be applied to your new report. This feature can be used if you have a certain default layout (headers/footers) that you want to pass among a group of reports. You can define a template where only the page headers/footers have defined elements and apply those headers/footers to other reports by selecting not to apply empty sections.

If you would like to have a report that has the same look and feel as another one without replacing the labels, formulas, etc, you can accomplish this by using the global format import/export feature rather than applying an entire template.

4.1.4. The Preview Window

After inserting or manipulating report objects, you can view the results in the Preview window. You can switch back and forth between the Design and Preview windows by using the tabs in the upper left corner of the Report Designer. The Preview window gives you an accurate picture of what the report will look like if it is printed or exported.

Click to view larger image

Preview Window

The Preview shows the page dimensions in inches or centimeters (depending on which unit is selected with the toggle button at the upper left corner of the designer window where the rulers meet). The drop-down menu on the right side of the toolbar allows you to set zooming for the preview.

4.1.4.1. Navigating the Report

You can navigate around the report using the toolbar or the View menu. The toolbar buttons perform the following functions:

Go to the first page of the report

Go to the previous page of the report

Go to a specific page (that you enter in the Page text box)

Go to the next page of the report

Go to the last page of the report

These navigation functions can also be performed by selecting First Page, Previous Page, Next Page, Last Page, or Go To Page... from the View menu.

4.1.4.2. Other Preview Window Options

Other options in the Preview window toolbar perform the following functions:

Save the file

Export the file

Load the entire report in the page viewer window. For more information about this, please see Section 4.1.4.2.4 - Using Page Viewer.

Print the report (this option is not available if the Report Designer is run as applet)

Refresh Data

In addition, the File, and Data menus remain active, allowing you to manipulate the file and data.

4.1.4.2.1. Preview Data Options

You will be presented with the data options dialog the first time you preview a report. This dialog allows you to set several options related to how the Preview window displays report data.

Preview Data Options Dialog

The first option allows you to select whether or not to use live data when previewing the report. If you select live data, the report will connect to the data source and retrieve data every time the report is previewed. Note that if the data cannot be obtained (for example, if the database connection is down), the preview will show an error. You will then need to reload the report (once the connection has been reestablished) or go back to the Preview Data Options and select Use Saved Data. If you select to use saved data, the report will show whatever data it has when you preview the report. This could be either two records of back-up data that are stored in the template, the first twenty records that are retrieved when a report is first created, or the full dataset from the previous preview (if the option had been set to use live data).

If you select to use live data to preview the report, a second option can be set that allows you to limit the number of records that should be retrieved from the data source. If your report uses a large dataset, this option allows you to see the report with data while limiting the processing time and preserving client memory.

Once you set this option the first time a report is previewed, you will not be prompted again when you preview the report. If you want to change these settings, select Set Preview Data Options from Data menu (this option is active only in Design tab). This will bring up the dialog again, allowing you to change the preview settings.

4.1.4.2.2. Sorting Data

You can sort the data within the Preview window based on any column in the report in ascending or descending order. To do this, select ‘Sort by (ascend)’ or ‘Sort by (descend)’ from the View menu. Each option will bring up a secondary menu containing all of the report column fields. Selecting a column field will cause the report to sort by that column in either ascending or descending order. This feature is also available in the Report Viewer applet.

To sort by multiple columns, select Sort By... from the View menu. This will bring up a dialog allowing you to select which columns to sort by and the direction.

Preview Sorting Dialog

To sort by a column, select it in the left side dialog and click the Add button. You can set the sorting direction by selecting the column on the right side and clicking either the Ascending or Descending button.

[Note]Note

Any sorting performed will not be saved with the template. When the template is re-opened (run), the data will use the original order. However, you can export the report after sorting and the exported file will reflect the re-ordered data.

It is not recommended that you use this feature with reports containing a large amount of data, as this will use a large amount of memory and can compromise performance.

4.1.4.2.3. Parameter Prompts

If your report uses a parameterized query or if you have defined any formula parameters in the report, you will be prompted to select parameter values when you preview the report.

Parameter Prompt Dialog

You are prompted to type in or select parameter values depending on how the parameters are mapped. Clicking the Ok button will generate the report using the specified values. You can disable parameter prompting by toggling the Preview Parameter Prompt option in the Data menu. If date variables are not mapped to a database column, the parameter prompt will appear as below, with the options of entering a date from the calendar or a date variable.

Date Parameter Prompt Dialog

For more information about query parameters, see Section 3.1.3.2.2 - Parameterized Queries. For more information about formula parameters, see Section 4.1.6.2.6 - Formula Parameters.

4.1.4.2.4. Using Page Viewer

Generally when you preview the report, the entire report with its data is kept in memory. This allows you to quickly preview and navigate through the generated report. However, for large reports, previewing the entire report could significantly affect system performance as the entire report is loaded into memory. To prevent this problem, you can limit the number of records that are fetched during preview as detailed in Section 4.1.4.2.1 - Preview Data Options.

On the other hand, you may want to preview the entire report without loading it into memory when creating an ad-hoc report. To do this, ReportDesigner allows you to load the report in the Page Viewer. To do this, select Launch Page Viewer from the View menu or click the Launch Page Viewer icon on the toolbar. This will open a Page Viewer window containing the report.

Click to view larger image

Report Shown in Page Viewer Window

The Page Viewer window will show you the entire report. You can navigate around the different pages by clicking the buttons on the toolbar at the bottom of the window or by right clicking and selecting to change pages from the pop-up menu. Because the Page Viewer is a static format, the window will not automatically reflect any subsequent changes made to the report. You will need to close the window and re-launch the Page Viewer. For more information about the Page Viewer, please see Section 7.7 - Page Viewer.

4.1.4.3. Setting Page Properties

The output you see in the Preview window is based on the page dimensions and margins that are set in the Design window. The page dimensions are marked by the rulers, with the shaded areas indicating the page margins. To adjust these properties, select Page Setup from the Option menu. This will bring up a dialog box prompting you to set the page orientation (landscape or portrait), height, width, and margins. Measurements are in inches or centimeters, depending on which metric system is currently selected. Changing the orientation will also change the default print properties.

Page Properties Dialog

4.1.5. Saving and Exporting Reports

After you finish editing the report, you can save it as a template or export it to DHTML, PDF, CSV, Excel (XLS), Excel 2007 (XLSX), Text, XML, or Rich Text format.

4.1.5.1. Saving Reports

You can save the current report by selecting Save or Save As from the File menu, or by clicking the Save button on the toolbar. All reports are saved as templates either in .pak (binary) or XML format. Selecting the save option will simply overwrite the existing file, unless you are working on a new report that has yet to be saved. Selecting Save As option will bring up a dialog box prompting you to create a file name. The Save As dialog also has several checkboxes.

Save As Dialog

Create HTML:

This option will create a HTML page with the Report Viewer or Page Viewer applet embedded. The file will have the same name as your .pak file and it will be placed in HTML directory. By default, the Report Viewer applet is used. For more information about the Report Viewer, please see Section 7.6 - Report Viewer.

Use Page Viewer:

Checking this option indicates that you would like to generate the applet page using the Page Viewer applet instead of the Report Viewer. For more information about the Page Viewer, please see Section 7.7 - Page Viewer.

Use Swing:

This checkbox specifies whether or not to use the swing version of the Report Viewer or the Page Viewer depending on which viewer is selected for the applet page.

Create XML:

This checkbox specifies whether or not to save the report in XML format. By default, reports are saved in binary (.pak) format. When this checkbox is checked, ReportDesigner will generate the template in XML format. The XML file can be saved and re-opened by the Designer. It can also be applied as a template for other reports.

Create Style:

This checkbox specifies whether or not to save the report as a custom style. Reports saved in this format can be applied as a default look and feel to new reports. However, they cannot be used as a report anymore. For more information about this featue, see Section 4.1.2.6.1 - Custom Styles.

Save All Data:

This option will save all of the report data in the template. By default, only two records are saved. This feature is useful if you want to preserve the structure of a crosstab when changing data sources or editing the report without the datasource. It also allows users to share a complete report when the data source is not available. Reports are always opened with backup data in the Report Designer. Users can get the latest data by selecting the "Live Data" option when previewing the report.

4.1.5.1.1. XML Encoding

Both data registry files and report templates in ERES can be saved in XML format. By default, both types of files use the Western European encoding. In order to save data registries (including queries) and report templates correctly in XML, you will need to set the XML encoding to use a different character set. For more information about using this feature, please see Section 10.1.2.4 - XML Encoding.

4.1.5.2. Exporting Reports

You can export the current report to multiple formats directly from the Report Designer. To export a file, select Export from the File menu or click the Export button on the toolbar. This will bring up a second menu allowing you to select the type of file you want to export to: DHTML, PDF, CSV, Excel (XLS), Excel 2007 (XLSX), text, XML, or rich text. You can also export it by clicking the Export File button on the toolbar.

DHTML:

If you select DHTML as the desired export format, you will be prompted to enter the file name and location of the new DHTML file. Because DHTML is a text only format, charts will be saved as separate image files in the same directory as the DHTML file. If your report includes a chart, be sure to set the chart export format before exporting to DHTML, to specify the desired image format and attributes. If your report has images, the image files will be referenced in the DHTML document. DHTML will produce a much more accurate output than HTML; however, not all of the report features will translate accurately in older browsers. Internet Explorer 11, Chrome, Firefox, or Edge are recommended for viewing.

You can specify to export the report to one page, multiple pages, or as a paginated single page. If you specify one page, the entire report will be exported into one DHTML file. If you specify multiple pages, each page of the report will be generated in a new DHTML file. The output pages are linked by a navigation bar on top of each page. If you specify to export as a paginated single page, only one DHTML file will be generated. However, the page size, spacing, and margins will be retained, allowing the report to be printed out of the browser and appearing the same as if printed from a PDF or Report Designer.

You can also specify to use internal or external style sheet (CSS) definitions to apply formatting to the exported DHTML instead of generating style definitions for each report element. For more information about this option, see Section 4.1.5.2.1.1 - PDF Font Mapping Import/Export.

Export to DHTML Dialog

For reports with grouped data (except for Side-By-Side Master & Details reports), you can select to add expand and collapse controls for the grouping. This allows for a more compact presentation of the report. Each grouping can be expanded and/or collapsed depending on the viewing requirement. When selecting this option, you can also choose the initial presentation, i.e. show the report completely collapsed, completely expanded or expanded to a particular group level. You can also choose to enable animation wherein the grouping that is being expanded or collapsed fades in or out of view. Note that the expand and collapse controls can only be selected for single page exports and the controls will not appear if the Section Header or Footer is empty.

You can specify a title for the exported DHTML file. The title will appear as <title> meta elements in the export. To add a title, select Html Page Title from the Option menu. This will bring up a dialog allowing you to enter the title.

PDF:

If you select PDF as the desired export format, you will be prompted to enter the file name and location of the new PDF file. Because PDF format supports images, there will be no separate files created by the export.

You can also set encryption for PDF files. When you check the Encrypt PDF Export box in the export dialog, two new options will appear, allowing you to specify a user and an owner password for the generated document. More encryption options are available when exporting files through the API.

For more information about exporting to PDF, please see Section 8.1.5.7.2 - PDF Exporting Options.

CSV:

CSV export creates a text file of the data used in the current report with a comma field delimiter. If you select CSV as the desired export format, you will be prompted to enter the file name and location of the new CSV file, the Delimiter for the file (either Tab, Space, Double Space, Comma, or Semi-Colon), and the Newline Delimiter (either Windows(\r\n), Mac(\r), Others(\n), System).

[Note]Note

CSV export will only export the data associated with the report and none of the objects and attributes of the report itself.

Excel (XLS):

If you select an Excel spreadsheet as the desired export format, you will be prompted to enter the file name and the location of the new spreadsheet. ReportDesigner generates a formatted Excel output where spacing, fonts, colors, lines, and grids will be applied. Excel exports also include charts and images. Note that charts will be exported as images and thus are not editable in Excel. Any gif, jpeg, and/or png image will be shown in the Excel export. You can use the CSV export to get a plain data dump to Excel.

Excel 2007 (XLSX):

Excel 2007 (XLSX) export creates an XLSX file used in Microsoft Excel 2007 or newer. If you select an Excel 2007 as the desired export format, you will be prompted to enter the file name and the location of the new spreadsheet. ReportDesigner generates a formatted Excel 2007 output where spacing, fonts, colors, lines, and grids get applied. Excel 2007 exports also include charts and images. Again, the charts will be exported as images and thus are not editable in Excel.

If you plan to use Excel functions in the report, you will want to select the option Fit numeric value into a single cell. This option guarantees that each numeric data is exported to its own cell allowing you to use these values in Excel functions. Note that this option will sometimes affect the cell alignment of the exported report.

Export to Excel Dialog

For reports with grouped data, you can select to print each group on a different sheet in the exported file. This option is set in the Section menu for the Group Header section. For more information, please see Section 4.1.3.3 - Section Options.

[Note]Note

Since Excel spreadsheets are a fixed field format, not all report elements may translate correctly.

TXT:

Unlike CSV, which creates a comma delimited data file, the text export feature generates the entire report as a text file. Because the report is exported as pure text, no formatting information is retained. If you select text as the desired export format, you will be prompted to enter the file name and the location of the new text file, the Delimiter for the file (either Tab, Space, Double Space, Comma, or Semi-Colon), and the Newline Delimiter (either Windows(\r\n), Mac(\r), Others(\n), System).

XML:

There are two XML export versions. One is a data file and the other exports report data with formatting information.

Pure Data:

This XML export option exports the data used by the report in XML format. The format of the XML file is the same as the formatting requirements for XML input data.

Data + Format:

This XML export creates an XML version of the whole report. All of the report data as well as formatting information are included. This file is similar to the XML version of the DHTML export and can be used in conjunction with style sheets to display HTML content. This export allows you to export the entire report as one XML file or as a separate file for each page.

Rich Text:

If you select rich text as the desired format, you will be prompted to enter the file name and the location for the new rich text file. ReportDesigner uses the full capability of the RTF 1.5 specifications to generate a rich text output very similar to the actual report. The rich text export may not work in all viewers. By default, ReportDesigner will export all the colors in the RTF export directly into the output. However, older versions of Microsoft Word only support 16 colors. To support these viewers, you can export the RTF using 16 colors. This option will convert the colors used in the report into the basic color palette for Microsoft Word 97.

4.1.5.2.1. PDF Font Mapping

ReportDesigner allows you to use any font on the system for reports. For most formatted exports (DHTML/Rich Text/Excel/Excel 2007) system fonts will translate automatically in the generated output (For Rich Text and Excel/Excel 2007, if the fonts cannot be found, they will default to Arial). However, for PDF you will have to manually specify a .ttf (true type font), .ttc (true type collection), .pfb, or .afm file for any system font that you would like to use in the report.

To set font mapping for the PDF export, select Font Mapping from the Option menu. This will bring up a dialog allowing you to specify font files.

Click to view larger image

Font Mapping Dialog

You can select a specific .ttf, .ttc, .pfb, or .afm file for each font and style combination. You can either type the full path or browse to the font file. If you are using a .ttc file, you will need to specify the font index in the box provided (.ttc files contain more than one font). Once you specify the correct file, click the Add button to save the mapping to the list. You can edit or delete existing mappings by selecting them in the list and clicking the appropriate button.

4.1.5.2.1.1. PDF Font Mapping Import/Export

You can pass the font mapping from one report to another using the Import/Export feature. You can export the font mapping by clicking the Export button on the font mapping dialog. This will bring up a dialog box prompting you to specify a file name. The font mapping will then be saved as XML file. You can load a font mapping XML file by selecting the Import option from the dialog. This will bring up a dialog box prompting you to specify the XML file that you want to import. Click the OK button and the mapping stored in the XML file will be applied to the current report.

4.1.5.2.2. CSS Options

When exporting a report to DHTML, the style definitions are created for each element in the report by default. This makes the export faster. However, it can result in a very large file size for large reports. To limit the size of the generated DHTML file, users can select to generate an internal list of global style definitions. This option is slightly slower, but it produces a significantly smaller file. In addition, ReportDesigner provides an option that allows users to apply their own style definitions to report elements by selecting a .css file when exporting the report.

If you are going to use external style sheet definitions, you will need to first select the class name from the external style definitions that should be associated with elements in the report. To set the class for a report element, right click on the cell and select Set Style Class Name from the pop-up menu. This will bring up a dialog allowing you to specify a style name for that report element.

Set Style Class Dialog

Elements for which you do not select a style class will generate their own style based on the settings in the report when the report is exported to DHTML.

Users can also export a .css file for the formatting defined in the report. These style definitions are the same as generated by the internal style sheet option. This feature can be used to apply formatting created in the Report Designer to other reports or other web pages. To export a .css file from a report, select Export Style Sheet from the Option menu. A dialog will open, prompting you for the name and location for the generated file.

CSS options can be set in the export dialog for the DHTML export.

DHTML Export Dialog

The Use External Style Sheet option allows you to specify the location (either relative path or full HTTP path) of a .css file which contains the definitions for the style classes that you have assigned to report elements.

[Note]Note

The formatting from an external style sheet file will only be applied to the DHTML export. Other export formats will use the formatting defined in the report template.

4.1.6. Using Formulas & the Formula Builder

ReportDesigner supports a wide variety of formulas, giving you an important mechanism for manipulating and displaying report data. Using formulas, users can add summaries and aggregations, perform basic calculations, and build complex expressions using one of over 70 built-in functions.

[Note]Note

Some of the syntax for ReportDesigner formulas has changed greatly between v2.51 and v3.0. In most cases, the deprecated syntax will continue to work correctly. However, it is recommended that you check older templates to make sure the functions still return correctly if you have upgraded to v3.0 or higher from v2.51 or lower.

4.1.6.1. Creating a Formula

When you select to insert a new formula into the report (either by selecting Insert Formula from the Insert menu or clicking the Insert Formula button on the toolbar), a list of all the defined formulas in the report will appear.

Formula List Dialog

To insert a formula into the report, select a formula from the list and click the Insert button. The formula list dialog will then close and you will be allowed to place the formula.

The report section in which you place the formula is extremely important, since the formula will reset each time that section repeats in the report. For example, if you place a formula in the Group Footer of a summary break report, the formula will recalculate for each group in the report. If the formula references a column value, it will only use data within each break group. If you place the same formula in the Report Footer section, it would only calculate once and it would use all of the data in the column field, regardless of breaks and grouping.

Formulas and labels that are placed in the Table Data section of the report become computed columns and can be treated as column fields as well as formulas.

[Note]Note

Labels are automatically treated as Strings and can be edited by double clicking on them (i.e. to use a number as integer in a formula, open the formula builder and remove double quotes from the number).

4.1.6.1.1. The Formula Builder

Formulas are constructed using the Formula Builder interface. To launch the Formula Builder, you can select to create a new formula by selecting New from the formula list dialog. This will prompt you to specify a name for the new formula. Once you specify a name, the Formula Builder will open, allowing you to construct a formula. You can also use the Formula Builder to edit an existing formula. To edit a formula, select it from the list and click the Edit button or double-click on a formula cell in the Design window.

Click to view larger image

Formula Builder Window

The main window of the Formula Builder contains the text of the formula. The folders on the right side contain various elements that can be added to the formula, including column fields, other formulas, parameter values, database fields, and built-in functions. The first two rows of buttons contain the most common arithmetic and Boolean operators (operators and functions are discussed in the next section). The last two rows of buttons serve as command buttons and perform the following functions:

Insert Font:

This option is not available for formulas, it is only available for scripting.

Insert Color:

This option is not available for formulas, it is only available for scripting.

Browse Data Field:

This option is for database fields. It will query the database and return the first 20 values for the column.

Initialize Parameter:

This option will bring up the parameter initialization dialog for any parameters defined in the formula. Parameters are discussed in Section 4.1.6.2.6 - Formula Parameters.

Test:

This option will check the current formula and see if it is correct.

Ok:

This opton will close the formula builder and return to the formula list dialog, allowing you to insert the formula into the report.

Save As:

This option allows you to save the current formula under a different name. Because you can re-use a formula in different places in the report, using the save as option allows you to modify a formula in one place, without changing it for every place where the formula is referenced.

Cancel:

This option will close the Formula Builder without saving the formula/changes.

4.1.6.2. Formula Syntax

The following section details various operators and functions available in ReportDesigner and how to use them.

4.1.6.2.1. Using Column Field Data

You will often want to use data from column fields for your formulas. This can be easily accomplished in formulas using the following syntax: {<Field Name>}. The braces delimit the field and the field name is the name of the column field you're referencing. So in a basic example: {UnitPrice} * {Quantity} would multiply two column fields together.

In most cases, the column name is the name specified in the data source (i.e. the database column name or alias). If you are uncertain about the correct name, you can simply select the column field you want to use from the Columns node in the right panel in the formula builder.

There are two other functions you can use to retrieve column data:

id()

This option will allow you to retrieve the value of any cell in the report, including column fields. The syntax is id( <Object ID>). You can retrieve an object's ID by right clicking on the cell and selecting Properties from the pop-up menu. You can also retrieve the ID for column fields by selecting View Column Mapping from the Data menu.

You can also assign a custom ID to elements in the report, instead of using the default ID. To assign a custom ID to an element, right click on it in the Report Designer and select Custom ID from the pop-up menu. This will bring up a dialog allowing you to enter an ID for that element. The argument for the id() function can either be the original ID for the element or the defined custom ID.

Element IDs can also be used to get a handle to an element in the Report API. You can pass in either the original ID or the custom ID into the getData() method to get a handle to an element.

The id() function also serves another important purpose. It can be used to delay the calculation of computed columns. Normally, formulas in the Table Data section of the report will compute prior to any aggregations in the group or table footers. However, sometimes you may want to calculate the aggregations prior to the column fields. For example, you want to create a column that calculates each row's percentage of a total. In order to get the correct result, the total has to be calculated before the column. To do this, simply refer to the aggregation in the Table/Group Footer using the id() function. The finished function in the Table Data section would look like this: {Quantity} / id(TBL0_FTR_FORM0).

col()

This option is a deprecated function that is used in earlier version of ReportDesigner to retrieve data from column fields. Although this function is still valid, it is recommended that you use the new field notation. The syntax for this function is col(Column Index). To view the column index, select View Column Mapping from the Data menu. This will display the assigned index number for each column field. Index values are assigned based on the order in which the columns are selected for the report. The first column has an index of 0.

4.1.6.2.1.1. Column Aggregation

You can aggregate any column field (including computed columns) using one of the aggregation functions provided with ReportDesigner. The following aggregation options are available:

average()

This option returns the mean value of the specified column. The syntax is average(<Column Field>). To return the average value of a column field named UnitPrice, you can use the following formula: average({UnitPrice}).

median()

This option returns the median value for the specified column. The syntax is median(<Column Field>). If the median of the column is two values (for an even number of rows), the aggregation will return the average of the two values.

count()

This option returns a count of the values in the specified column. The syntax is count(<Column Field>).

countdistinct()

This option returns a count of all the distinct values in the specified column. The syntax is countdistinct(<Column Field>).

max()

This option returns the maximum value for the specified column. The syntax is max(<Column Field>).

min()

This option returns the minimum value for the specified column. The syntax is min(<ColumnField>).

stddev()

This option returns the standard deviation for the specified column. The syntax is stddev(<Column Field>).

sum()

This option returns the sum of the specified column. The syntax is sum(<Column Field>).

sumsquare()

This option returns the sum of squares for the specified column. The syntax is sumsquare(<Column Field>).

variance()

This option returns the variance for the specified column. The syntax is variance(<Column Field>).

It is important to note that aggregation functions can only take column fields as an argument. You cannot use an expression or another function as an argument. Therefore, sum({UnitPrice}*{Quantity}) is not valid. To make this calculation, you would first need to add {UnitPrice}*{Quantity} as a formula in the Table Data section of the report. Then you can sum the computed column created by the first formula using sum(@formulaname).

4.1.6.2.2. Using Formulas

ReportDesigner allows you to easily re-use report formulas by plugging them directly into new formulas. You can refer to a formula using the following syntax: @<FormulaName>. The formula name is the name that was assigned to the formula the first time it was created. So for example if you created a formula {UnitPrice}*{Quantity} called Total, you could retrieve the result of this formula by typing @Total.

If you are uncertain about the correct name, you can simply select the formula you want to use from the Formulas node in the right panel of the Formula Builder.

You can also use this notation to aggregate computed columns if the formula has been placed in the Data Table section of the report.

4.1.6.2.3. Using Parameter Values

In addition to column field and formula values, you can also access parameter values as part of a formula. Parameter values are the user supplied values to either query or formula parameters. For more information about query parameters, see Section 3.1.3.2.2 - Parameterized Queries. For more information about formula parameters, see Section 4.1.6.2.6 - Formula Parameters.

To refer a parameter value, use the following syntax :<ParameterName> for query parameters and ?<ParameterName> for formula parameters. For example, if the report has a query parameter named StartDate that prompts the user to supply a date, :StartDate will return the date that the user has supplied when the report is run.

If you are uncertain about the correct name, you can simply select the parameter you want to use from the Parameters node in the right panel of the Formula Builder. Also, if you type a formula parameter name wrong, the Formula Builder will assume that you are trying to define a new parameter.

4.1.6.2.4. Using Database Fields

If your report uses a database as the data source, you can also use database fields that were not selected for the report in a formula. Database fields are referenced in a similar manner to column fields and use the syntax {<Table Name>.<Field Name>}. If your database requires three part names, the fields should be referenced accordingly.

You can select database fields to add from the Database Fields node in the right panel of the Formula Builder. In addition, the Formula Builder allows you to preview database fields. To do this, first select a field in the right panel and then click the Browse Data Field button. This will bring up a new dialog showing the first few rows from the selected column.

4.1.6.2.5. Constants

When using constants in formulas, there are certain formats that are required for each data type.

Numeric Data:

To represent a numeric constant, you simply have to type the number. Both integers and decimals can be accepted; however, you cannot type in thousands separators. So to specify the number 12.28 as a constant in a formula, type 12.28.

String Data:

To represent a string constant, type the string delimited with double quotes. For example, to specify a string Hello, you would type "Hello".

Boolean Data:

To represent a Boolean constant, type either true or false without any delimiters. To specify a false Boolean value, you would type false. Note that these are not case sensitive.

Date Data:

To represent a date constant, type the date in the following format without delimiters: MM/dd/yyyy. To specify the date August 5th, 2002, you would type 08/05/2002.

Time Data:

To represent a time constant, type the time in the following format without delimiters: hh:mm:ss. To specify the time 2:30 PM, you would type 14:30:00. Note that time must be in 24-hour format.

Timestamp Data:

To represent a timestamp constant, type the date and time in the following format without delimiters: MM/dd/yyyy hh:mm:ss. To specify the time stamp August 5th, 2002 at 2:30 PM, you would type 08/05/2002 14:30:00.

4.1.6.2.6. Formula Parameters

Rather than adding constants into a formula, you can specify a parameter. Using a parameter, you can collect constant values from the user (or elsewhere) at run-time and dynamically compute the formula based on those values. To specify a parameter in the formula, use a question mark ? followed by the parameter name.

For example, the following formula {Quantity}+?Value would add a user supplied value to the Quantity field in a report.

[Note]Note

If you want to define a new parameter within a formula, you have to use a unique name. If you specify a parameter name of a parameter that is already defined in another formula within the report, the new formula will return the value from the previous parameter.

4.1.6.2.6.1. Initializing Formula Parameters

Like query parameters (detailed in Section 3.1.3.2.2.2 - Initializing Query Parameters), you must initialize a formula parameter before a formula can be used in a report. To initialize any parameters defined in the current formula, click the Initialize Parameter button in the Formula Builder. This will bring up a dialog prompting you to specify options for the parameter.

Initialize Formula Parameter Dialog

From this dialog, you can specify a default value for the parameter, map the parameter to a report column (this will give the user a drop-down list of distinct values, rather than having them type in the parameter), specify the data type for the supplied parameter, as well as specify the prompt for the end user. Clicking the Previous Parameter and Next Parameter buttons allows you to initialize each of the parameters that have been defined in the formula. Click OK when you finish setting up the options for all parameters.

[Note]Note

For formula parameters, you must specify a default value for each parameter. Also, if the parameter is mapped to a report column, the first time the report is previewed, the dialog will only contain the first twenty values of that column. This is because the full dataset is not retrieved when the report is first created. At run-time, the dialog will contain all the available values in the report column.

4.1.6.2.7. Operators

ReportDesigner provides several arithmetic and Boolean operators that allow you to create expressions in formulas. Operators use in-fix notation that places the operator between arguments in the expression, i.e. <argument1> <operator> <argument2>.

You can automatically insert operators into a formula by clicking one of the operator buttons in the formula builder.

4.1.6.2.7.1. Arithmetic Operators

Four basic arithmetic operators are supported: +, -, *, and, /. These will add, subtract, multiply, and divide two objects respectively. For example 1 + 2 will return 3.

Generally, arithmetic operators will take numbers as arguments and will return numbers with two exceptions. + can be used to concatenate strings, for example Hello + "World" would return Hello World. Also, - can be used to subtract two date objects and return the difference in days, for example 8/2/2002 - 4/7/2002 would return 117.

4.1.6.2.7.2. Boolean Operators

Eight Boolean operators are supported: AND, OR, ==, <, <=, >, >=, and <>. AND and OR take Boolean arguments and return Boolean values. For example true AND true would return true or 1 < 2 OR 4 < 3 would return true.

==, <, <=, >, >=, and <> are comparison operators that signify equal to, less than, less than equal to, greater than, greater than equal to, and not equal respectively. Comparison operators compare two objects of the same data type and will return a Boolean value, for example 3 < 4 would return true and Yes == "No" would return false.

Boolean operators are more commonly used in cell scripting rather than formulas. Cell scripting is covered in Section 4.1.7 - Scripting.

4.1.6.2.8. Functions

In addition to the basic operators, ReportDesigner provides a number of built-in functions. Function syntax generally takes the form of a function name outside of a set of parenthesis enclosing the comma-separated arguments function(<argument>, <argument>).

You can insert functions into the formula by selecting the function you want under the Numeric Functions, String Functions, or Date Functions nodes in the Formula Builder. Functions are inserted with hints indicating the type and number of arguments it should take. In order for the function to return properly, these hints have to be removed and replaced with valid arguments.

4.1.6.2.8.1. Numeric Functions

The following functions take numeric arguments.

abs()

This option will return the absolute value of a number. The syntax is abs(<Number>). For example abs(-12) would return 12.

acos()

This option will return the arc cosine of an angle, in the range of 0 through pi. Syntax for this is acos(<radians>). For example, acos(-sqrt(2)/2) would return 3*pi/4.

asin()

This option will return the arc sine of an angle in the range of -pi/2 through pi/2. The syntax is asin(<radians>). For example, asin(sqrt(2)/2) would return pi/4.

atan()

This option will return the arc tangent of an angle in the range of -pi/2 through pi/2. The syntax is atan(<radians>). For example, atan(1) would return pi/4.

atan2()

This option will convert rectangular coordinates (b, a) into polar coordinates (r, theta). This function returns theta by taking the arc tangent of b/a in the range of -pi to pi. The syntax is atan2(<y_coordinate>, <x_coordinate>). For example atan2(1,0) would return pi/2.

ceil()

This option will return the lowest integer value that is greater than the specified number. The syntax is ceil(<Number>). For example, ceil(15.3) would return 16.

cos()

This option will return the cosine of an angle in radians. The syntax is cos(<radians>). For example cos(3*pi()/4) would return -sqrt(2)/2.

e()

This option will return the value e, the natural logarithm base. The syntax is e() without any arguments.

exp()

This option will return e raised to the nth power. The syntax is exp(<Number>). For example exp(3) would return e^3 or 20.086.

factorial()

This option will return the factorial of the specified object. The syntax is factorial(<Number>). For example factorial(3) would return 6.

floor()

This option will return the highest integer value that is less than the specified argument. The syntax is floor(<Number>). For example floor(5.52) would return 5.

getColumnCount()

This option will return an integer indicating the total number of columns in the report. The syntax is getColumnCount() without any arguments. This function returns the total number of columns whether they are visible or not.

getRowIndex()

This option will return an integer indicating the index value of the current row (of Table Data) of the report. The syntax is getRowIndex() without any arguments.

getTotalRowIndex()

This option will return a count of all the rows (in Table Data) in the report. The syntax is getTotalRowIndex() without any arguments.

getRowIndexOfCurrentTable()

This option will return the current row in the current group (table) in a report. This function is generally only relevant in reports that have grouped data like the summary break and master & details layout. For example, if the current row is the third row in a group of data, getRowIndexOfCurrentTable() will always return 2 regardless of what the row index is for the total report (which you could retrieve using the getRowIndex() function). The syntax is getRowIndexOfCurrentTable() without any arguments.

getTotalRowIndexOfCurrentTable()

This option will return a count of all the rows in the current group (table) in a report. This function is generally only relevant in reports that have grouped data like the summary break and master & details layout. The syntax is getTotalRowIndexOfCurrentTable() without any arguments.

getSiblingCount()

This option will return a count of the number of sibling groups within a nesting level. This function is generally only relevant in reports that have grouped data like the summary break and master & details layout. For example, you have a summary break report with one level of grouping. There are three distinct values in your row break column creating three groups at the level. Within the group (i.e. Group Header, Table Data, or Group Footer sections) getSiblingCount() would return 3. The syntax is getSiblingCount() without any arguments.

getChildCount()

This option will return a count of the number of child groups inside a nesting level. This function is generally only relevant in reports that have grouped data like the summary break and master & details layout. The function will return the number of child group in outer most group when running in a table header or a table footer; It will return the number of child in the related group when running in a group footer/header. For example, you have the same example as described for the previous function. Within the group, the getChildCount() function would return 0 as there is only one level of grouping. However, outside the group (i.e. Table Header or Table Footer sections) getChildCount() would return 3. The syntax is getChildCount() without any arguments.

getGroupIndex()

This option will return an integer indication the index value of the current group. This function is only relevant in reports that have grouped data like the summary break and master & details layout. This function will only return the index of the inner most group for reports with nested groups.

log()

This option will return the natural logarithm of the specified number. The syntax is log(<Number>). For example log(10) would return 2.303.

mod()

This option will return the remainder after dividing two numbers. The first argument is the numerator and the second is the denominator. The syntax is mod(<Number>, <Number>). For example mod(12, 7) would return 5.

pi()

This option will return the value pi. The syntax is pi() without any arguments.

pow()

This option will return the value of the first argument raised to the power of a second argument. The syntax is pow(<Number>, <Number>). For example pow(2, 3) would return 8.

random()

This option will return a random value greater than or equal to 0 and less than 1. The syntax is random() without any arguments.

rint()

This option will round the specified argument to the nearest integer. The syntax is rint(<Number>). For example rint(5.6) would return 6.

sin()

This option will return the sine of an angle in radians. The syntax is sin(<radians>). For example sin(pi()/2) would return 1.

sqrt()

This option will return the square root of the specified number. The syntax is sqrt(<Number>). For example sqrt(64) would return 8.

tan()

This option will return the tangent of an angle in radians. The syntax is tan(<radians>). For example, tan(pi()/4) would return 1.

toDegrees()

This option will convert an angle measured in radians to degrees. The syntax is toDegrees(<Number>). For example, toDegrees(pi()) would return 180.

toRadians()

This option will convert an angle measured in degrees to radians. The syntax is toRadians(<Number>). For example, toRadians(180) would return 3.142.

toString()

This option will convert a number into a string. The syntax is toString(<Number>, <Number of Decimals>, <Round Up(True/False)>). For example toString(12.216, 2, True) would return "12.22" as a string.

4.1.6.2.8.2. String Functions

The following functions take string arguments:

getAllRowData()

This option returns whole row of data in a format like (COLUMN1_NAME) VALUE1 (COLUMN2_NAME) VALUE2 ... Does not require any arguments.

getHeader()

This option will return the column name for a column field. The syntax is getHeader(<Column Field>). For example, if you have a column named UnitPrice, getHeader({UnitPrice}) would return UnitPrice as a string.

getPage()

This option will return the current page number. The syntax is getPage() without any arguments.

getTotalPages()

This option will return the total number of pages for the current report. The syntax is getTotalPages() without any arguments.

getTotalSections()

This option will return the total number of sections (i.e. the number of pages needed horizontally) for the current report. The syntax is getTotalSections() without any objects.

indexOf()

This option will return the first index value where a specified pattern within a string occurs. There are two syntaxes for this function.

  1. indexOf(<String>, <Pattern>). For example indexOf("Banana", "an") would return 1.

  2. indexOf(<String>, <Pattern>, <Starting Index>). For example, indexOf("Banana", "an", 2) would return 3.

insert()

This option allows you to insert new characters into a string. The syntax is insert(<String>, < Character Number>, <New Characters>). For example insert("Wood Natural Furniture", 4, "View") would return WoodView Natural Furniture.

lastIndexOf()

This option will return the last index value where a specified pattern within a string occurs. There are two syntaxes for this function:

  1. lastIndexOf(<String>, <Pattern>). For example lastIndexOf("Banana", "an") would return 3.

  2. lastIndexOf(<String>, <Pattern>, <Starting Index>). For example, lastIndexOf("Banana", "an", 2) would return 1.

replace()

This option allows you to replace one set of characters in a string with another. There are two syntaxes for this function.

  1. replace(String, Character Start Number, Character End Number, New Characters). For example, replace("Today is a rainy day", 11, 16, "sunny") would return Today is a sunny day.

  2. replace(<String>, <Old Characters>, <New Characters>). For example, replace("Today is a rainy day", "rainy", "sunny") would return Today is a sunny day.

setMaxLength()

This option allows you to set the maximum length of a string. The syntax is setMaxLength(<String>, <Maximum Number of Characters>). For example, setMaxLength("You're a firefighter",13) would return You're a fire.

strcmp()

This option compares two strings and returns the lexicographical difference between them. If the first argument is larger than the second one, the result is positive. If the first argument is smaller than the second one, the result is negative. If the strings are same, the result is zero. The syntax is strcmp(<String>, <String>). For example, strcmp("a", "c") would return -2.

strcmpIgnoreCase()

This option compares two strings and returns the lexicographical difference between them while ignoring case. The syntax is strcmpIgnoreCase(<String>, <String>). For example, strcmpIgnoreCase("a", "A") would return 0.

strcat()

This option concatenates multiple strings together. The syntax is strcat(<String>, <String>, <String>...). For example strcat("Wood", "View") would return WoodView. You can also use the "+" operator to concatenate strings.

strlen()

This option will return an integer indicating the number of characters in a specified string. The syntax is strlen(<String>). For example strlen("ReportDesigner") would return 14.

substring()

This option will return a portion of a string as specified by an argument. There are two syntaxes for this function:

  1. substring(<String>, <Character Start Number>). For example, substring("unhappy", 2) would return happy.

  2. substring(<String>, <Character Start Number>, <Character End Number>). For example substring("smiles", 1, 5) would return mile.

trim()

This option will remove any leading or trailing spaces from the specified string. The syntax is trim(<String>). For example, trim(" Hello ") would return Hello.

toLowerCase()

This option will render any uppercase letters within the specified string to lowercase. The syntax is toLowerCase(<String>). For example toLowerCase("ABCdef") would return abcdef.

toNumeric()

This option will turn a string into a double. The syntax is toNumeric(<String>). For example toNumeric("425.52") would return 425.52. For this formula to work correctly, the string argument must contain numeric characters.

toUpperCase()

This option will render any lowercase letters within the specified string to uppercase. The syntax is toUpperCase(<String>). For example toUpperCase("ABCdef") would return ABCDEF.

4.1.6.2.8.3. Date/Time Functions

The following functions use date/time arguments. Some of the date/time functions use a special argument that indicates a calendar field. To specify a calendar field argument, type one of the following without any delimiters.

ERADAY_OF_MONTHHOUR
YEARDAY_OF_YEARHOUR_OF_DAY
MONTHDAY_OF_WEEKMINUTE
WEEK_OF_YEARDAY_OF_WEEK_IN_MONTHSECOND
WEEK_OF_MONTHAM_PMMILLISECOND
addTime()

This option adds a specified amount of time to a given date/time. The syntax is addTime(<Date/Time>, <Calendar Field>, <Number>). The number specifies the amount that the calendar field should be added to the date/time object. For example, addTime(12/5/1998, MONTH, 5) would return May 5, 1999, and addTime(12/5/1998, DAY_OF_MONTH, -25) would return Nov, 10 1998.

getAmPm()

This option will return AM or PM as a string for a given time. The syntax is getAmPm(<Time>). For example, getAmPm(13:24:00) would return PM.

getCurrentDate()

This option will return the current date from the system. The syntax is getCurrentDate() without any arguments.

getCurrentDateTime()

This option will return the current date and time from the system. The syntax is getCurrentDateTime() without any arguments.

getCurrentTime()

This option will return the current time from the system. The syntax is getCurrentTime() without any arguments.

getDateTime()

This option will return the value of a specified calendar field for a given date/time. The syntax is getDateTime(<Date/Time>, <Calendar Field>). For example, getDateTime(12:24:00, MINUTE) would return 24, and getDateTime(10/10/2001, DAY_OF_WEEK) would return 4 (meaning Wednesday).

getDayDifference()

This option will return the difference in days as an integer between two dates. The syntax is getDayDifference(<Date>, <Date>). For example, getDayDifference(5/1/2001, 3/1/2001) would return 61. You can also use the "-" operator to return the difference between dates.

getDayOfWeek()

This option will return the day of the week for the specified date. The syntax is getDayOfWeek(<Date>). For example, getDayOfWeek(10/10/2001) will return Wednesday as a string.

getWeekOfYear()

This option will return the week of the year for the specified date. The syntax is getWeekOfYear(<Date>). For example, getWeekOfYear(10/10/2001) will return 41.

getEra()

This option will return the era for the specified date. The syntax is getEra(<Date>). For example, getEra(10/10/2000) would return AD as a string.

getMonth()

This option will return the month for the specified date. The syntax is getMonth(<Date>). For example, getMonth(10/10/2000) would return October as a string.

rollTime()

This option is a time rolling function. The syntax is rollTime(<Date/Time>, <Calendar Field>, <Number>). Unlike the addTime() function, this function will only adjust the specified calendar field by the specified amount and will have no effect on the other fields. For example rollTime(12/5/1998, MONTH, 5) would return May 5, 1998, and rollTime(12/5/1998, DAY_OF_MONTH, -25) would return Dec 11, 1998. For the latter example, when the count reaches the beginning of the month, it starts over at the end without changing the month field.

printDate(), printDateTime(), printTime()

These three functions allow you to set the way in which date/time information is displayed beyond what is capable using the data formatting options. These functions will return date and/or time information as a string. Their syntax is as follows:

printDate(Date, Date Format)
printDateTime(Date, Date & Time Format)
printTime(Time, Time Format)

The date and/or time format is entered as a series of characters and delimiters. Letters are used to represent different elements of date/time data. The characters and what each of them represent are listed below:

CharacterRepresentsOutput (text/number)Example
GeratextAD
yyearnumber1996, 96
Mmonth in yeartext or number (dependson length)July, Jul, 07
dday in monthnumber10
hhour am/pm (1-12)number1
Hhour 24 hr. (0-23)number18
mminute in hournumber30
ssecond in minutenumber55
Smillisecondnumber978
Eday in weektextTuesday, Tue
Dday in yearnumber189
Fday of week in monthnumber2 (as in 2 nd Wed. in July)
wweek in yearnumber27
Wweek in monthnumber2
aam/pm markertextAM, PM
khour 24 hr (1-24)number24
Khour am/pm (0-11)number0
ztime zonetextPacific Standard Time, PST

You can piece together almost any combination of these characters to produce a date expression in any format you want. The count of groups of characters determines the form that the element will take. For text elements with four or more characters in a group, the full form of the element will be used. If less than four characters are used, the short form will be used, if it exists. For example EEEE would return Monday and EE would return Mon. For month M which can be displayed as either text or a number, four or more in a group will display the full version, three will display the abbreviation, and two or less will display the number form.

For numeric elements, the count of characters is the minimum number of digits that the element will take. Shorter numbers will implement leading zeros. For example if the day of the date is 2, dd would return 02 and d would return 2.

Any character that is not a-z or A-Z like ;, :, @, etc can be inserted anywhere within the string expression and will display as they are entered. You can also insert words and expressions by enclosing them within single quotes (type two single quotes to insert an apostrophe as text). Several examples are listed below:

printDateTime(10/10/2001 21:15:12, "MMMM dd, yyyy 'at' hh:mm a z") would return October 10, 2001 at 9:15 PM PDT

printDate(10/10/2001, "EEE MMM dd'th', yyyy") would return Wed Oct 10th, 2001

printTime(13:22:12, "h 'o''clock' m 'minutes and' s 'seconds'")would return 1 o'clock 22 minutes and 12 seconds

printDateTime(10/10/2001 13:22:12, "MM/dd/yy HH:mm:ss") would return 10/10/01 13:22:12

If you do not enter any information for the date/time format, the date will display as yyyy-mm-dd and the time will default to HH:mm:ss.S. So printDateTime(10/10/2001 13:22:12) would return 2001-10-10 13:22:12.0.

toDate()

This option will convert a long integer into a timestamp. The syntax is toDate(<Number>). For example, toDate(1025039526306) would return Jun 25, 2002 2:12:06 PM.

4.1.6.2.8.4. Table Data Functions

The following functions take numeric arguments:

.row()

This option will return a value of a column field according to the row index. To do this, you can append a column field with the following syntax: .row(Row Index). The row index is the index value associated with each row in a report starting with 0. For example {ProductName}.row(3) would return the fourth value of the ProductName field.

.getScriptValue()

This option will return value of a column field according to the row index after applying script. If there is no script applied on the column, it returns the same value as .row(). See Section 4.1.7.2.9 - Accessing Values Computed by Other Scripts for more details.

4.1.6.2.8.5. Other Functions

The following functions take string arguments:

first()

This option will return the first value of a column field. The syntax is first(<Column Field>). For example first({UnitPrice}) would return the first value of the UnitPrice field.

last()

This option will return the last value of a column field. The syntax is last(<Column Field>). For example last({UnitPrice}) would return the last value of the UnitPrice field.

4.1.6.2.8.6. Custom Functions

In addition to the functions provided with ReportDesigner, it is also possible to include your own custom functions in the Formula Builder when launching the Report Designer via API. Every Java function is supported. For more information about this feature, please see Section 8.1.5.8.6 - Open Report Designer with Custom Functions.

4.1.6.3. Subreport Formula Access

A main report can access its sub-reports’ columns and formulas and use them as its own by using the prefix SUB# where # is the number of the subreport, beginning with 1. For example, the syntax to access the column UnitPrice from sub-report 1 is: SUB1.{UnitPrice} or SUB1.COL(i) where i is the column number of UnitPrice. Syntax to access the formula Sales from sub-report 1 is: SUB1.@Sales.

[Note]Note

Accessing a subreport column (i.e. SUB1.{UnitPrice}) returns a single value - the value from the first row of the column. You can get the value at a particular row by appending .row(index) at the end where index is the row number beginning with 0, but it will always only return a single value.

In the formula builder’s help panel, under both Columns and Formulas, there is a folder for each subreport:

Sub-report columns and formulas can be used to build more complex expressions or scripts (i.e. SUB1.@Total + SUB2.@Total).

Although sub-report columns and formulas can be used in complex expressions, sub-report columns and formulas cannot be used in aggregation funtions (SUM, COUNT, MAX, AVERAGE, etc). For example, SUM({UnitPrice}) is a valid formula, but SUM(SUB1.{UnitPrice}) is not. To accomplish this, instead create a formula SUB1.{UnitPrice} and add it as a column into the main report. Then create a second formula which applies aggregation to the first formula (i.e. SUM(@sub_total)).

Although the main report can access any of the sub-report's columns or folders, sub-reports cannot access the main report's or any other sub-report's columns or formulas.

If a sub-report formula or column that is used by the main report is deleted, the formula in the main report will display a NULL value when running the report and script will not be applied.

For example, if product information is spread across several databases, but you would like to sum up all the units in stock across the three databases, you could create one main report, add several sub-reports and then create a formula to insert to the report footer adding up all the units in stock. To demonstrate this feature, open a report created from the Inventory XML file with the fields Category Name, Product ID, Product Name, Unit Price, and Units In Stock. Proceed to add subreports to it, one from the Woodview Access database, and one from the Woodview HSQL database, containing the same fields.

Within each subreport, as well as within the main report itself, create a formula called UnitsInStock, SUM({UnitsInStock}). Then you can create an ultimate formula within the main report using these three functions:

Click to view larger image

Creating a Formula Using Sub-report Formulas

This formula will take the formula values from each of the three reports and add them together to calculate the final value.

This feature is also applicable to linked sub-reports, although the application of it is different. For example, if you create a summary break report containing customer addresses with a sub-report in the group footer detailing all purchases made by that particular customer, you can sum up all the sales info within the main report.

First, create a formula within the sub-report entitled Sum_Sales which sums up all the sales in the sub-report. Return to the main report and create a formula sub_total, which is simply SUB1.@Sum_Sales. Insert it into the Table Data Section. It can be made invisible if you want to, but it must be in the Table Data Section. Then create a second formula in the main report, total, SUM(@sub_total). This formula is added to the report footer and will sum up all the sales columns from all of the sub-reports.

4.1.7. Scripting

Cell scripting or conditional formatting allows you to dynamically modify certain object properties when specific conditions are met. Scripting allows you to highlight certain data values and to present a report that is easier to read. A simple example of this would be a report showing financial results or cash flows. Scripting could be applied to a column field so that negative numbers are shown in red, dynamically highlighting areas of revenue or cash shortages.

In ReportDesigner, scripts are element specific, meaning that in order to dynamically change the properties of a report cell, a script must be applied to that specific cell. Scripts can be applied to labels, column fields, formulas, or report sections.

[Note]Note

Some of the syntax for ReportDesigner cell scripts has changed greatly between v2.51 and v3.0. In most cases, the deprecated syntax will continue to work correctly. However, it is recommended that you check older templates to make sure the scripts still function correctly if you have upgraded to v3.0 or higher from v2.51 or lower.

4.1.7.1. Creating a Script

To create a script, first select a cell you want to apply the script to and then select Scripting from the Format menu or click the Scripting button on the toolbar. This will bring up a list of all the scripts that have been defined within the report.

Script List Dialog

Like formulas, scripts are maintained on a report wide basis and can be re-used in multiple places in the report. However, unlike formulas, scripts cannot be inserted into the report, they can only be applied to existing report elements. A star next to a script name in the list indicates that the script is applied to the current cell.

From this dialog, you can edit an existing script, create a new script, rename a script, delete a script, apply a script to the current element, and remove a script from the current element. If a script is being used, it can still be deleted (a message will appear asking if it is ok to proceed) and the script is first removed from any cell before being deleted. If the script is used by a security level, the script has to be removed manually first before it can be deleted. To apply a script to the currently selected report element, select a script from the list and click the Apply button. The script list will close and the script will be applied.

Any report element that has a script applied will have a small check mark in the upper left corner of the cell. Scripts will not execute until you preview or export the report.

Script Indicators in Design View

If you select to create a new script by clicking the New button from the script list dialog, you will be prompted to specify a name for the new script. Once you specify a name, the Formula Builder will open, allowing you to construct a script.

Formula Builder (Scripting)

Scripts are developed in the same formula builder interface as formulas. Although scripts use a different syntax, all of the formula fields, operators, and functions are also accessible in scripts. For more information about formulas and the Formula Builder, please see Section 4.1.6 - Using Formulas & the Formula Builder. In addition to the options available for formulas, there are two additional options available when creating scripts. The Cell Attributes folder on the right panel contains a list of the cell attributes (in addition to the value) that can be modified with a script. Attributes and their use are discussed in Section 4.1.7.2.1 - Formatting Actions. The Insert Color button will bring up a color selection dialog that allows you to visually pick a color for a cell attribute. Selecting a color will automatically insert an array of RGB values into the script.

Script Color Dialog

The Insert Font button will bring up a set font dialog for you to pick from the available fonts and allow you to set styles such as bold and underline.

Script Font Dialog

4.1.7.2. Script Syntax

For most scripts the syntax is fairly simple and consists of two basic components: condition and action.

if (Condition) {Action(s);}

The condition is generally a Boolean expression derived using one of the Boolean operators discussed in Section 4.1.6.2.7.2 - Boolean Operators For example, ({Quantity} < 5) would return true when the value of the Quantity field is lower than 5. The AND and OR operators can be used to check multiple conditions. For example, (({Quantity} < 5) AND ({InStock} == "Yes")) would return true when the value of the Quantity field is lower than 5 and the InStock field equals "Yes".

So a simple script that changes the font color to red when negative values are present in the report field would look something like this:

if ({SubTotal} < 0) {
    FONTCOLOR=[255,0,0];
}

More complex scripts can be created by specifying multiple conditions for multiple actions, using if else syntax.

if (Condition 1) {Action 1;}
else if (Condition 2) {<i>Action 2</i>;}
else {<i>Action 3</i>;}

There is no limit to the number of nesting levels (if else) that can be specified. Multiple actions for a single condition can also be specified.

if (Condition 1) {
    Action 1;
    Action 2;
    Action 3;
}

This will perform multiple actions when the condition is met. Note that each line of the script must end with a semicolon.

4.1.7.2.1. Formatting Actions

The following is a list of element attributes that can be modified using scripts.

VALUE:

The action syntax that allows you to change the value of the element to which the script is applied is VALUE=New Value;. The new value does not necessarily have to be of the same data type as the report element (for example you can replace number with string). However, changing string to number or number to date can cause formatting irregularities.

BGCOLOR:

The action syntax that allows you to change the background color of the element is BGCOLOR=[R,G,B]; where R is a number for the red value of the new color, G is a number for the green value of the new color and B is a number for the blue value of the new color. You can automatically generate the RGB array using the Insert Color button in the Formula Builder.

FONTCOLOR:

The action syntax that allows you to change the font color of the element is FONTCOLOR=[R,G,B]; where R is a number for the red value of the new color, G is a number for the green value of the new color and B is a number for the blue value of the new color. You can automatically generate the RGB array using the Insert Color button in the Formula Builder.

FONT:

The action syntax that allows you to change the font, font style, and font size of the element is FONT=[Font Name,Font Style,Font Size];. The font name is the name of the font you want to use (i.e. Dialog, Serif, etc,). The options for font style are BOLD, ITALIC, or BOLD+ITALIC. The font size is a numeric value indication of the font size. For example, FONT=[Dialog,BOLD,12]; would change the font to 12 point bold Dialog.

ALIGN:

This action allows you to change the horizontal alignment of the data within the cell. The syntax is ALIGN=Position;. The position options are left, right, and center.

BORDERCOLOR:

The action syntax that allows you to change the border color of the element is BORDERCOLOR=[R,G,B]; where R is a number for the red value of the new color, G is a number for the green value of the new color, and B is a number for the blue value of the new color. You can automatically generate the RGB array using the Insert Color button in the Formula Builder.

BORDERTHICKNESS:

The action syntax that allows you to change the thickness of the element's border is BORDERTHICKNESS=Thickness;. The thickness is an integer indicating the number of pixels. For example, BORDERTHICKNESS=2; would set the border thickness to two pixels.

HYPERLINK:

The action syntax that allows you to set the hyperlink properties of the element is HYPERLINK=[URL,"Hint","Target"];. The URL is the location you want the link to point to. The hint is the mouse over hint that will appear and the target is the specified target for the link. If you do not want to specify the hint or target, specify an empty string "". Note that you will not be able to click on the hyperlinks in the preview window if you launched the ERES Organizer using bat file, but the links will still work if you export the report to DHTML or PDF format.

BOOKMARK:

This action allows you to specify a named location within the report. When you export to DHTML, it will become an anchor tag. When you export to PDF, it will become a bookmark within the generated PDF file. The syntax is BOOKMARK=Name. The bookmark can be any string value.

XPOSITION:

The action syntax that allows you to change the X position of a cell within a section is XPOSITION=Position; (in inches or centimeters depending on which measurement is selected). For example, XPOSITION=1.2; would set the left edge of the report element 1.2 inches/centimeters away from the left edge of the section.

YPOSITION:

The action syntax that allows you to change the Y position of a cell within a section is YPOSITION=Position; (in inches or centimeters depending on which measurement is selected). For example, YPOSITION=0.3; would set the top edge of the report element 0.3 inches/centimeters away from the top of the section.

WIDTH:

The action syntax that allows you to set the width of a report element is WIDTH=Size; (in inches or centimeters depending on which measurement is selected). For example, WIDTH=1.5; would set the width of the element to 1.5 inches/centimeters.

HEIGHT:

The action syntax that allows you to set the height of a report element is HEIGHT=Size; (in inches or centimeters depending on which measurement is selected). For example, HEIGHT=0.25; would set the height of the element to 0.25 inches/centimeters.

ROTATION:

The action syntax that allows you to set the rotation of a report element is ROTATION=Angle; (in degrees, where negative value brings counterclockwise rotation, applicable values are -90, 0 and 90). For example, ROTATION=-90; would set the angle of the element to 90 degrees counterclockwise.

VISIBLE:

This action allows you to control whether a cell is visible or not. The syntax is VISIBLE=True/False;. Setting visible to false will make the report element invisible.

There is also a special action called ALERT. To learn more about alerts in report scripts, please visit Section 11.2.4 - Reports.

In addition to modifying these properties for the current cell, you can also retrieve these properties from other report elements. You can retrieve the value from a report element in the same manner that you do in formulas either {Column Field}, @Formula, :Parameter, etc, or using the id() function for other cells or labels. For more information about this, please see Section 4.1.7.2.3 - Using Formulas.

You can retrieve all other attributes using the following syntax ATTRIBUTE(Report Element). For example, FONTCOLOR(id(RPT_HDR_LB0)) would return an integer array [R,G,B] representing the font color of a label in the Report Header section. You can use this to run comparisons based on attributes or to match the attributes of the current cell with those of another report element. For example, BGCOLOR=BGCOLOR({ProductName}); would change the current cell's background color to match that of the ProductName column.

Depending on which type of element the script is being applied to, certain formatting actions may have no effect. For example, you can set scripts on lines and rectangles, but you can only modify their bounds and colors.

4.1.7.2.1.1. Scripting Image URLs

Utilizing the if else conditionals and the Image URL formatting option, you can create image URL scripts that change images dynamically based on data in your report. Suppose you want to include two simple images to help readers determine if the sales for a particular category has achieved the desired goal. Let's say that the sales goal for each category is 100 units sold. Using this information, you can write the following script to display the success image when the goal is met and the failed image when the goal is not met.

if(@SUM_Quantity > 100) {
    value = "http://www.quadbase.com/images/green.jpg";
} else {
    value = "http://www.quadbase.com/images/red.jpg";
}

Create a new formula cell that has a string data type (you can simply use "" for the content) and apply this script to the cell. Then set the data formatting for this cell to be "Image Url". More information about data formatting can be found in Section 4.1.3.7.3 - Data Formatting for Formulas and Column Fields. Here is how the report will look like using this script:

Scripted Image URL

4.1.7.2.2. Variables & Arrays

In addition to the if else statements, you can also define variables and arrays in a script. Variables and arrays are defined at the beginning of the script (before any statements).

4.1.7.2.2.1. Variables

If you have a constant or expression that you intend to use in multiple places in a script, it can often be easier to define a variable rather than re-typing the constant or expression in every place where it is used. A variable can be declared at the beginning of a script using the following syntax: DataType VariableName;. The data type is the type for the variable value and can be either Number, Boolean, String, or Date.

[Note]Note

DateVar is used as the data type declaration for Date variables. This avoids confusion with the date() function. The variable name can be anything except an operator or function name.

The following example uses variables which contain an expression.

String Line1;
String Line2;
Line1 = {Address1} + "\n";
Line2 = {City} + ", " + {State} + " " + {Zip};

if ({Address2} == NULL) {

    VALUE = Line1 + Line2;
} else VALUE=Line1 + {Address2} + "\n" + Line2;

This script pieces together several report fields to create an address entry. The first two lines of the script declare the variables. The script then concatenates fields and strings depending on whether there is an Address2 entry or not. Using the variables prevents having to re-type the expressions. Note that \n is used to break the text to a new line.

You can also assign a value to a variable as part of an action in a script. You can use this to modify the variable value based on some conditions and then return the variable value to the cell. This is useful if you only want to write one value statement. The following example assigns a value to a variable:

if ({Flags} == "M") {
    LinkAppend = "Main";
} else if ({Flags} == "R") {
    LinkAppend = "Remote";
} HYPERLINK = ["StatPage.html#" + LinkAppend, "", ""];

In this example, a variable is defined without an initial value. The value of the variable is assigned based on a string flag in the report. At the end of the script a hyperlink is defined for the element that uses the variable value to specify a page location.

4.1.7.2.2.2. Arrays

In addition to variables, you can also declare arrays at the beginning of a script. Specific values from the array can be retrieved later. This is useful if you have a number of fixed values that you will be using in different places in the script like months or days of the week. An array declaration is similar to a variable declaration and uses the following syntax: DataType[] ArrayName = [Value1, Value2, Value3, ...];. Data types for arrays are the same as for variables and can be one of Number, Boolean, String, or Date. The variable name can be anything except an operator or function name. The initial value assignment is optional.

You can retrieve a value from an array using the following syntax: ArrayName[Index]. The following example uses an array to replace the numeric values for a Month column (1-12) and replaces them with the proper month names.

String[] MonthNames = ["January","February","March","April", 
"May","June","July","August","September","October",
"November","December"];

VALUE = MonthNames[({Month} - 1)];

Notice that the index specified is {Month}-1. This is because the first month value is 1 and the first index value for the array is 0.

Like variables, you can also assign or overwrite values in an array as part of an action. The syntax for this is ArrayName[Index]=Value;.

4.1.7.2.3. Using Formulas

You can use any of the ReportDesigner formulas from the main report or any sub-reports (for more on accessing sub-report formulas, see Section 4.1.6.3 - Subreport Formula Access) in both the condition and action components of the script, as well as for variable values. Most commonly formulas are used to retrieve values either from the current element or other report elements. You can retrieve the value from column fields using {Column Field}, the value from existing report formulas using @FormulaName and the user supplied values for query and formula parameters using :ParamName and ?ParamName respectively.

In addition to these methods, there is one additional function that can be used in scripts.

this() -

This function returns the value of the current element (i.e. the cell to which the script is applied). The syntax is this() without any arguments. The function can be useful if you're reusing scripts or if you want to ensure that the script is referring to the cell to which it is applied. For example If (this() < 0) {FONTCOLOR=[255,0,0];} would turn the font red, then the value of the current cell is less than zero.

You can also use the formulas to build expressions for comparison or to change an element's value. For more information about ReportDesigner formulas and their syntax, please see Section 4.1.6 - Using Formulas & the Formula Builder.

4.1.7.2.4. Checking for Nulls

Using cell scripts you can check for null values within report columns. To specify a null as a constant, simply use the word null without any delimiters. So a simple script that checks for nulls would look like this:

if (this() == null) {
    VALUE="yes";
}
[Note]Note

Even if you have set the null data handler in Report Designer, you can still use script in this manner. This is because the script will execute before the null handler has a chance to convert the content of the cell.

4.1.7.2.5. Row-Specific Options

Using scripts, you can retrieve and modify values for specific rows of column fields. Normally when you retrieve or replace the value of a column field you will get/replace the first value from the column or the current row if the script is applied to a field in the Table Data section. However, you also have the option of specifying which row you would like to get/replace. To do this, you can append a column field with the following syntax: .row(Row Index). The row index is the index value associated with each row in a report starting with 0. For example {ProductName}.row(3) would return the fourth value of the ProductName field.

You can obtain the current row index as well as the total number of rows in the report using the getRowIndex() and getTotalRowIndex() functions respectively. The following example uses this feature to hide repeated values in a column field.

if (({Category}.row(getRowIndex()) == {Category}.row(getRowIndex()-1)) AND (getRowIndex() <> 0)) {
    FONTCOLOR=[255,255,255];
}

This example assumes that the background color for the report is white and hides the field by adjusting the font color accordingly.

4.1.7.2.6. Loops

In addition to conditional if else statements, ReportDesigner also allows you to add loops to scripts. Used in conjunction with variables and row-specific options/formatting, loops are useful if you need to perform running totals/calculations independent of the current row or section of the report. The basic syntax for loops is:

while (Condition) {Action(s);}

The specified actions will be performed as long as the condition (Boolean expression) is true.

For example, say you have the following report:

ProductQuantityPrice
   
Chair6$327.00
Chair4$218.00
Chair12$418.00
Chair5$221.00
Chair18$248.00
Table4$875.00
Table2$1,024.00
Table8$967.00
Table7$1,106.00

Adding a formula that calculates the total quantity to the Table Footer (sum({Quantity})) would return 66. However, say you only wanted to show the total quantity for chairs in the Table Footer. To do this, you write a loop. Applying the following script to the aggregation.

Number i; 
Number s; 
i = 0;
s = 0;

while (i < getTotalRowIndex()) {
    
    if ({Product}.row(i) == "Chair") {

        s = s + {Quantity}.row(i);
                
    }
    
    i = i + 1;

}

VALUE = s;

will return 45 - the sum of the quantity column for Chair. The script loops through each row in the report and checks to see if the value for the Product column is Chair. If it is, the Quantity value for that row is added to the variable s.

4.1.7.2.7. Section Scripts

In addition to individual cells, scripts can also be applied to report sections. Based on conditions within the report data, individual section options can be turned on/off and section background colors can be set. To add a script to a report section, click on the button with the section name on the left side of the Designer. You can also right click on a blank portion of the section field and select Scripting from the pop-up menu.

Writing section scripts is exactly the same as writing scripts for report elements as they use the same syntax. The only difference is that instead of Cell Attributes folder in the Formula Builder, you will see Section Attributes folder containing various formatting actions that can be performed with section scripts.

4.1.7.2.7.1. Formatting Actions for Section Scripts

The following is a list of section attributes that can be modified using scripts (not all options are available for every report section).

BGCOLOR:

The action syntax that allows you to change the background color of the element is BGCOLOR=[R,G,B]; where R is a number for the red value of the new color, G is a number for the green value of the new color and B is a number for the blue value of the new color. You can automatically generate the RGB array using the Insert Color button in the Formula Builder.

PRINT_ON_NEW_PAGE:

This action allows you to turn on/off the print on new page section option. The syntax is PRINT_ON_NEW_PAGE=True/False; For more information about the print on new page feature, please see Section 4.1.3.3 - Section Options.

RESET_PAGE_NUMBER:

This action allows you to turn on/off the reset page number section option. The syntax is RESET_PAGE_NUMBER=True/False; For more information about the reset page number feature, please see Section 4.1.3.3 - Section Options.

VISIBLE:

This action allows you to control whether a section is visible or not. The syntax is VISIBLE=True/False; Setting visible to false will make the section invisible. Using this attribute coupled with the nested section feature (Section 4.1.3.1.1 - Nested Sections) allows you to create different headers/footers to display depending on the data.

HEIGHT:

This action allows you to set the height of a section. The syntax is HEIGHT=Size; (in inches or centimeters depending on which measurement is selected). For example HEIGHT=0.25; would set the height of the section to 0.25 inches/centimeters.

[Note]Note

Scripts that set or refer to section attributes can only be applied to sections. They cannot be applied to other report elements.

4.1.7.2.8. Commenting Scripts

You can also add comments to a script to explain its design and operation. A comment is preceded by two slashes //. Anything following this on the same line is treated as a comment. You can break comments into multiple lines, but each line must begin with //.

4.1.7.2.9. Accessing Values Computed by Other Scripts

If you have scripts applied to cells in your report, you can access these values using the syntax .getScriptValue(). For example, you may have this data:

String, int
Month, Revenue
January, 3567
"February", 6854
"March", 5421
"April", 8425
"May", 5611
"June", 2356
"July", 6543
"August", 2563
"September", 4432
"October", 8841
"November", 1023
"December", 2265

If you wish to take this data and create a year to date revenue column, you could use the following script, which would display the scripted value from the previous row added to the revenue from the current row. This script is written to be put on a formula consisting of the number 0 as a column in the table data section, refered to within this script as {formula1}.

if(getRowIndex()==0)

    VALUE={revenue};
else
    VALUE={revenue} + {formula1}.getScriptValue(getRowIndex()-1);

This would yield a report like this:

4.1.7.3. Managing Scripts

For reports that contain a number of scripts or scripts applied to a number of elements, there are several options available to help you manage and find the elements that the scripts are applied to. In the script dialog, you will notice that in addition to the standard options such as remove, delete, and rename, there are also buttons to view all, find next, and find previous elements. Make sure that you select a script before using these buttons.

VIEW ALL:

This button will open the Report Explorer if it is not already open and highlight every element that the selected script has been applied to with an asterisk. The tree will automatically expand the sections that have highlighted cells. Clicking on one of these elements will center the designer view on that element allowing you to change or remove the applied script. The highlights will be changed if you select another script and click on VIEW ALL again. Closing the script dialog box will remove all the highlights and the explorer tree will collapse.

Click to view larger image

View All Result

FIND NEXT and FIND PREVIOUS

These buttons are used to cycle through elements that the selected script has been applied to. If you already have an element selected in the Designer when clicking on these buttons, the search will begin at the current element. If no elements are selected, the search will begin at the beginning of the report. If you select another script and click FIND NEXT, the asterisk will shift to the newly selected script and the first element that has the script applied will be highlighted in the designer. FIND NEXT and FIND PREVIOUS only cycle through visible elements. If you want to see invisible elements with the script, use VIEW ALL which shows all invisible elements as well as visible elements.

For more information about the Report Explorer, please see Section 4.1.3.8 - The Report Explorer

4.1.8. Drill-Down

Often reports are used to display large amounts of data. However, with large data sets (particularly if the data is fairly detailed) displaying everything in one report may not the best way to present the information. One solution to this problem is to create a top-level report that displays only summarized data and allow users to click through to see underlying data. This is the concept of drill-downs.

In ReportDesigner, users can easily display data in this way. Links can be placed on column fields in the primary (top-level) report to secondary (sub-level) reports. The sub-level reports use parameterized queries that accept the value from the primary report as the input. Hence, sub-level reports will only display data related to the particular value on which the user has clicked.

For example, say you are designing a report to show sales data for an entire year. Rather than creating a report that displays the entire year's worth of data, you could design a top-level report that shows aggregated data by month.

MonthUnits SoldTotal Sales
January5$10,224.12
February4$12,286.14
March6$14,415.16
April5$12,316.11
May2$9,482.64
June3$10,116.12
July7$17,624.18
August5$10,361.54
September4$10,116.82
October3$8,612.41
November5$10,552.24
December11$22,614.89

Users viewing the report could then drill-down to see more data for each month. In this case, say the user clicks on March. They would then be taken to an underlying report that offers detailed sales information for that month.

Sales Data For March 2001    
Order #CustomerProductQuantityTotal
10042Allied Furniture EmporiumChair2$6,425.16
10051Furniture WorldTable1$3,114.12
  Dresser1$2,116.83
10068Domus Home & GardenChair1$800.65
  Dresser1$1,958.40
Total:  6$14,415.16

From this report, another layer of drill-down can be added, allowing users to see more detailed customer information. In this case, say the user clicks on Allied Furniture Emporium. They would be taken to a third report that shows more information about the customer.

Customer Information  
  Address:
Company:Allied Furniture Emporium384 Broad St. Littletown, NY 18322
Contact Name:Matilda Gladwaller 
Order History:  
YearOrdersTotal Sales
199914$52,614.18
200018$68,115.89
200112$38,812.12

Using drill-down in this manner allows large amounts of information to be presented in a way that is easy to understand and navigate. ReportDesigner allows horizontal and vertical layers of drill-down. This means that different columns in that same report can have drill-down (horizontal), or that sub-level reports can have subsequent drill-down reports (vertical). Users can also add drill-down layers to sub-reports.

Within the Report Designer, drill-down is controlled from the Drill-Down menu. Selecting the Navigate option from this menu brings up the Navigation window. From this window you can add and edit drill-down reports.

Drill-Down Navigation Dialog

The left side of the Navigation window displays the hierarchy of drill-down reports (see the above diagram). The ROOT is the top-level report. The level that you are currently editing is marked with **. To edit a different report, select it and click the EDIT button on the right side. That report will then open in the Designer, allowing it to be customized. Reports can also be removed by selecting the report and then clicking the REMOVE button.

4.1.8.1. Creating a Drill-Down Report

The first step in creating a drill-down report is to create the top-level report. Because drill-down relies on relationships between data sets, only reports that use parameterized queries, XML queries, or class files can be used for drill-down layers. When designing the top-level report, bear in mind that at least one of the columns or parameters will be passed as a parameter to any sub-level reports. After you finish designing the top-level report, go to the Drill-Down menu and select Navigate. The navigation window will open. Select the report under which you would like to add the drill-down layer (if the report has no drill-down, only the ROOT node will be visible), and click the ADD button. If you are adding drill-down to a sub-report, first go to the sub-report tab and then load the navigation dialog.

You will then be prompted to create a new report or use an existing report for the drill-down layer. You can use any existing report; however any report for a drill-down layer must have a parameterized query or class file as the data source. If the existing report contains drill-down levels of its own, all drill-down levels will be imported as well. If you select to create a new report, the Report Wizard will open, allowing you to select a data source, report type, and column mapping.

The next step is to map the columns or parameters in the top-level report, to the parameters in the sub-level report. You will be prompted to do this when you select an existing report for the drill-down layer, or when you select the data source for a new report for the drill-down layer. In either case, a dialog will appear prompting you to map the columns or parameters from the top-level report.

Parameter to Column/Parameter Mapping Window

The options that are available in the drop-down menu are based on data type. For example, if your parameterized query takes a string as a parameter, only columns containing string data can be mapped. If there are multiple parameters for the sub-level query, there will also be the option None. This will allow you to create unmapped drill-down reports. For more information, see Section 4.1.8.5 - Unmapped Drill-Down. Once you specify the drill-down mapping, you will be prompted to specify a name for the sub-level report. Now the sub-level report will open in the Design window, allowing you to format and customize it.

4.1.8.1.1. Drill-Down Links

By default, a link will be placed on the column in the top-level report which is mapped to the sub-level report. Instead of using the default link, you can place the link on a different column, or multiple columns using the Drill-Down Link option from the Drill-Down menu.

To add or remove a drill-down link from a report column, first make sure that you are currently editing the correct template (top or higher level). Then select a column field and select Drill-Down Link from the Drill-Down menu. This will bring-up a drop-down list allowing you to select which sub-level report you would like to link to. To remove a drill-down link, select the blank option at the top of the drop-down list.

Drill-Down Link Dialog

4.1.8.1.1.1. Linking from Charts

In addition to placing links on a column, you can also set drill-down links on a chart. With this feature, users can click on the data point in a chart and traverse to the next level of drill-down. To set a drill-down link on a chart, select the chart object in the Report Designer and select Drill-Down Link from the Drill-Down menu. Next, select the sub-level report just as you would for a column.

When you set a drill-down link in the chart depending on the elements in the chart and the number of parameters in the sub-level report, the category, data series, and/or sum by value for the data point that is selected are passed as the parameter value to the sub-level report. In order for this feature to function correctly, the chart will need to use the same data source as the report. The chart should also have the categories mapped to the column that was selected to match the parameter in the sub-level report. For more information about column mapping in charts, please see Section 4.2.2.2 - Basic Data Mapping and Section 4.2.3 - Chart Types and Data Mapping.

4.1.8.2. Multi-Value Drill-Down

In addition to drilling on one field at a time, ReportDesigner supports the concept of multi-value drill-down. Using this feature, you can drill into several different values from a top-level report at once.

For example say you have a report detailing sales information for 100 different customers. Using the multi-value drill-down, users could select the customers that most interest them and drill into their records at once instead of looking at each customer individually.

4.1.8.2.1. Creating a Multi-Value Drill-Down Report

Adding layers of multi-value drill-down to a report is almost exactly same as adding regular drill-down layers. The only difference is in the query in the lower-level report. To create a multi-value drill-down layer, the lower-level report must have a multi-value parameter in its query that is mapped to a column in the higher-level report.

Using the previous example, say the query for the lower level has a multi-value parameter for a customer id - something like Where Customers.CustomerID IN (:CustID). If the CustID parameter is mapped to the Customer ID column in the top-level report, this will automatically create a multi-value drill-down layer. For more information about multi-value parameters, see Section 3.1.3.2.2.1 - Multi-Value Parameters. If you do not wish to create a multi-value drill-down layer, simply use a single value parameter in the lower-level report.

[Note]Note

You can have only one report per level when using multi-value drill-down. It does not support linking different columns from the same report to different reports.

You can place column links in multi-value drill-down reports; however, a dialog or form is used to allow users to select multiple column values and drill to the next level. For more information about this, please see Section 4.1.8.4 - Viewing Drill-Down Reports.

4.1.8.3. Crosstab Drill-Down

ReportDesigner provides a special implementation of the drill-down features when the top level report is a crosstab report. Using the crosstab drill-down features, users can click on a cell in the crosstab matrix and drill into information for that particular row or column. For example, assume you have the following report showing sales volume by product and region.

 EastSouthMidwestWest
Chair144208131108
Cabinet208114158206
Dresser100101112109

Using standard drill-down configuration, if a user clicks on one of the hyperlinked cells, only the values from that row could be passed to the lower-level report. However, with crosstab drill-down, the column break and row break values for that cell are passed to the lower-level report. Therefore, if the user clicks on the cell value 144, the values "Chair" and "East" would be passed to the parameters in the lower-level report.

4.1.8.3.1. Creating a Crosstab Drill-Down Report

When you select to add a drill-down layer to a crosstab report, you will be prompted whether you would like to create a standard (column linking) drill-down presentation or use crosstab drill-down.

Crosstab Drill-Down Options

If you select to use crosstab drill-down, the setup will continue just as it would for any other drill-down presentation. The only difference comes with parameter mapping. Instead of mapping parameters from the lower level report to columns in the main report, they are mapped to the row break and column break values for the top-level report.

Parameter-Column Mapping for Crosstab Drill-Down

Once you add the drill-down layer, the cells (column break values) in the crosstab matrix for the top level report will automatically be linked to the layer you have added.

4.1.8.4. Viewing Drill-Down Reports

You can directly navigate and view drill-down reports within the Report Viewer Applet (and the Preview window). When you open a report containing drill-down, you can click on any entry in a column with a drill-down link. You will be taken to the sub-level report, which will take the value for that row as the parameter.

For multi-value drill-down reports, you can select Select Multiple Drill-Down Values from the Data menu in the Preview window or from the Viewer pop-up menu. This will bring up a dialog containing all the values in the mapped column. You can then select the values you want and click the Ok button to go to the next level.

Multi-Value Drill-Down Selection Dialog

[Note]Note

The templates for sub-level reports are saved in DrillDown directory. If you are viewing reports on another machine, the Report Viewer will look for the templates in that directory, so they have to be moved as well.

Drill-down reports can be exported to any format; however, only the DHTML and PDF formats can retain the drill-down functionality (multi-value drill-down reports only support DHTML). Any other format will only export the top-level report.

4.1.8.5. Unmapped Drill-Down

When you create a sub-level query with multiple parameters, you have the option of leaving some of these parameters unmapped, so that they can be prompted after clicking a drill-down link. To use this feature when selecting mapping for parameters, select none for the parameters you wish to remain unmapped. The sub-level report also contains a Data menu option Preview Parameter Prompt which determines if the parameter prompt will be displayed when you drill-down from the root level. If this level has never been previewed before, it will be turned off and use the default parameters. Otherwise, it will save the last used parameter values for future use.

Each sub-level drill-down report requires at least one mapped parameter. Thus, in order to create a report with unmapped parameters, the sub-level query must have at least two parameters. For example:

Drill-Down Level Query

Map at least one parameter to a database column and select none for the other(s).

Creating Unmapped Parameters

The remainder of the creation of the drill-down report is like any other.

When you preview the report, the root report will be displayed as normal (with a parameter prompt if the root report contains parameters).

If you click on a link and the Preview Parameter Prompt menu option for the drill-down report is checked, you will see the following prompt. Notice that the CategoryName parameter is not shown:

Parameter Prompt for Unmapped Drill-down

The resulting report will look like this:

From the DHTML Viewer or in an exported file, the default values will be used, but they can be changed from the filter options.

4.1.9. Sub-Reports

A sub-report is a report within a report. The sub-report is nested entirely within a section of a primary report. Each sub-report has its own data source and design. Using sub-reports you can create reports that use un-related data. You can also create a report that has more than one data table.

In ReportDesigner, sub-reports are generally unrelated to the primary report (however parameterized sub-reports can be linked to column fields in the primary report, see Section 4.1.9.4 - Linked Sub-Reports). Each sub-report uses its own data source and it can be designed independently from the primary report. It also runs entirely within the section in which it is placed in the primary report. You can either use an existing report (.pak, .qrp, .rpt or .xml) template or create a new one for the sub-report.

4.1.9.1. Adding a Sub-Report

To add a sub-report to an existing report, click the Insert Sub-Report button on the toolbar or select Insert Sub-Report from the Insert Menu. A second menu will open giving you the option of adding a new sub-report or re-using an existing one. To insert a new sub-report, select New....

The cursor will turn to cross. Position it where you want to insert the sub-report and click. A dialog box will appear asking you whether you want to use an existing report or create a new one.

You can use any existing report in either .pak, .rpt or .xml format as the sub-report. If you select to use an existing report, you will be prompted to specify the location of the report file. After you specify the file, it will be inserted as a sub-report.

If you select to create a new report for the sub-report, the Report Wizard will launch, allowing you to go through the process of designing the report from data source selection to report mapping. Once you finish with report mapping, the new report will be inserted as a sub-report.

4.1.9.2. Editing a Sub-Report

After a sub-report has been added, a new tab will appear at the top of the Report Designer window.

Click to view larger image

Sub-Report Tab

Selecting the Sub-Report tab will open a new design pane that allows you to modify the sub-report. You can modify the sub-report in the same way as you modify any report. For each sub-report you add, a new tab will appear. When you have a sub-report, the Preview tab becomes context sensitive. If you click on the Preview tab from the Sub-Report tab, the preview pane will only contain the sub-report. If you click on the Preview tab from the Design tab, you will preview the main report with the sub-report embedded.

Within the Design window, the sub-report will appear as a gray rectangle. It can be moved and resized like any object. You can also edit a sub-report by double-clicking on the corresponding rectangle in the Design window.

Sub-Report in Design Window

Sub-reports run entirely in the section in which they are placed and will generally repeat each time the report section repeats. This means that if the sub-report is placed in the table header section, it will only run once (unless the Print on Every Page option is enabled). However, if the sub-report is placed in the Group Header section, the sub-report will repeat for each group in the report.

The exception to this is the table data section. Sub-reports inserted into the table data section will not repeat for each row, but will rather run alongside the data in the primary report. This allows you to create a report with the effect of two data tables running next to each other.

4.1.9.2.1. Sub-Report sizing

The size of the gray rectangle in the main report Design window represents the size of the sub-report, so if the sub-report is larger than the space you allow in the Design window, portions of the sub-report may be truncated.

Fixing a sub-report's size within the main report may not be the best solution if the number of records in the sub-report vary. You can solve this by setting the sub-report to have variable height. Dynamic sizing for sub-reports is set in the same way as for other report cells using the resize to fit option. For more information about this feature, please see Section 4.1.3.7.11 - Moving and Resizing Report Elements.

You can also set the width of the sub-report to be dynamic. This feature is most useful for crosstab type reports where the number of columns in the report can vary as the data or filters change. This sets the sub-report to always draw wide enough to fit all the visible columns in the sub-report. To set dynamic width for the sub-report, right click on the sub-report in the Design window and select Auto Resize Width from the pop-up menu (To disable this feature, open the pop-up menu and click on this option again).

[Note]Note

If you set a sub-report to have variable height, any objects placed directly below the sub-report in the same section of the primary report will not shift to accommodate the resized sub-report. Hence, these objects may be overlapped by the sub-report.

To ensure that objects are not overlapped, it is recommended that you place sub-reports with dynamic height in their own report sections. If necessary, you can add nested sections to the report. For more information about this, see Section 4.1.3.1.1 - Nested Sections.

4.1.9.3. Removing a Sub-Report

There are two ways to remove a sub-report from the primary report. You can simply select the sub-report object in the primary report and delete it. This will remove the sub-report from the primary report but it will keep it available. This means that the sub-report tab is still active and the sub-report can be re-inserted into the primary report.

The second method is to select Remove Sub-Report from the Edit menu. A second menu will open with a list of all the sub-reports embedded in the current report. Select the sub-report you want to remove. The sub-report tab will be removed and the sub-report will no longer be available.

4.1.9.4. Linked Sub-Reports

Sometimes you may want sub-reports to be coordinated with the data in the primary report. For example, if you have grouped data, you may want to filter a sub-report so that it shows data pertinent to each group. You can use linked sub-reports to do this.

Sub-reports are linked to primary reports using query parameters. So to create a linked sub-report, the sub-report must have a parameterized query. After you create the sub-report, you can link it by selecting Sub-Report Parameter Mapping from the Data menu. This will bring up a dialog allowing you to map column fields from the primary report to query parameters in the sub-report. This operation is similar to the one used in drill-down.

Sub-Report Parameter Mapping Dialog

The dialog contains a tab for each parameterized sub-report. Each parameter in the sub-report can be mapped to a different column field in the primary report.

Normally when linked sub-reports execute, the sub-report will issue its query each time it runs using the current value of the report column. However, if your report is configured such that the sub-report executes a large number of times, these repeated queries can have an impact on performance. If you check the last option in this dialog called Limit Sub-report query execution, ReportDesigner will try to merge the sub-report queries and limit the number of calls to the database when the sub-report runs. Note that this option will only take effect if the sub-report uses a database query to retrieve the data. This will not effect sub-reports that use parameterized classes or xml files as the data source.

When using linked subreports, it is recommended that you do not use the cascading parameters functionality, as this may potentially cause incorrect data to appear (depending on the cascading parameters and the order in which they are presented). The default value of the parameter will always be selected instead of the value passed by a column in the main report.

4.1.9.4.1. Using Linked Sub-Reports

Although linked sub-reports will run in any configuration and in any report section, it is important to be aware of the behavior of sub-reports when creating a linked presentation. As noted in Section 4.1.9.2 - Editing a Sub-Report, sub-reports will only run as many times as the section in which they are placed and will only run once when placed in the Table Data section.

Therefore, if you place a linked sub-report in a section that runs only once (Table Header, Report Header, Table Data, etc), the sub-report will only run once and it will use the first value from the column to which it is linked to filter the report. To generate a linked presentation where the sub-report runs for each value in the column to which it is linked, you should use a summary break layout. By setting the column as a row break and placing both the column and the sub-report in the Group Header section, you will get the desired result.

[Note]Note

If a relationship between the column and the sub-report already exists in the database, you may want to generate a side-by-side master & details layout instead of linked sub-reports. Using the master & details layout will result in better performance. For more information about this, please see Section 4.1.2.4.1 - Data Mapping.

4.1.9.5. Parameter Linking

In addition to taking a value from a column in the main report, a sub-report can also share parameter values with the main report or with other sub-reports. In this arrangement, a user can enter values to filter the main report's data and have the same filters apply to the sub-report data.

Parameter linking is only available if parameters share the same data type. By default, if you create a sub-report that has parameters with the same name and data type as those in the main report, they will be linked. When parameter values are supplied to the main report, they are also automatically passed to the sub-report.

The parameter linking behavior can be modified by navigating to the sub-report that you want to modify and selecting Sub-Report Parameter Sharing from the Data menu (in the Sub-Report tab). This will bring up a dialog allowing you to modify the linking behavior for the sub-report parameters.

Parameter Sharing Dialog

For each parameter defined in the sub-report, you can enable/disable the linking. You can also set which parameter in the main report or in another sub-report you want to link to. The Group Detail button will launch a dialog showing the current relationships for that parameter.

Once you specify the settings you want for all parameters, click the Ok button to apply the changes.

For more about query parameters and initialization, please see Section 3.1.3.2.2 - Parameterized Queries of this guide.

[Note]Note

Parameter linking will be overridden if you select to map a column field from the main report to the sub-report parameter as described in Section 4.1.9.4 - Linked Sub-Reports.

4.1.10. Template Security

One of the most common needs with a reporting tool is to keep the number of different report templates at a minimum. In ERES, the administrator can grant access to specific reports for users and groups in the system. However, simply granting or denying access may not be enough to facilitate template re-use. To help with this, ERES provides a template security features that allow the administrator to configure different levels of access to the same report template for different users/groups in the system.

For example, say you have a group in ERES called Sales. The group all has access to a report that shows total sales grouped by sales region. Sales executives viewing the report need to see the totals as well as the contributions by each region, while individual account managers would only need to see the data for their region. Rather than creating a different report for each sub-group within the Sales group, the same template can have security settings applied. The base template for this scenario would look like this:

Sales Report
Total Units Sold: 29 Total Sales: $24,449.69
Eastern Region
Order #QuantityProductUnit PriceTotal Sales
10012Chair$325.16$650.32
 1Table$1,114.18$1,114.18
 Order Total: $1,764.50
10043Table$1,114.18$3,342.54
 2Dresser$1,518.60$3,037.20
 Order Total: $6,379.74
Total for Eastern Region: $8,144.24
Midwestern Region
Order #QuantityProductUnit PriceTotal Sales
10034Chair$325.16$1,300.25
 2Table$1,114.18$2,228.36
 1Dresser$1,518.60$1,518.60
 Order Total: $5,047.21
Total for Midwestern Region: $5,047.21
Southern Region
Order #QuantityProductUnit PriceTotal Sales
10052Table$1,114.18$2,228.35
 1Dresser$1,518.60$1,518.60
 Order Total: $3,746.95
10073Chair$325.16$975.48
 1Table$1,114.18$1,114.18
 Order Total: $2,089.66
Total for Southern Region: $5,836.61
Western Region
Order #QuantityProductUnit PriceTotal Sales
10062Dresser$1,518.60$3,037.20
 4Chair$325.16$1,300.25
 1Table$1,114.18$1,114.18
 Order Total: $5,451.63
Total for Western Region: $5,451.63

Using the security features, this one template could be used to meet the requirements of all the members of the Sales group. In this example, assume that the report has a query parameter that filters based on region.

For executives, the view above is what they would want to see when viewing the report, so a security level called Management could be created that retrieves data for all regions. This is accomplished by mapping all the available values for the region parameter to the Management level. In this example the values for the Eastern, Midwestern, Southern, and Western regions would be assigned to the security level. Note that in ReportDesigner, in order to supply more than one value to a query parameter, you need to define a multi-value parameter. For more information about this, please see Section 3.1.3.2.2.1 - Multi-Value Parameters.

For the account managers, different security levels could be created for each region. The above example has four regions, so security levels East, Midwest, South, and West would be added. Since account managers should not see the aggregate data, cells containing the summaries in the header would be hidden for the region levels using the cell-level security features discussed in Section 4.1.10.2 - Cell-Level Security. To make sure that each level returns data for the appropriate regions the parameter value for the Eastern region would be mapped to the "East" security level, the parameter value for the Midwestern region would be mapped to the Midwest security level, the parameter value for the Southern region would be mapped to the South security level, and the parameter value for the Western regions would be mapped to the West security level. For more information about setting security levels to apply parameter values, see Section 4.1.10.2.1 - Security Parameters.

In the Organizer, the members of the Sales group can be associated with the defined security levels. Then when the report is run, the security level for the user who has requested the report is applied and the parameter values associated with that level are automatically supplied to the query without prompting the user. For example, here is the same report run by an account manager in the eastern region:

Sales Report
Eastern Region
Order #QuantityProductUnit PriceTotal Sales
10012Chair$325.16$650.32
 1Table$1,114.18$1,114.18
 Order Total: $1,764.50
10043Table$1,114.18$3,342.54
 2Dresser$1,518.60$3,037.20
 Order Total: $6,379.74
Total for Eastern Region: $8,114.24

4.1.10.1. Security Levels

Security levels are unique groups of settings that can control cell and parameter behavior in reports. Levels are created by the administrator in the Organizer interface. For more information about setting security levels, see Section 2.3.3 - Security Levels. The administrator can also associate users and groups with specific security levels. For more information about this feature, please see Section 2.3.3.1 - Associating Security Levels with Users and Groups.

Within a report, different cell behaviors and filtering can be associated with a specific security level. At run-time, based on the user login, the security level assigned to that user is applied to the report.

4.1.10.2. Cell-Level Security

For any cell/visible column in the report, you can set different behaviors for different security levels. To apply security settings to a cell, either select the cell and select Security from the Data menu, or right click on the cell and select Security from the pop-up menu. This will bring up a dialog allowing you to specify security settings for that cell.

Click to view larger image

Cell Security Settings Dialog

The dialog contains a list of all the defined security levels in the Organizer.

Security levels can be added/removed/modified in the Organizer. See the Section 2.3.3 - Security Levels chapter for more details.

To add security settings for a report cell, select the level for which you want changes to take effect and click the Add button. The security level will then appear in the drop-down list on the left side of the cell security dialog. Now you can modify the cell for that security level. There are three basic controls available for cells. You can render the cell invisible for a security level. If the cell is visible, you can either provide custom text for the cell or you can apply a cell script. For more information about the cell scripts, please see Section 4.1.7 - Scripting. If you select to make a column (cell in Table Data section) invisible, make sure to select the column header along with the data cell so they both contain the same security setting, then you can check the Shift Column X option to make the other columns shift to the left when the security level is applied.

[Note]Note

When you specify to change the text of a cell, it will not work for default column headers. This is because column headers are unique elements that retrieve their value from the data source. If you wish to modify the text of a column header, you will need to convert it to a static label first. For more information about this, please see Section 4.1.3.7.2 - Editing Elements.

You can propagate this behavior to any cell that has controls for this security level by clicking the button on the right side. You can specify controls for as many different levels of the cell as you want.

Once you finish specifying the security settings for the cell, click the Ok button. You will go back to the Design window where a red s will appear in the upper left corner to indicate that the security settings have been applied to the cell.

Report Cells with Security Settings

4.1.10.2.1. Security Parameters

In addition to controlling the specific behavior of cells in a report, you can also assign parameter values to a security level. For example, using the scenario described earlier where a sales report is grouped by region, you could add a query parameter that filters by sales region, and then assign the appropriate region value to a security level for that region. When an employee logs in, the report is run with the appropriate security level and the user will only see data for their sales region as the appropriate parameter value has been supplied to the report by the security level. To use security parameters, the report must use either a parameterized database query or a parameterized class as the data source.

To add security settings for parameters, select Secured Query Parameters from the Data menu. This will bring up a dialog allowing you to select query parameter values.

Security Parameters Dialog

Like the cell security dialog, the parameter security dialog contains a list of all the security levels defined in the Organizer on the left side.

To add security settings to report parameters, select the level you want to assign parameter values to and click the Add button. The security level will then appear in the drop-down list on the right side of the dialog. For each selected security level, you can select which parameters you want to secure using the check box next to the parameter. For each secured parameter, you can select the value(s) that you want to be associated with this security level. Once you finish assigning parameter values, click the Ok button to return to the design window.

4.1.10.3. Security for Sub-Reports & Drill-Down Layers

Template security settings can be automatically applied to sub-reports as well as drill-down layers. In both cases, you need to edit the sub-report or drill-down layer (by clicking the sub-report tab, or navigating to the drill-down layer) to add security. In the sub-report or drill-down layer, you can add security settings just as you would for the main report. If you want to apply security to both the main report and the sub-report/drill-down layer, you will need to assign the security levels with the same name(s) as in your main report. When a report is run with a security level, the security level will be automatically applied to the sub-report(s) and/or drill-down layer(s).

For more information about drill-down and sub-reports, please see Section 4.1.8 - Drill-Down and Section 4.1.9 - Sub-Reports.

4.1.10.4. Viewing Secured Templates

You can preview the effects of your security settings in the Preview window of the Report Designer. To do this, select Set Preview Security Level from the Data menu. This will bring up a dialog prompting you to select the security level that you want to use to view the report.

Preview Security Level Dialog

Select the level you want and then preview the report. You will see the report with security settings applied for the level you selected. This level will remain selected until you change the settings. Selecting the blank entry at the top of the list in this dialog will set the report to run without applying any security settings.

4.1.10.4.1. Secured Report Designer

Only the administrator has access to the report security features. When other users access the Report Designer, it will run in secure mode. When the Report Designer is running in secure mode, users will only be able to preview reports at the level assigned to them. In addition, they will be unable to modify report cells with defined security settings or cell scripts that have been applied as security settings.

You can also call Report Designer in secure mode when launching it through the API. For more information about launching Report Designer through the API, see Section 8.1.5.8 - Calling Report Designer from Report API.