0% found this document useful (0 votes)
65 views226 pages

WebReports User Guide

The WebReports User Guide for OpenText™ Content Server provides comprehensive instructions for creating and managing reports using the WebReports module. It covers topics such as report creation, data source configuration, and advanced features, aimed at both business users and developers. The guide also includes examples and detailed procedures to enhance user experience and reporting capabilities within the Content Server environment.

Uploaded by

l181080157
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views226 pages

WebReports User Guide

The WebReports User Guide for OpenText™ Content Server provides comprehensive instructions for creating and managing reports using the WebReports module. It covers topics such as report creation, data source configuration, and advanced features, aimed at both business users and developers. The guide also includes examples and detailed procedures to enhance user experience and reporting capabilities within the Content Server environment.

Uploaded by

l181080157
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 226

WebReports User Guide

OpenText™ Content Server

Use the WebReports module to create reports that deliver


information from any standard, or custom tables with any
presentation format desired. Provides developers with details
and examples of how to use WebReports tags, sub-tags, and
other advanced information.

LLESWEBR230300-UGD-EN-01
WebReports User Guide
OpenText™ Content Server
LLESWEBR230300-UGD-EN-01
Rev.: 2023-June-12
This documentation has been created for OpenText™ Content Server CE 23.3.
It is also valid for subsequent software releases unless OpenText has made newer documentation available with the product,
on an OpenText website, or by any other means.

Open Text Corporation

275 Frank Tompa Drive, Waterloo, Ontario, Canada, N2L 0A1

Tel: +1-519-888-7111
Toll Free Canada/USA: 1-800-499-6544 International: +800-4996-5440
Fax: +1-519-888-0677
Support: https://support.opentext.com
For more information, visit https://www.opentext.com

Copyright © 2023 Open Text. All Rights Reserved.


Trademarks owned by Open Text.

One or more patents may cover this product. For more information, please visit https://www.opentext.com/patents.

Disclaimer

No Warranties and Limitation of Liability

Every effort has been made to ensure the accuracy of the features and techniques presented in this publication. However,
Open Text Corporation and its affiliates accept no responsibility and offer no warranty whether expressed or implied, for the
accuracy of this publication.
Table of Contents
1 Using WebReports .................................................................... 5
1.1 Introduction to WebReports ............................................................... 5
1.2 How WebReports Work ..................................................................... 6
1.3 Getting Started Using WebReports ..................................................... 7

2 Working with WebReports ........................................................ 9


2.1 Creating a WebReport ....................................................................... 9
2.2 Online Editing of a WebReports Reportview or an ActiveView
Template ........................................................................................ 11
2.3 Offline Editing of a WebReports Reportview or an ActiveView
Template ........................................................................................ 24
2.4 Adding a New Reportview ................................................................ 25
2.5 Reportview Files ............................................................................. 25
2.6 Data Source Configuration ............................................................... 34
2.7 Changing the Associated Data Source for a WebReport .................... 38
2.8 Setting the Default WebReport Output Destination ............................ 38
2.9 Exporting the WebReport Output ...................................................... 52
2.10 Property Tabs ................................................................................. 58
2.11 Running WebReports ...................................................................... 59
2.12 Setting Schedules for WebReports ................................................... 61
2.13 Setting WebReports Permissions ..................................................... 64
2.14 WebReports Constants ................................................................... 65
2.15 Using WebReports Parameters ........................................................ 69

3 Help with Using WebReports Tags ........................................ 77


3.1 To Access the Dynamic Tag Guide .................................................. 77

4 WebReports Advanced Information ...................................... 79


4.1 Action Sub-tags .............................................................................. 79
4.2 AJAX Function Reference ................................................................ 81
4.3 Browse Function Reference ............................................................. 93
4.4 CAT:JSARRAY Examples ............................................................... 98
4.5 CAT:JSARRAY Function Reference ............................................... 103
4.6 Custom Sub-tags .......................................................................... 106
4.7 Using a Content Server Category as a Data Source ........................ 109
4.8 Data Source Parameters ............................................................... 111
4.9 Drag-and-Drop Functionality .......................................................... 120
4.10 Export Using URLs ........................................................................ 122
4.11 WR Power View ............................................................................ 130
4.12 Initiate WebReport Form Submission Mechanism ............................ 132
4.13 INI Preferences ............................................................................. 133

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server iii


Table of Contents

4.14 Inserting JSON Data ..................................................................... 133


4.15 JavaScript Arrays .......................................................................... 157
4.16 LLURL:FORMEDIT ....................................................................... 159
4.17 LLURL:SIDEBAR .......................................................................... 160
4.18 Logical Expressions ...................................................................... 161
4.19 Page Function Reference .............................................................. 167
4.20 PDF Conversion ........................................................................... 168
4.21 Requests as Data Sources ............................................................ 171
4.22 WebReports Run As Feature ......................................................... 175
4.23 Using a Search Query as a Data Source ........................................ 175
4.24 Server-Side Scripting .................................................................... 177
4.25 Sorting WebReports Results .......................................................... 187
4.26 Using Sub-WebReports ................................................................. 191
4.27 Using Variables ............................................................................. 194
4.28 WR Services ................................................................................. 195
4.29 WR Trigger ................................................................................... 205
4.30 Preventing XSS-vulnerable Syntax in a Parameter Tag in a
Reportview ................................................................................... 209

5 Detailed WebReports Examples ........................................... 211


5.1 AJAX Examples ............................................................................ 211
5.2 Categories and Attributes .............................................................. 215
5.3 Pagination in WebReports ............................................................. 222

iv WebReports User Guide LLESWEBR230300-UGD-EN-01


Chapter 1
Using WebReports

Important
WebReports is a separately licensed module under Content Server. If
WebReports is not available, please contact OpenText Support for information
about how to purchase a license for WebReports.

This help describes the features provided by the Content Server OpenText
WebReports Standard module and enables users to create useful WebReports as
quickly as possible. The intended audience includes business users and developers
who want to use the WebReports module to create or use WebReports.

Note: If you cannot see the WebReports option in your Add Item menu, you
may not have been given access to WebReports by your administrator. Contact
your administrator and request access to WebReports.

1.1 Introduction to WebReports


The WebReports module allows you to create reports within Content Server that
deliver information from any standard, or custom, Content Server tables with any
presentation format desired. Examples of Content Server tables include Forms data,
Workflow data, Task data, document meta-data, and user data. For example, you
can use the WebReports module to create the following items:

• Simple reports that require particular colors, format, style or branding.


• Reports containing hyperlinks to your intranet, the internet, or other locations in
Content Server.
• Reports that present WebForm data including buttons to allow editing of the
form data.
• Printer-friendly reports.
• Integrated database-type applications running within the Content Server,
WebReports module in combination with WebForms.
• Sophisticated reports requiring complex data manipulation.

The WebReports module also provides some useful features related to the running
and storage of report data, for example:

• The option to export the report output within Content Server to a Content Server
Node, to a Content Server Version, to a Content Server WebForm, or to a Content
Server Workflow.
• The option to export the report output externally to email, to the users' desktop,
and if you are the Content Server Admin user, to Content Server.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 5


Chapter 1 Using WebReports

• The ability to set varying default behaviors for running a report.


• The option to schedule reports for delayed delivery of data using email or
Content Server storage.

• The option to run reports in the background without holding up the user's
browser.

1.2 How WebReports Work


WebReports uses data sources, such as LiveReports, to extract the required data
from the database. You can control the report presentation by using a template,
called a reportview, which usually contains standard HTML, and, if desired,
JavaScript. When run, the WebReport inserts the source data into the reportview and
outputs the result to the browser or another destination. The result is an extremely
powerful and flexible reporting technology that can be safely used by Content
Server business users.

LiveReports allow direct access to the Content Server database, so that access to
creating LiveReports is nearly always restricted to administrators. A WebReport
does not allow direct database access. Instead, it uses existing LiveReports, search
queries, or other data sources. Therefore, WebReports may be safely used by
business users and developers who are not administrators.

WebReports and LiveReports reflect and complement the WebForms and WebForm
Templates paradigm for accessing the Content Server database. Users familiar with
the concept of a custom view for a WebForm will be at ease with WebReports, which
uses the same approach.

6 WebReports User Guide LLESWEBR230300-UGD-EN-01


1.3. Getting Started Using WebReports

1.3 Getting Started Using WebReports


The WebReports module provides a new Content Server node type called
WebReport, which can be added to a Content Server workspace from the Add New
Item menu. When creating a new WebReport, the user is prompted to perform the
following tasks:

1. Choose a data source from which the WebReport will be based.


2. Select a reportview to use as the presentation template for the data source.

A WebReport has all the standard properties of other Content Server nodes, such as
a document node, but it also includes functions appropriate to reporting, for
example, Edit Reportview.

Overview of WebReports Procedures


Procedures for WebReports End Users: For end users of WebReports there are
important items related to the running of WebReports to display or export data. The
most useful items for WebReport users are:

• “Exporting the WebReport Output” on page 52


• “Running WebReports” on page 59
• “Setting Schedules for WebReports” on page 61

Procedures for WebReports Developers: For WebReports developers some of the


most useful procedures are:

• “Creating a WebReport” on page 9


• “Offline Editing of a WebReports Reportview or an ActiveView Template”
on page 24
• “Online Editing of a WebReports Reportview or an ActiveView Template”
on page 11
• “Data Source Configuration” on page 34
• “Setting Schedules for WebReports” on page 61
• “WebReports Constants” on page 65
• “Using WebReports Parameters” on page 69
• “Help with Using WebReports Tags“ on page 77
• “WebReports Advanced Information“ on page 79
• “Setting WebReports Permissions” on page 64

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 7


Chapter 2

Working with WebReports

The following sections detail the factors related to the running of WebReports to
display data or to export data for end users of WebReports.

2.1 Creating a WebReport


You can add a WebReport by clicking Add New Item > WebReport. This option
brings up the Add: WebReport page.

Valid data source options include the following:

• LiveReport
Uses the results of a LiveReport query.

• Saved Query
Uses the results of a saved query, which is created from an advanced search.

• Form Template
Uses the results of a query to return all the SQL table data associated with the
selected template.

• Form
Uses the results of a query to return all SQL table data owned by the selected
form.

• Document
Uses a document with either CSV or HTML table-based content.

• Folder, Compound Document, Task List, Task Group, Channel, Discussion,


Binder, Case, Project
Show their respective children when selected.

Note: Binder and Case are only available as optional components when
Template Workspaces is installed.

• External Application
Typically uses HTTP.

For more information about how to create a WebReport, see “To Create a
WebReport” on page 10.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 9


Chapter 2 Working with WebReports

2.1.1 To Create a WebReport


To create a WebReport:

1. On the Add: WebReport page, in the Name box, enter an appropriate title for
the new WebReport.

Note: If your system has multiple languages enabled, when you add to or
edit a text box, such as a title or label, click Edit in multiple languages

to enter or edit the text in the other enabled languages.


2. Optional In the Description box, enter a description for the WebReport.

Notes

• This description will not appear in the WebReport output


• If your system has multiple languages enabled, when you add to or edit

a text box, such as a title or label, click Edit in multiple languages


to enter or edit the text in the other enabled languages.
3. Optional In Data Source area, select a report source:

a. Click Browse Content Server


b. On the Select Data Source page, navigate to data source that you want and
click the Select link.

Note: If you do not select a data source, the row section of the
reportview is ignored.
c. If you select the Go To Source Tab check box, after clicking Add, the
Source tab appears so that you can select other non-Content Server data
sources or modify more specific data source settings.
4. In the Reportview Template box, do one of the following:

• To use a pre-written reportview, select the option for the type of reportview
that you want, then select the reportview that you want from the list.

Tips

– For information about the available pre-written reportviews, see


“Default Reportviews” on page 27.
– After you create the WebReport, you can use the Edit Reportview
function to modify the reportview.
• To choose a reportview from your desktop, click Browse. In the Choose File
to Upload window, navigate to the file that you want to use and click Open.

Note: The file details will auto-populate the corresponding fields.

10 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.2. Online Editing of a WebReports Reportview or an ActiveView Template

5. In the Reportview file box, do one of the following:

• To use a pre-written reportview, click the Use a Default Reportview list and
select from the reportviews provided.

Note: After you create the WebReport, you can use the Edit
Reportview function to modify the reportview.
• To choose a reportview from your desktop, click Browse. In the Choose File
to Upload window, navigate to the file that you want to use and click Open.

Note: The file details will auto-populate the corresponding fields.

6. Optional To associate any predefined attributes with the WebReport, in the


Categories area, click Edit.

7. Optional To select an alternative location in Content Server to store the


WebReport, in the Create In area, do the following:

a. Click Browse Content Server.


b. On the Select Container to Create In page, navigate to the location that you
want and click the Select link.

8. Click Add.

2.2 Online Editing of a WebReports Reportview or an


ActiveView Template
OpenText provides an online editor to modify either an ActiveView template or a
WebReports reportview. Use this editor to create the appropriate look and feel for a
template or a reportview and to insert selected WebReports tags into the code. If you
have just created a template or a reportview using a default, pre-written reportview,
you may want to use the editor to modify it.

You can access the online editor from one of the following nodes:

• ActiveView—From the ActiveView Functions menu or from the promoted


commands, the Edit Template command opens the template in the online editor.
• WebReports—From the WebReports Functions menu or from the promoted
commands, the Edit Reportview command opens the reportview in the online
editor.

Depending on the settings, the online editor will open in one of the following
formats:

• Advanced editor—default, single-pane editor.


• Classic editor—three-pane editor.

The following buttons appear in the editor:

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 11


Chapter 2 Working with WebReports

Validate Runs validation and reports any syntax errors relating to WebReports tag
usage. It will indicate the row numbers where it finds errors and will
include a description of the cause of the problem.

Note: Validation runs automatically, unless you use the [LL_


WEBREPORT_DEBUGON /] tag when you add a version.
Add Version Submits a new version to Content Server and returns the user to the
previous screen.

Note: The latest saved version will take effect immediately.

Add Version & Submits a new version to Content Server and takes you to the top of the
Continue editor page to allow the user to continue editing.

Tip: If you use the CTRL-S hotkey to add a version and continue,
the editor will save the version, refresh the page, and return you to
the line you were working on rather than taking you to the top of
the page.
Reset Keeps you in the Online Editor and clears any changes made in the
current session.
Diff (Advanced editor only) To open Diff mode, click the Diff button. To exit Diff
mode, click the Diff button again. For more information about how to use
Diff mode to compare different versions of the ActiveView template or
WebReports reportview, see .
Cancel Returns you to your previous location and reverts any unsaved changes
that you have made.
Undo (Classic editor only) Reverts the last change that you made.
Redo (Classic editor only) Repeats the last change that you made.
Search Search using CTRL-F.
Settings Opens the My Settings page to the Editor Settings area on the Content
Intelligence tab to allow you to change the editor configuration.
Debug Report Exports the report as a text file with both the original source and the
compiled source to assist with debugging. This is usually only required
when specifically requested by OpenText Support.
Tag Guide Opens the WebReports Tag Guide, which provides documentation for
each available tag, such as descriptions, formatting, correct syntax, and
examples of usage.
Enter Full (Advanced editor only) To enter Full Screen mode, click the Enter Full
Screen Mode / Screen Mode button . To exit Full Screen mode, click the Exit Full
Exit Full Screen Screen mode button .
Mode /
Mode List Selecting a mode from the Mode list temporarily changes the editor to a
different mode.

Note: The Mode list selection does not affect the Default mode.

12 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.2. Online Editing of a WebReports Reportview or an ActiveView Template

Parm List The Parm feature allows you to quickly define new parameters for the
node being edited.
• Click the Parm link to open a window showing the Properties page >
Parameters tab, for the node being edited.
• Click the Check Parameters Tab for Updates button to update the
Parm list with any new parameters that have been defined in other
windows during the current editing session.
• After selecting a parameter in the Parm list, you can click the Copy To
button to drag the syntax for that parameter into the editor.
Constant List The Constant feature allows you to quickly define new constants for the
node being edited.
• Click the Constant link to open a window showing the Properties
page > Constants tab, for the node being edited.
• Click the Check Constants Tab for Updates button to update the
Constant list with any new parameters that have been defined in other
windows during the current editing session.
• After selecting a parameter in the Constant list, you can click the Copy
To button to drag the syntax for that constant into the editor.
Control List The Control feature allows you to quickly reference the tag guide
information for the control tag you select in the Control list.
• Click the Control link to open the control tag help for the tag selected
in the Control list.
• Click the Copy To button to drag the selected control tag into the
editor.
Data List The Data feature allows you to quickly reference the tag guide
information for the data tag you select in the Data list.
• Click the Data link to open the data tag help for the tag selected in the
Control list.
• Click the Copy To button to drag the selected control tag into the
editor.
Sub List The Sub feature allows you to quickly reference the tag guide information
for the sub-tag you select in the Sub list.
• Click the Sub link to open the sub-tag help for the tag selected in the
Sub list.
• Click the Copy To button to drag the selected sub-tag into the
editor.

After making the desired changes, clicking Add Version or Add Version &
Continue creates a new version with these changes.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 13


Chapter 2 Working with WebReports

2.2.1 Using the Advanced Editor for a WebReports


Reportview
The Advanced editor is the new default, single-pane editor that contains multiple
features to improve the development experience. .

The Advanced editor includes some of the following enhancements:

• A single text area for editing


• Syntax highlighting for the following languages:

– CSS
– Handlebars
– HTML
– Javascript
– JSON
– Markdown
– WebReports
– XML
• Auto-completion and auto-suggestions
• Diff mode
• Mode validation
• Line numbers
• Code folding

The Advanced editor includes the following interface changes:

• Single Pane for Editing


The Advanced editor has a single text area instead of the three text areas in the
Classic editor. Although the concepts of the header section, row section, and
footer section still exist, each section no longer has a dedicated text area in the
Advanced editor. These sections are defined as follows:

– Header Section
Any text that appears before the [LL_WEBREPORT_STARTROW /] tag.
– Row Section
Any text that appears between the [LL_WEBREPORT_STARTROW /] tag and the
[LL_WEBREPORT_ENDROW /] tag.

– Footer Section
Any text that appears after the [LL_WEBREPORT_ENDROW /] tag.

14 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.2. Online Editing of a WebReports Reportview or an ActiveView Template

• Diff Button
Clicking the Diff button opens the Diff mode. Clicking the Diff button again
closes the Diff mode.
• Full Screen Button
Clicking the Enter Full Screen Mode button opens Full Screen mode. Clicking
the Exit Full Screen Mode button closes Full Screen mode.
• Go to Row Section Button
Clicking the Go to Row Section button scrolls the report to the Row section
and places the cursor immediately following the LL_WEBREPORT_STARTROW tag.
• Extend Check Box
Selecting this check box will extend the current mode to include WebReports
syntax highlighting.
• Mode List
Selecting a mode from the Mode list temporarily changes the editor to a different
mode.

Note: The Mode list selection does not affect the Default mode.

Customizing the Advanced Editor for WebReports


You can customize the Advanced editor according to your preferences.

Access the Advanced editor settings in one of the following ways:

• From the Global menu, click My Account > Settings > Content Intelligence.
• From the Advanced editor, click the Settings button to open your Settings page
to the Content Intelligence tab.

The Content Intelligence tab includes the following editor settings:

Use Advanced This check box is selected by default. Clear this check box to use the
Editor Classic three-pane editor.
Default Controls the color scheme used for the editor itself. This includes the
Themes background color for the editor and the colors used for syntax
highlighting.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 15


Chapter 2 Working with WebReports

Default Mode This setting reflects the mode that loads each time the editor opens. This
mode should match the programming language of the file that you
currently have open in the editor. It determines which rules should be
used for the attributes such as syntax highlighting, auto-suggestion, code
folding, and so on. For example, if you are working on an HTML-based
WebReport, you should select HTML from the Mode list. When the
Advanced editor is open, you can select a mode from the Mode list. This
mode selection will persist for the duration of the current editing session.
The next time you open the editor, the Default mode setting will take
effect.

Note: The Text mode is a plain-text mode that disables any mode-
specific functionality, including features such as syntax
highlighting, auto-closing, auto-completion, snippets, code folding.
You can use the Text mode to simplify the Advanced editor or to
work with languages that are not yet available in the editor.

• Enable WebReports Mode Extensions


Selecting this check box extends the selected Default mode to support
WebReports tag syntax highlighting. For example, if the content you
are working on is XML-based and contains WebReports tags, you
should select XML from the Mode list and select the Enable
WebReports Mode Extensions check box. This allows you to highlight
XML and WebReports syntax within the text in the editor.
• Validate Mode Syntax
Selecting this check box, enables live syntax validation for the current
mode. The live validation only scans the programming language itself,
such as Javascript, or HTML, and does not validate any WebReports
syntax that might exist in the content.

Note: WebReports syntax does not currently support live


validation. You can validate the WebReports syntax by clicking
Validate in the editor, or by using the CTRL-SHIFT-V keyboard
shortcut (CMD-SHIFT-V on a Mac).
Font Size Specifies the size of the font used in the editor.
Word Wrap Controls whether text that appears on a line that is longer than the width
of the editor will wrap to the next line, or if it will continue on the same
line.
Show Gutter Controls whether or not the gutter is shown in the editor. The gutter
appears beside the editor and contains the line numbers, validation icons,
and folding icons.
Show Invisible Select this check box to show characters that are normally hidden, for
Characters example, carriage returns, tabs, and so on.
Code Folding Code folding allows you to collapse or expand blocks of code. This can
simplify navigation through large or complex reports.
Highlight When enabled, the editor will highlight the entire line on which the cursor
Active Line is currently located. This helps you to quickly and visually locate the
cursor position.

16 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.2. Online Editing of a WebReports Reportview or an ActiveView Template

Highlight When enabled, the editor will automatically scan the current document
Matching and highlight any matches for the currently selected text. This allows you
Words to quickly find occurrences of bits of text without performing an explicit
search.
Auto-Closing When enabled, the editor will automatically insert the closing characters
for a given block of code. For example, when in HTML mode, when the
final “>” is typed in the <table> element, the editor will automatically add
the closing </table> tag at the cursor position. The exact behavior depends
on the currently selected mode.

Note: WebReports syntax itself currently does not yet support auto-
closing.
Basic Auto- When enabled, the autocomplete dialog only appears when you use the
Complete CTRL-SPACE keyboard shortcut and if there are matches to suggest from
the autocomplete dialog.
Live Auto- When enabled, the autocomplete dialog appears as soon as a match is
Complete found in the autocomplete library, without requiring additional key
presses.
Enable When enabled, snippets appear in the autocomplete dialog and are
Snippets available for use.
Always Launch When enabled, the editor will always open in full screen mode.
in Full Screen

Highlighting WebReports Syntax


The Advanced editor can highlight WebReports syntax in the following ways:

• In the Mode list, select WebReports to highlight only WebReports syntax.


• Select the Extend check box.

Note: This change only affects the current editing session. The Extend
setting resets to the default, the next time you load the editor.
• Enable the Enable WebReports Mode Extensions check box in the editor
settings.

The exact syntax highlighting used depends on the mode and the theme in use, as
well as the programming syntax itself. In general, the WebReports syntax
highlighting obeys the following rules:

• Both single-line and block WebReport comments are styled to appear as


comments.
• Content Control tags ([LL_WEBREPORT_xyz /]) and all Data tags ([LL_REPTAG_
xyz /], including parameter, constants, column reference tags, and PowerView
tags) use the same styling.
• Sub-tags use a different styling than Content Control tags, Data tags, and
comments.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 17


Chapter 2 Working with WebReports

• Any text inside of a pair of quotation marks is treated as a string and will not be
parsed by the syntax highlighting rules. Any nested tags inside the quotation
marks will not be highlighted, but will appear as part of the string itself.
For example, in the following tag:
[LL_REPTAG=DATAID NODEACTION:RENAME:"my new name #[LL_REPTAG_&revision INT /]" /]

the “my new name #[LL_REPTAG_&revision INT /]” will be stylized as a string.

If using WebReports syntax inside of another mode, such as Javascript or CSS, the
WebReports syntax highlighting rules can be overridden by that mode's
highlighting rules. For example, in HTML mode, any WebReports syntax that
appears in an attribute value of an HTML element (<a href="[LL_REPTAG_MYURL /
]">click</a>) will be styled as a string according to the HTML syntax highlighting
rules.

Notes

• When the mode is set to WebReports, the Extend check box is automatically
selected but is not editable since the WebReports mode cannot be extended
with itself.
• When the mode is set to Text, the Extend check box automatically clears and
disabled, since this mode is a plain-text mode and does not have any syntax
highlighting rules.

Compare Versions of a WebReports Reportview Using the Diff


Mode
Diff mode opens two side-by-side text-area panes to compare different versions of
your ActiveView template or WebReports reportview. You can use Diff mode to
perform the following actions:

Compare
Diff mode uses blue highlighting to show the differences between the current
version, in the edit pane on the right, to the previous version, in the read-only
pane on the left. By default, the previous version used for comparison is the
immediately preceding version.

Select the Version to Compare


By default, the Diff mode shows the current version in the edit pane on the right
and the immediately preceding version in the read-only pane on the left. A
Version Picker bar listing all appears to the left of the read-only pane in Regular
mode and above the panes in Full Screen mode. To change the version in the
read-only pane, go to the Version Picker bar and click the button for the specific
version that you want.

• If you are working with the most recent or current version in the editor,
when you click the Diff button, the read-only pane on the left will show the
version immediately preceding the current one, as indicated in the pane title
and by the highlighted version button on the Version Picker bar.

18 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.2. Online Editing of a WebReports Reportview or an ActiveView Template

• If you use the Versions page to open a previous version in the editor, when
you click the Diff button, the read-only pane on the left will show the most
recent version as indicated in the pane title and by the highlighted version
button on the Version Picker.
• The Version Picker bar includes buttons for the number of past versions, as
specified in the Version Limit setting configured by the administrator, up to
a maximum of 20. If you point to a version button on the Version Picker bar,
the tooltip will show the date and time that the version was saved.

Highlight the Previous Difference or the Next Difference


After selecting a version from the Version Picker bar, if there are any differences,
the Diff title bar shows a counter with arrow buttons. Click Previous to
highlight the previous difference or click Next to highlight the next difference.
Edit
Edit the current version in real time using the edit panel on the right.

Note: The panel on the left that shows the previous version is read-only.

Merge
You can merge content differences from the read-only pane on the left to the edit
pane on the right. Navigate to the highlighted content that you want to merge,
then click the Copy to right button .

Tip: To undo a merge, click in the edit panel and press CTRL + Z.

Add a Version

• To save the current version in the edit panel and close the editor, click Add
Version.
• To save the current version in the edit panel, leave Diff mode, and continue
working in the editor, click Add Version & Continue.

Tip: If you click Add Version or Add Version & Continue, the editor will
add a version even if you have not made any changes.
Scroll
You can independently scroll the current version in the right panel and the
previous version in the left panel.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 19


Chapter 2 Working with WebReports

Using Snippets
Snippets are prebuilt code templates that you can insert into the editor using a few
key strokes. To use snippets, you must configure the Advanced editor settings so
that you select either the Basic Auto-Complete check box or the Live Auto-
Complete check box and then select the Enable Snippets check box. If enabled,
snippets appear in the autocomplete dialog based on the text that is entered and the
current mode.

When you find a snippet for your input, press UP ARROW or DOWN ARROW to
navigate the autocomplete list to the specific snippet that you want, and then press
TAB to insert that snippet. Each variable in the snippet is denoted by $(<n>). Press
TAB to advance to the next variable. When there are no variables left, press TAB to
exit the snippet.

Keyboard Shortcuts for the Advanced Editor


The Advanced editor supports the following keyboard shortcuts:

Table 2-1: Copy/Move Shortcuts

Action Windows/Linux Mac


Remove line CTRL-D COMMAND-D
Copy lines down ALT-SHIFT-DOWN COMMAND-OPTION-
ARROW, CTRL-SHIFT-D DOWN ARROW
Copy lines up ALT-SHIFT-UP ARROW COMMAND-OPTION-UP
ARROW
Move lines down ALT-DOWN ARROW OPTION-DOWN ARROW
Move lines up ALT-UP ARROW OPTION-UP ARROW
Remove to line end ALT-DELETE CTRL-K
Remove to line start ALT-BACKSPACE COMMAND-BACKSPACE
Remove word left CTRL-BACKSPACE OPTION-BACKSPACE ,
CTRL-OPTION-
BACKSPACE
Remove word right CTRL-DELETE OPTION-DELETE

Table 2-2: Find/Replace Shortcuts

Action Windows/Linux Mac


Find CTRL-F COMMAND-F
Replace CTRL-H COMMAND-OPTION-F
Find next CTRL-K COMMAND-G
Find previous CTRL-SHIFT-K COMMAND-SHIFT-G

20 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.2. Online Editing of a WebReports Reportview or an ActiveView Template

Table 2-3: Folding Shortcuts

Action Windows/Linux Mac


Fold selection ALT-L, CTRL-F1 COMMAND-OPTION-L,
COMMAND-F1
Unfold selection ALT-SHIFT-L, CTRL- COMMAND-OPTION-
SHIFT-F1 SHIFT-L, COMMAND-
SHIFT-F1
Fold all ALT-0 COMMAND-OPTION-0
Unfold all ALT-SHIFT-0 COMMAND-OPTION-
SHIFT-0

Table 2-4: Go to Shortcuts

Action Windows/Linux Mac


Go to left LEFT ARROW LEFT ARROW, CTRL-B
Go to right RIGHT ARROW RIGHT ARROW, CTRL-F
Go to word left CTRL-LEFT ARROW OPTION-LEFT ARROW
Go to word right CTRL-RIGHT ARROW OPTION-RIGHT ARROW
Go line up UP ARROW UP ARROW, CTRL-P
Go line down DOWN ARROW DOWN ARROW, CTRL-N
Go to line start ALT-LEFT ARROW, HOME COMMAND-LEFT
ARROW, HOME, CTRL-A
Go to line end ALT-RIGHT ARROW, END COMMAND-RIGHT
ARROW, END, CTRL-E
Go to page up PAGEUP OPTION-PAGEUP
Go to page down PAGEDOWN OPTION-PAGEDOWN ,
CTRL-V
Go to start CTRL-HOME COMMAND-HOME,
COMMAND-UP ARROW
Go to end CTRL-END COMMAND-END,
COMMAND-DOWN
ARROW
Go to line CTRL-L COMMAND-L
Scroll line down CTRL-DOWN ARROW COMMAND-DOWN
ARROW
Scroll line up CTRL-UP ARROW ---
Go to matching bracket CTRL-P ---

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 21


Chapter 2 Working with WebReports

Table 2-5: Other Shortcuts

Action Windows/Linux Mac


Indent TAB TAB
Outdent SHIFT-TAB SHIFT-TAB
Undo CTRL-Z COMMAND-Z
Redo CTRL-SHIFT-Z, CTRL-Y COMMAND-SHIFT-Z,
COMMAND-Y
Toggle comment CTRL-FORWARD SLASH COMMAND-FORWARD
SLASH
Transpose letters CTRL-T CTRL-T
Enter full screen CTRL-ENTER COMMAND-ENTER
Change to lower case CTRL-SHIFT-U CTRL-SHIFT-U
Change to upper case CTRL-U CTRL-U
Overwrite INSERT INSERT
Validate WebReport Syntax CTRL-SHIFT-V COMMAND-SHIFT-V
Add version (quick save) and CTRL-S COMMAND-S
resume from current line

Table 2-6: Selection Shortcuts

Action Windows/Linux Mac


Select all CTRL-A COMMAND-A
Select left SHIFT-LEFT ARROW SHIFT-LEFT ARROW
Select right SHIFT-RIGHT ARROW SHIFT-RIGHT ARROW
Select word left CTRL-SHIFT-LEFT ARROW OPTION-SHIFT-LEFT
ARROW
Select word right CTRL-SHIFT-RIGHT OPTION-SHIFT-RIGHT
ARROW ARROW
Select line start SHIFT-HOME SHIFT-HOME
Select line end SHIFT-END SHIFT-END
Select to line end ALT-SHIFT-RIGHT COMMAND-SHIFT-RIGHT
ARROW ARROW
Select to line start ALT-SHIFT-LEFT ARROW COMMAND-SHIFT-LEFT
ARROW
Select up SHIFT-UP ARROW SHIFT-UP ARROW
Select down SHIFT-DOWN ARROW SHIFT-DOWN ARROW
Select page up SHIFT-PAGEUP SHIFT-PAGEUP

22 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.2. Online Editing of a WebReports Reportview or an ActiveView Template

Action Windows/Linux Mac


Select page down SHIFT-PAGEDOWN SHIFT-PAGEDOWN
Select to start CTRL-SHIFT-HOME COMMAND-SHIFT-UP
ARROW
Select to end CTRL-SHIFT-END COMMAND-SHIFT-
DOWN ARROW
Duplicate selection CTRL-SHIFT-D COMMAND-SHIFT-D
Select to matching bracket CTRL-SHIFT-P ---

2.2.2 Using the Classic Editor for a WebReports Reportview


The Classic editor is a three-pane editor that contains a Header section, a Row
section, and a Footer section. This is the editor that developers for Content Server
version 16.2.11 and earlier will be familiar with. The Classic editor includes the
following components:

• Header Section
Specifies code that should run at the beginning. This code is only output once,
regardless of how many report rows are being read from the underlying data
source. Opening tags like <TABLE> should be included in this section. If you
include the standard Content Server header, you do not need to include <HTML>
or <BODY> tags. By default, the Content Server header is included unless you use
the [LL_WEBREPORT_EXCLUDEHEADER /] tag.

• [LL_WEBREPORT_STARTROW /] Line
You cannot edit this line. It shows where the start row tag will be inserted so that
users do not try to add another one.

• Row Section
Defines code that should be applied to all data rows. Tags that refer to data
source column data only work in this section.

Important
Anything in this section is repeated for every row of the data source. For
example, if there are 10 rows of report data to be returned, everything in
this section will appear 10 times in the output. The exception is if you use
conditional tags to exclude data from the output. For more information
about how to use WebReports tags, see “Help with Using WebReports
Tags“ on page 77.

• [LL_WEBREPORT_ENDROW /] Line
You cannot edit this line. It shows where the end row tag will be inserted so that
users do not try to add another one.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 23


Chapter 2 Working with WebReports

• Footer Section
Specifies code that should run at the end. This code only outputs once regardless
of how many report rows are being read from the underlying data source. End
tags like </TABLE> should be in this section.

After you make the desired changes, click Add Version or Add Version & Continue
to create a new version that includes your changes.

2.2.3 Switching Between the Advanced Editor and the Classic


Editor for a WebReports Reportview
By default, when you edit an ActiveView template or a WebReports reportview, you
will use the Advanced editor. You can switch from the Advanced editor to the
Classic editor, or the reverse, in the following way:

1. Access the Advanced editor settings in one of the following ways:

• From the Global menu, click My Account > Settings > Content Intelligence.
• From the Advanced editor, click the Settings button to open your Settings
page to the Content Intelligence tab.
2. Do one of the following:

• To switch to the Classic, three-pane editor, clear the Use Advanced Editor
check box.
• To switch to the Advanced editor, select the Use Advanced Editor check box.
3. Click Update to save the changes.

After you save the Advanced editor settings, the selected editor will load when you
access the online editor.

2.3 Offline Editing of a WebReports Reportview or an


ActiveView Template
If you do not want to use the online editor, you can download the contents of the
ActiveView template or WebReports reportview and use any text or HTML editor to
edit it as a standalone file on your desktop. Use the editor to create the appropriate
look and feel.

24 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.4. Adding a New Reportview

2.4 Adding a New Reportview


You can create reportviews using standard desktop HTML editing packages, or text
editors outside of Content Server. To add a new version of a reportview created off-
line, choose Add Reportview Version from the Functions menu for the WebReport
node.

2.5 Reportview Files


The reportview is a template for formatting the data source. It may be any language
or syntax that is supported by the end user application to build the structure and
appearance of the output document. Examples of the end user application include
HTML, JavaScript, or SpreadsheetML. To be useful, it must also contain WebReports
tags which are similar to the format used by Content Server WebForms.

You can do the following with a reportview:

• A reportview is a file, often in HTML format, containing special tags which


define how and where data from Content Server should be inserted.
• Use any text editor to create a reportview.
• By default, the standard Content Server header, including the dashboard and
menus, is added to the reportview, but you can use the [LL_WEBREPORT_
EXCLUDEHEADER /] tag to disable the header.

• By default, the standard Content Server footer is added to the reportview, but
you can use the [LL_WEBREPORT_EXCLUDEFOOTER /] tag to disable the footer.

2.5.1 Structure of the Reportview


A reportview has the following structure:

1. The Header Section includes any text that appears before the [LL_WEBREPORT_
STARTROW /] tag. The header specifies code that should run at the beginning of
the WebReport. This code is only output once, regardless of how many report
rows are being read from the underlying data source. If the standard Content
Server header is being included, it is not necessary to include <HTML> or
<BODY> tags. By default, the Content Server header is included unless you use
the [LL_WEBREPORT_EXCLUDEHEADER /] tag.
2. The Row Section includes any text that appears between the [LL_WEBREPORT_
STARTROW /] tag and the [LL_WEBREPORT_ENDROW /] tag. This section defines
code that should be applied to all data rows. Tags that refer to data source
column data works only in this section. It is important to note that anything in
this section is repeated for every row of the data source. The exception is if you
use conditional tags to exclude data from the output. For example, if there are 10
rows of report data returned by the data source, everything in this section will
appear 10 times in the output of the WebReport. If the WebReport does not have
a data source, or if its data source returns zero rows, the output from this section

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 25


Chapter 2 Working with WebReports

is excluded. For more information, see “Help with Using WebReports Tags“
on page 77.
3. The Footer Section includes any text that appears after the [LL_WEBREPORT_
ENDROW /] tag. The footer specifies code that should run at the end of the
WebReport. This code is only output once regardless of how many report rows
are being read from the underlying data source.

2.5.2 Example Reportview


In the following reportview example, WebReports tags begin with [LL_REPTAG_,
while HTML tags appear in italic. In this example the report generates a summary of
customer issues that have been captured using Workflows and forms. The data
source in this case is a LiveReport. Note how the tags in the row template section
specify which LiveReport column to obtain the data from. They do this by specifying
the column number [LL_REPTAG_1 /] or by specifying the LiveReport column name
[LL_REPTAG=Customer /]:

[LL_REPTAG_URLPREFIX /][LL_REPTAG=VolumeID LLURL:FORMEDIT:1 /]

Example 2-1: Reportview Example

<HTML>
<HEAD>
<TITLE>Sample Report</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<CENTER><H1>Sample Report</H1></CENTER>
<P><SMALL>Created by [LL_REPTAG_USERFULLNAME /], Username: [LL_REPTAG_USERNAME /]</
SMALL></P>
<HR>
<TABLE BGCOLOR="#FFFFFF" BORDER="3" CELLPADDING="1" CELLSPACING="1" WIDTH="100%">
<TR BGCOLOR="#CCCCCC">
<TD ALIGN="CENTER" NOWRAP VALIGN="MIDDLE">ID</TD>
<TD ALIGN="CENTER" NOWRAP VALIGN="MIDDLE">Issue Title</TD>
<TD ALIGN="CENTER" NOWRAP VALIGN="MIDDLE">Issue Type</TD>
<TD ALIGN="CENTER" NOWRAP VALIGN="MIDDLE">Customer Name</TD>
<TD ALIGN="CENTER" NOWRAP VALIGN="MIDDLE" WIDTH="30%">Activity Record</TD>
<TD ALIGN="CENTER" NOWRAP VALIGN="MIDDLE">Form Link</TD>
</TR>
[LL_WEBREPORT_STARTROW /]
<TR>
<TD ALIGN="LEFT" NOWRAP VALIGN="MIDDLE">
[LL_REPTAG_1 /]
</TD>

<TD ALIGN="LEFT" NOWRAP VALIGN="MIDDLE">


[LL_REPTAG_2 CAPITALIZE /]
</TD>

<TD ALIGN="LEFT" VALIGN="MIDDLE">


[LL_REPTAG_3 UPPER /]
</TD>

<TD ALIGN="LEFT" VALIGN="MIDDLE">


[LL_REPTAG=Customer /]
</TD>

<TD ALIGN="LEFT" VALIGN="MIDDLE">


[LL_REPTAG=ActivityRecord HTMLCR /]
</TD>

26 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.5. Reportview Files

<TD ALIGN="LEFT">
<A HREF="[LL_REPTAG_URLPREFIX /][LL_REPTAG=VolumeID LLURL:FORMEDIT:
1 /]&nexturl=[LL_REPTAG_MYURL ESCAPEURL /]">Edit form</A>
</TD>
</TR>

[LL_WEBREPORT_ENDROW /]

</TABLE>
<HR>
</BODY>
</HTML>

<P><SMALL>Created on ... [LL_REPTAG_DATE /]</SMALL></P>


</BODY>
</HTML>

2.5.3 Default Reportviews


When adding a new WebReport to Content Server, the user is given the option of
selecting a default reportview. Default reportviews provide a variety of generic
starting points that can be used for developing a WebReport. Some reportviews may
be useful immediately but in other cases it will be necessary to edit them to meet
specific requirements. After you create a WebReport using a default reportview, you
can either edit the reportview online, or download the reportview for editing on
your desktop. These default reportviews are provided when the WebReports
module is installed; however, a Content Server administrator can modify them to
provide a corporate look and feel.

The following tables briefly describe the various types of default reportview
templates.

The Add WebReport page, lists the default reportview templates according to the
option that you select:

Reportview Template Option Table


All This option lists all the default reportview
templates. The list includes the following
templates:
• “General Reportviews” on page 28,
which lists the templates that are not
specific to any particular reportview type
and which only appear when All is
selected.
• “Classic View Reportviews” on page 28
• “Smart Style Reportviews” on page 29
• “Smart Widget Reportviews”
on page 30
• “Data Format Reportviews” on page 32
Classic View “Classic View Reportviews” on page 28

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 27


Chapter 2 Working with WebReports

Reportview Template Option Table


Smart Style “Smart Style Reportviews” on page 29
Smart Widgets “Smart Widget Reportviews” on page 30
Data “Data Format Reportviews” on page 32

Table 2-7: General Reportviews

Reportview Name Description


Blank Report A blank reportview that the developer can
use for creating something from scratch.
HTML Table Report - No Formatting Designed with no frills to be an HTML
reportview that results in a tabulated format
that can be readily interpreted by
WebReports if the output were to be used as
a data source.

Table 2-8: Classic View Reportviews

Reportview Name Description


Browse Table Report Mimics the standard Content Server folder
browse functionality, with added sidebar
functionality.
Browse Table Report – AJAX Mimics the standard Content Server folder
browse functionality, with added sidebar
functionality. It uses AJAX requests for each
pagination/filter/sort action, similar to a core
Folder browser view. For supported clients,
it also includes Drag and Drop without
WebDAV.
Form Report Replaces the WebForms List Data
functionality. Also provides appropriately-
permissioned links for the editing and
deletion of form data.
Form Report - Scripted Advanced reportview. Contains server-side
scripting and must be enabled by your
administrator. Provides the user with
dynamic columns and filters so that it can be
applied to a form data source with any
number of fields.
HTML Table Report - Basic Formatted Designed with no frills to be the fastest of the
HTML reportviews because it contains less
HTML and fewer sub-tags.

To open a very simple preformatted report in


Microsoft Excel, remove the Functions menu
and other graphics, and then set the MIME
type to application/vnd.ms.excel.

28 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.5. Reportview Files

Reportview Name Description


HTML Table Report - Basic Scripted Similar to “HTML Table Report - Basic
Formatted”, but using OScript in the
reportview. Useful as a starting point for
reports using server side scripting.

Table 2-9: Smart Style Reportviews

Reportview Name Description


Smart Style Simplified Browse Mimics the standard Content Server folder
browse functionality in Smart View, with
added inline action functionality.
Smart Style Simplified Browse With Chart Mimics the standard Content Server folder
browse functionality in Smart View, with
added inline action functionality and a chart.
Smart Style Simplified Metadata Provides a preconfigured WebReport to
display properties or metadata for a single
node. This reportview can be used as a sub-
WebReport for the Smart Style Simplified
Browse reportview.
Smart Style Simplified Table Provides a preconfigured WebReport to
display generic data in a tabular view that is
consistent with Smart View styling.
Smart Style Visual Count Chart Provides a preconfigured WebReport to
display data in a widget consistent with the
Visual Count widget for the Smart View.
Optionally, this could allow users to click a
segment of a chart to open the table report of
the data for that segment.

Tip: Smart Style reportviews are only supported on systems using the new
Perspective node type. You must convert any legacy deprecated ActiveView
Perspectives to the new Perspective node type before you can use any Smart
Style reportviews. For more information, see OpenText Content Server -
ActiveView Administration Guide (LLESAV-AGD).

Notes

• You can run a Smart Style WebReport directly from Smart View or
embedded as a widget in a Perspective.
• If you try to open a Smart Style WebReport in Classic View, you will be
prompted to redirect to Smart View.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 29


Chapter 2 Working with WebReports

Table 2-10: Smart Widget Reportviews

Reportview Name Description


HTML WebReport Widget - Image and Icons Provides simple HTML/CSS examples that
Report demonstrate the recommended way of
writing code to be used in a WebReports
HTML widget for the Smart View. Includes
examples of how to use bootstrap UI
components, how to name CSS selectors to
avoid conflicts, how to incorporate
responsive images, and how to use icons.
HTML WebReport Widget - Responsive Provides simple HTML/CSS examples that
Table Report demonstrate how to use bootstrap to build a
responsive HTML table to use in an
WebReport HTML widget for the Smart
View.
Nodes List WebReport Widget - Report Designed to be used specifically with the
JSON WebReports Nodes List widget for the Smart
View. Includes the necessary tag that
generates the correct JSON to be consumed
by the widget and handles the necessary
filtering, sorting, and pagination on the
server. For more information, see
“@NODESTABLEFIELDS” on page 145.
Table Report Widget - Data Processing in Designed to be used with the WebReports
Data Source JSON Table Report components for the Smart
View. Includes the required tag that
generates the correct JSON to be consumed
by these components and handles the
necessary filtering, sorting, and pagination in
the data source. Supports filtering in the
datasource using the where_(column
name) parameter sent by the TableReport
client widget. Supports sorting in the
datasource using the sort parameter sent by
the TableReport client widget. Supports
pagination in the datasource using the
limit and page parameters sent by the
TableReport client widget. For more
information, see “@TABLEREPORT”
on page 146.

30 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.5. Reportview Files

Reportview Name Description


Table Report Widget - Data Processing in Designed to be used with the WebReports
WebReport JSON Table Report components for the Smart
View. Includes the required tag that
generates the correct JSON to be consumed
by these components and handles the
necessary filtering, sorting, and pagination
on the server. Supports filtering using the
where_(column name) parameter sent by
the Table Report client widget. Supports
sorting using the sort parameter sent by the
Table Report client widget. Supports
pagination using the limit and page
parameters sent by the Table Report client
widget. For more information, see
“@TABLEREPORT” on page 146.
Visual Count Widget – Clickthrough to Data Designed to be used specifically with the
Visual Count widget for Smart View if you
are using a small dataset of nodes. It allows
users to click a segment of a chart to open the
data for that segment. For Content Server
nodes data, it opens a nodes list and for non-
Content Server data, it opens a table report.
For more information about how to use the
Visual Count widget, see the Online Help
available in the Perspective Manager.
Visual Count Widget - Grouping in Data Designed to be used specifically with the
Source JSON Visual Count widget for the Smart View if
you have a large dataset and need to group
the data in the data source. For more
information about how to use the Visual
Count widget, see the Online Help available
in the Perspective Manager.
Visual Count Widget - Grouping in Data Designed to be used specifically with the
Source Simplified JSON Visual Count widget for the Smart View if
you have simple, pre-grouped, static data in
a data source such as a tab-separated-value
(TSV) file or a comma-separated-value (CSV)
file. For more information about how to use
the Visual Count widget, see the Online Help
available in the Perspective Manager.
Visual Count Widget - Grouping in Designed to be used specifically with the
WebReport JSON Visual Count widget for the Smart View if
you have a small to moderate sized dataset
and need to group the data in a WebReport.
For more information about how to use the
Visual Count widget, see the Online Help
available in the Perspective Manager.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 31


Chapter 2 Working with WebReports

Reportview Name Description


Visual Count Widget - Grouping on Client Designed to be used specifically with the
JSON Visual Count widget for the Smart View if
you have a small dataset. If you use this
template, the data will be grouped in the
browser.

Note: If you want the chart categories


to be clickable in the Visual Count
widget so that they expand to show
click-through data, use the “Visual
Count Widget – Clickthrough to Data”
template instead.

For more information about how to use the


Visual Count widget, see the Online Help
available in the Perspective Manager.

Table 2-11: Data Format Reportviews

Reportview Name Description


Comma Separated Values Report Outputs your data in a CSV format. Double
quotes are used as the escape sequence.
Comma Separated Values Report - Scripted Similar to “Comma Separated Values
Report”, but using OScript in the reportview
to handle any number of columns.
Open XML Report - SpreadsheetML A basic example of SpreadsheetML with
minimal formatting. It places report data into
a simple table. The resulting file is a
complete and portable document that by
default opens in MS Excel.

Note: For Excel to open by default, you


must set the destination MIME type to
text/xml or application/vnd.
ms-excel.
Open XML Report - WordprocessingML Allows WebReports to view Content Server
data in a preformatted Word document
using WordML. This format is only
supported by newer versions of Microsoft
Office.

Note: You must set the destination


MIME type to application/msword
or text/xml for Word to open.

32 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.5. Reportview Files

Reportview Name Description


XML Report A very simple XML report that you can use
in an Ajax-type situation to pull back
additional data to an application.

Important
Remember to set the destination MIME
type to text/xml.

Starting from Content Server 16.2.11, default reportview names are now translatable.
If your system language is set to a language other than English, the template names
will appear in that language.

Any reports using the original reportview names from Content Server 16.2.10 and
earlier will continue to be supported.“Default Reportview Name Mappings”
on page 33 shows how the original reportview names correspond to their updated
names.

Table 2-12: Default Reportview Name Mappings

Name from Content Server 16.2.10 and Name from Content Server 16.2.11 and
earlier onwards
basic_report HTML Table Report - Basic Formatted
basic_scripted HTML Table Report - Basic Scripted
blank_report Blank Report
browse_flexible_with_sidebar Browse Table Report
browse_flexible_with_sidebar_ajax_requests Browse Table Report - AJAX
csv_report Comma Separated Values Report
csv_scripted Comma Separated Values Report -
Scripted
form_report Form Report
form_scripted Form Report - Scripted
plainhtml_report HTML Table Report - No Formatting
spreadsheetml_report Open XML Report - SpreadsheetML
widget_html_report_image_icons_sample HTML WebReport Widget - Image and
Icons Report
widget_html_report_responsive_table_sample HTML WebReport Widget - Responsive
Table Report
widget_nodeslist_nodestable Nodes List WebReport Widget - Report
JSON
widget_table_report_process_data_in_datasourc Table Report Widget - Data Processing in
e Data Source JSON

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 33


Chapter 2 Working with WebReports

Name from Content Server 16.2.10 and Name from Content Server 16.2.11 and
earlier onwards
widget_table_report_process_data_in_webrepor Table Report Widget - Data Processing in
t WebReport JSON
widget_visual_count_grouping_in_datasource Visual Count Widget - Grouping in Data
Source JSON
widget_visual_count_grouping_in_data_source Visual Count Widget - Grouping in Data
_simple Source Simplified JSON
widget_visual_count_grouping_in_webreport Visual Count Widget - Grouping in
WebReport JSON
widget_visual_count_grouping_on_client Visual Count Widget - Grouping on
Client JSON
wordml_report Open XML Report - WordprocessingML
xml_report XML Report

2.6 Data Source Configuration


WebReports supports several types of data sources. These data sources provide a
WebReport with data when it runs. As an example, a Content Server search can be
used. When the given WebReport runs, it runs the search query associated with it,
and then uses these results to provide the underlying data that the reportview
processes to create the output seen by the end user.

To configure the data source for a WebReport, choose Properties > Source from the
Functions menu. On the Source tab, in the Data Source Type list, select from the
available data sources. The following list summarizes the available data sources.

Data Source Types

Content Server Query


This is used for any of the Content Server objects that provide data from either
SQL or search index queries. The most common examples of this are
LiveReports, Saved Queries, Form Templates, WebForms, Folders, Compound
Documents, Task Lists, Task Groups, Channels, and Discussions. The only
configuration required is to browse for the source object to be used.
Content Server File
This allows files within Content Server that have HTML tables or delimited data
to be used as data sources. It provides some configuration parameters to allow
correct interpretation of the data file. These are:

• Static File Location: this allows the user to browse for a document in
Content Server that will be used as the data source.
• File Type: this parameter allows the user to select which file type is being
used as a data source. Currently the two choices are: Separated Values,
examples include CSV and tab delimited, and HTML Table.

34 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.6. Data Source Configuration

• Content Type: this parameter is only visible when the Separated Values file
type has been selected. It allows the parsing of the data source to be
optimized according to the content of the file. For example, most delimited
formats, such as CSV, need some way to allow the delimiter to be stored in
the data without confusing the parsing software. In the example of CSV,
products like Microsoft Excel use quotes to enclose any data cells that contain
commas.
If you know that a given file has no delimited cells with quotes, then select
the No Cells Are Quoted option. If you know that a given file has all cells
quoted, the All Cells Are Quoted option should be used. The Some Cells
Are Quoted option is the most robust option to use, and is the best selection
for Excel exports.

Notes

– The No Cells Are Quoted option has the fastest performance.

– The Some Cells Are Quoted option has the slowest performance.
• Assume Strict Syntax: this parameter allows the user to specify whether
the data source has a strict and predictable syntax. For example, in a comma
separated value file, the comma in between each cell will not typically be
preceded or succeeded by any spaces. If you know this is the case, you
should select the Assume Strict Syntax option. For separated value file
types, for example CSV, the Assume Strict Syntax option is only available
for All Cells Are Quoted and Some Cells Are Quoted.
With HTML files, strict syntax specifies that all table/row/cell tags are formed
without any attributes and without any spaces. For example: <TABLE>, <TR>,
<TD>. Regardless of which file type has been selected, this option should not
be used where syntax is unpredictable or unknown.
• Column Separator: this parameter is only visible when the Separated
Values file type has been selected. It specifies which character will separate
each cell of data. For CSV files this character is always a comma. For tab
delimited files this character is a tab. The tab link beside this field can
automatically insert a tab (\t).
• Row Separator: this parameter is only visible when the Separated Values
file type has been selected. It specifies which character will separate each row
of data. For CSV files this character is always a carriage return, sometimes
called end of line, or a combination of a carriage return and a line feed.
Different operating systems may use different variations of these characters.
Use the links beside this field to automatically insert characters that cannot
be entered using the keyboard. Use the convention \t for tab, \r for carriage
return/end of line, and \n for new line/line feed.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 35


Chapter 2 Working with WebReports

• Quote Character: this parameter is only visible when the Separated Values
file type has been selected. It specifies which character will quote cells. Cells
are usually quoted when the cell data contains the character that is typically
used to separate the data cells. For example, with CSV files, if the cell data
includes a comma, then the data starts and ends with a “double quote”. A
double quote is the most likely character used for quoting, but this parameter
allows the ability to use an alternative character.
• Escape Quote Characters - This parameter is only visible when the
Separated Values file type has been selected. It specifies which characters
represent a quote within a quoted cell. For example, in CSV files, if a cell of
data is quoted and a double quote is required within the quoted cell, then the
data quote is represented as “”. Doubling a quote character is the most
common way of escaping it but this parameter allows the ability to use
alternative methods.

Column Headings Included - Use this parameter for both HTML Table and
Separated Values. It is selected when the first row in the data source includes
the headings. When this is not selected, generic column names are used
(Column1, column2, and so on.).
Content Server Category
This allows Content Server Categories to be used as data sources. One or more
Content Server Categories may be selected. The number of Content Server
Categories that may be selected is limited by the Content Server Administrator.
When a Content Server Category has been selected, the page will refresh and all
of the Category's Attributes will appear on the page. Use the check boxes to
select one or more Attributes to be included in the report results.
Each record in the report data includes the item DataId, item SubType, and a
value for each selected Category/Attribute. Multi-valued attributes are
concatenated using a value delimiter, as defined by the Content Server
Administrator.
Select the Filter Permissions check box if you want the report results to be
limited based on the See permissions that a user has for each node item.
Using the Functions menu associated with each selected Category/Attribute,
choose a Query Operator. Selecting a Query Operator will activate the specified
Category/Attribute to be used as a WebReport Parameter.
Click View SQL to view the SQL Query that will be performed to retrieve the
Category/Attribute data.
External File
This allows files outside Content Server, typically in a folder that is visible to
Content Server, to be used as data sources. These files must contain tabular or
delimited data according to the Content Server File on page 34 data source type
and the same configuration options are provided.

36 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.6. Data Source Configuration

FTP
This allows files to be accessed by way of an FTP server. The configuration
options are the same as for the Content Server File on page 34 data source type,
with additional parameters to determine details of the FTP server.

Notes

• FTP source is only available if it has been enabled on the WebReports


Administration > Manage Source Settings page.
• If FTP Source is disabled, any WebReport that already has an FTP source
configured will display a warning message on the Source tab.

The supported parameters are:

• FTP Server: the domain or server name to be used for FTP access.
• FTP File Path: the path to the data source file relative to the FTP Root
Folder, for example, /data.txt.
• FTP Port: the server port configured for FTP access. The standard
configuration is port 21.
• Anonymous User Login: select the Anonymous User Login box to use
anonymous user authentication. With this option, the Report User's Email
Address is used as the authentication password. You should verify the FTP
server is configured to allow anonymous user access before using this option.
Clear the Anonymous User Login box to display FTP User Name and FTP
Password data input fields.
• FTP User Name: the FTP user name for authentication on the FTP Server. Use
this option when not using the Anonymous User Login option.
• FTP Password: the FTP user password for authentication on the FTP Server.
Use this option when not using the Anonymous User Login option.

Important
The FTP server should provide access to a file in the correct format.
Depending on the source operating system and type of file being
transferred, the Row Separator value may vary from “r\n” and “\n” for
proper display of results.
The FTP File Transfer is performed in Binary Mode using a Passive FTP
Connection. Contact a system administrator to determine if this will require
FTP Server and Firewall configuration.
External Application
This allows files to be accessed by way of an external server, usually a Web
Server. The configuration options are the same as for the Content Server File
on page 34 data source type, with additional parameters to determine details of
the external server. The external server should either provide access to a file in
the correct format, or to an appropriate server side script to invoke software
necessary to return a file in the correct format. The supported parameters are:

• Server: the domain or server name to be used for accessing the external
application.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 37


Chapter 2 Working with WebReports

• Server Path: the fully formed file path (can include URL parameters) to
access the application.
• Server Port: the port used to access the server.

Search Query Launch


This defines WebReports that can be invoked from the standard Content Server
search launch screen. This is the screen that users usually see when they select
Advanced Search in Content Server. WebReports using Search Query Launch
are available and listed for any users that have the appropriate permissions. No
additional parameters are required.
None
This is selected when no data source is required. No parameters are required.
Request Datasource
This datasource cannot be selected from the Source tab. It is implementented by
providing data in predetermined parameters when a WebReport is invoked. For
more information about this data source, see “Requests as Data Sources”
on page 171.

2.7 Changing the Associated Data Source for a


WebReport
To change the associated data source for a WebReport, from the WebReport
Functions menu, select Properties > Source. On the Source tab, in the Data Source
Type list, select from the available data sources. After this form has been updated,
any future runs of this WebReport will use whichever data source has been selected
using the browser.

2.8 Setting the Default WebReport Output


Destination
On the Properties > Destination tab for each WebReport, you can configure the
default destination where the output will appear when you click the WebReport to
run it. By default, the output destination is set to Browser, but you can configure
several other destinations.

For example, you can configure a WebReport to add a new version to a Content
Server document each time that WebReport runs by selecting Output Destination =
Content Server and Export Type = Content Server Version.

• “Setting a Browser Output Destination” on page 39


• “Setting a Content Server Output Destination” on page 39
• “Setting a Desktop Output Destination” on page 42
• “Setting an Email Output Destination” on page 42
• “Setting a Form Output Destination” on page 44

38 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.8. Setting the Default WebReport Output Destination

• “Setting an FTP Output Destination” on page 45

Notes

– An FTP destination is only available if an administrator has enabled the


Enable WebReports FTP Destination setting on the WebReports
Administration > Manage Destination Settings page.
– If WebReports FTP Destination is disabled, any WebReport that already
has an FTP destination configured will display a warning message on the
Destination tab.
• “Setting a Full-page Widget Output Destination” on page 46
• “Setting the Server Output Destination” on page 50
• “Setting a Workflow Output Destination” on page 51

Note: For information about how to set an output destination without affecting
the default destination, see “Exporting the WebReport Output” on page 52.

2.8.1 Setting a Browser Output Destination


On the Properties > Destination tab, the default Output Destination setting is
Browser.

2.8.2 Setting a Content Server Output Destination


You can set the WebReport output to the following Content Server output
destinations:

• “To set the default output to a Content Server node destination:“ on page 40
• “To set the default output to a Content Server version destination:“ on page 41
When you send output to a new Content Server version of a node, the new
version will have the new media type, description, and Categories that you
specify.

Tips

• If the report takes a long time to run, or if many people run the report, it
can be useful to publish a link to a document, and have a WebReport
update that document on a regular basis. Users will benefit by having more
responsive “reports”. The system will also benefit from the reduced the
number of SQL queries run against the Database.
• Similarly, you can use a WebReport to update a Custom View. For example,
you can create a WebReport to update the Enterprise Workspace every
hour to show the most accessed documents. You can use a series of sub-
WebReports to collect disparate information in a single location.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 39


Chapter 2 Working with WebReports

To set the default output to a Content Server node destination:

1. In the workspace, from the WebReport Functions menu, click Properties >
Destination.
2. On the properties Destination tab, in the Output Destination list, click Content
Server.
3. In the Export Type area, select the Content Server Node option.
4. In the Name box, enter a unique file name.

Notes

• If you provide a name that is not unique, a unique postfix will be


appended. For example, if a file already exists called New WebReport,
then the file name will be New WebReport2.
• The default name will be the WebReport name.
5. In the Duplicate Name Action area, select one of the following options to
determine how to handle duplicate node names:

• To delete an existing original node, select Delete Original, and create a new
node with the same name.
• To add a version to that node, if the node name already exists, select Add
Version to Original. If the node does not exist it will be created.
• To create a new document every time the export occurs, select Generate
Unique Number. A number will be appended to the node name to
distinguish it from the previous exports.
6. Optional In the Node Type area, do one of the following:

• To create a new document node, select Document.


• To create a new custom view, select Custom View.
7. Optional In the Description box, enter a description of the document.
8. In the Create In area, click Browse Content Server, navigate to the container
you want to store this exported document, then click the Select link for that
container.
9. Optional To apply a category to this exported document, in the Categories area,
select a Category.
10. Optional To specify the media type of the document, in the Export Media Type
list, click a media type.
11. Optional Configure the following settings as applicable:

• To use the external conversion engine, select the Use External Conversion
Engine check box.
• To export even if there is no data in the report, select the Export if no Data
check box.

40 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.8. Setting the Default WebReport Output Destination

• To show a status screen after performing the default action, select the Show
Status Screen check box.
• To return immediately to your browser, select the Run in Background check
box.
12. Optional To set a scheduled time for the WebReport to run, select the Set
Schedule check box and do the following:

a. In the Next run after area, set the next time when you want the WebReport
to run.
b. In the Run area, choose how many times you want the WebReport to run.
c. In the Run Condition area, select the conditions under which the
WebReport will run.
d. In the Every area, select the interval for which the WebReport will run.
13. Click Update.

To set the default output to a Content Server version destination:

1. In the workspace, from the WebReport Functions menu, click Properties >
Destination.
2. On the properties Destination tab, in the Output Destination list, click Content
Server Version.
3. In the Add Version to box, click Browse Content Server and select the existing
document or Custom View to which you want to add a version.
4. In the Version Name box, enter name for the version of the file.
5. Optional In the Version Handling area, select the option for whether you want to
add a minor version of a major version.
6. Optional In the Append Results area, select the option for whether or not you
want the WebReport results to be appended to the new version and if so, how.
7. In the Description box, enter a description of the new node.
8. Optional To apply a category to this exported document, in the Categories area,
select a Category.
9. Optional To specify the media type of the resultant document, in the Export
Media Type list, click a media type.
10. Optional Configure the following settings as applicable:

• To use the external conversion engine, select the Use External Conversion
Engine check box.
• To export even if there is no data in the report, select the Export if no Data
check box.
• To show a status screen after performing the default action, select the Show
Status Screen check box.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 41


Chapter 2 Working with WebReports

• To return immediately to your browser, select the Run in Background check


box.

11. Optional To set a scheduled time for the WebReport export, select the Set
Schedule check box and do the following:

a. In the Next run after area, set the next time when you want the WebReport
to export.
b. In the Run area, choose how many times you want the WebReport to
export.
c. In the Run Condition area, select the conditions under which the
WebReport will export.
d. In the Every area, select the interval for which the WebReport will export.

12. Click Update.

2.8.3 Setting a Desktop Output Destination


To set the Desktop output destination for a WebReport, you will also need to specify
the Export Media Type. WebReports uses the media type to determine the file
extension, file type, and the application to use to open the file.

To set the default output to the desktop destination:

1. From the WebReport Functions menu, click Properties > Destination.

2. On the Destination tab, from the Output Destination list, click Desktop.

3. In the Download File Name box, type the default name of the file to be
downloaded. This name can be overwritten by the end user when they run the
WebReport.

4. From the Export Media Type list, select the media type of the document to be
created.

5. Click Update.

2.8.4 Setting an Email Output Destination


To set the default output to an email destination:

1. In the workspace, from the WebReport Functions menu, click Properties >
Destination.

2. On the properties Destination tab, in the Output Destination list, click Email.

3. In the Email Address area, specify one or more recipients using any of the
following methods, in any combination:

• In the first text box, type one or more email addresses, separating them with
the separator character configured for the system.

42 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.8. Setting the Default WebReport Output Destination

Notes

– The default separator character for the system is a comma, but it can
be changed in the opentext.ini file using the
MailtoAddressSeparator key.
– You can also specify From, CC (Carbon Copy), and BCC (Blind
Carbon Copy) fields. For example, to send an email to recipient 1, CC
recepient2, and BCC recipient3, and make it appear to be from
sender1, using “$” as the separator, you would specify the following:
[email protected][email protected]
[email protected][email protected]

• In the second box, click the User button and select either a Content Server
User or a Content Server Group.

Notes

– No email is sent if an email address is not specified in the user


Content Server profile.
– Emails are only sent to direct members of the selected Content Server
groups.
• In the third box, click Browse Content Server and select a CSV file that
contains a list of email addresses.

Note: The total email address list must not exceed 10,000 characters,
roughly 500 email addresses.
4. In the Email Subject box, enter a unique file name.

Notes

• If you provide a name that is not unique, a unique postfix will be


appended. For example, New WebReport Snap Shot 5.
• The default name will be the WebReport name followed by Snap Shot.
5. Optional To specify the media type of the resultant document, in the Export
Media Type list, click a media type.
6. Optional Configure the following settings as applicable:

• To use the external conversion engine, select the Use External Conversion
Engine check box.
• To attach the report output to the email, select the Attach Results to Email
check box.
• To export even if there is no data in the report, select the Export if no Data
check box.
• To show a status screen after performing the default action, select the Show
Status Screen check box.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 43


Chapter 2 Working with WebReports

• To return immediately to your browser, select the Run in Background check


box.

7. Optional To set a scheduled time for the WebReport to run, select the Set
Schedule check box and do the following:

a. In the Next run after area, set the next time when you want the WebReport
to run.
b. In the Run area, choose how many times you want the WebReport to run.
c. In the Run Condition area, select the conditions under which the
WebReport will run.
d. In the Every area, select the interval for which the WebReport will run.

8. Click Update.

2.8.5 Setting a Form Output Destination


To set the default output to a form destination:

1. In the workspace, from the WebReport Functions menu, click Properties >
Destination.

2. On the properties Destination tab, in the Output Destination list, click Form.

3. In the Populate Form area, click Browse Content Server and select the form
that you want to update.

4. Optional In the Append Results area, select the option for whether or not you
want the WebReport results to be appended to the form and, if so, how.

5. Optional Configure the following settings as applicable:

• To export even if there is no data in the report, select the Export if no Data
check box.
• To show a status screen after performing the default action, select the Show
Status Screen check box.
• To return immediately to your browser, select the Run in Background check
box.

6. Optional To set a scheduled time for the WebReport to run, select the Set
Schedule check box and do the following:

a. In the Next run after area, set the next time when you want the WebReport
to run.
b. In the Run area, choose how many times you want the WebReport to run.
c. In the Run Condition area, select the conditions under which the
WebReport will run.
d. In the Every area, select the interval for which the WebReport will run.

7. Click Update.

44 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.8. Setting the Default WebReport Output Destination

2.8.6 Setting an FTP Output Destination


To set the default output to an FTP destination:

1. In the workspace, from the WebReport Functions menu, click Properties >
Destination.

2. On the properties Destination tab, in the Output Destination list, click FTP.

Notes

• An FTP destination is only available if an administrator has enabled the


Enable WebReports FTP Destination setting on the WebReports
Administration > Manage Destination Settings page.
• If WebReports FTP Destination is disabled, any WebReport that already
has an FTP destination configured will display a warning message on
the Destination tab.

3. In the FTP Server box, specify the IP address of the FTP server.

4. In the FTP File Path box, specify the relative path to the destination file on the
FTP server.

5. In the File Copy Options box, select one of the copy options:

• To replace an existing file on the FTP server, click Replace Existing.


• To rename the current file, click Unique Name.
• To disregard the transmission if a file already exists with the same name,
click Skip Output.

6. In the FTP Port box, specify a valid server port.

7. Optional To authenticate anonymous user log in with the report user’s email
address as the password, select the Anonymous User Login check box.
Clear the check box to require a user name and password.

8. In the FTP User Name, enter the user name to use to access the FTP server.

9. In the FTP User Password, enter the user password to access the FTP server.

10. In the Verify Password box, enter a verify password to access the FTP server.

11. Optional To specify the media type of the resultant document, in the Export
Media Type list, click a media type.

12. Optional Configure the following settings as applicable:

• To use the external conversion engine, select the Use External Conversion
Engine check box.
• To export even if there is no data in the report, select the Export if no Data
check box.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 45


Chapter 2 Working with WebReports

• To show a status screen after performing the default action, select the Show
Status Screen check box.
• To return immediately to your browser, select the Run in Background check
box.

13. Optional To set a scheduled time for the WebReport to run, select the Set
Schedule check box and do the following:

a. In the Next run after area, set the next time when you want the WebReport
to run.
b. In the Run area, choose how many times you want the WebReport to run.
c. In the Run Condition area, select the conditions under which the
WebReport will run.
d. In the Every area, select the interval for which the WebReport will run.

14. Click Update.

2.8.7 Setting a Full-page Widget Output Destination


You can configure the default output of a WebReport, so that in Smart View, when a
user clicks the WebReport, it opens in one of the full-page Content Intelligence
widgets.

Note: The Full Page Widget output destination is only available for
Perspectives created using the new Perspective node type. It is not supported
for legacy ActiveView Perspectives. For more information, see OpenText
Content Server - Perspectives User Guide (LLESPRSP-UGD).

To set the default output to a full-page widget:

1. On the Destination tab, in the Output Destination list, click Full Page Widget.

2. In the Type list, select the Content Intelligence - Full widget that you want to
use to display the WebReport output and configure any of the required fields as
follows:

• HTML WebReport
No options to configure.
• Nodes Table WebReport
No options to configure.
• Table WebReport

– Names of Searchable Columns


Optional. Enter the label for the column that supports searching in the
table.

46 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.8. Setting the Default WebReport Output Destination

○ To add another searchable column, click the Add Column icon


and enter the label for the additional column.

○ To remove a searchable column, click the Delete Column icon .

– Sort By
Mandatory. Enter the label for the default sort column in the table.

– Sort Direction
Mandatory. Select the sorting direction for the default sort column:
Descending or Ascending.
Default = Descending

– Sub-WebReport Column
Optional. Add a column to launch a sub-WebReport passing in the
current row data.

Source Sub-WebReport
Optional. Browse to select the WebReport that runs when you click
the sub-WebReport icon.

Note: Depending on the WebReport selected, it will open in


Smart View or Classic View as appropriate for the destination
settings.

Sub-WebReport Icon Class


Optional. Provide the CSS class for the icon that will appear in the
sub-WebReport column.

Default = icon-subwebreport

Note: You can specify a custom icon within the WebReport


template by adding a CSS selector that uses background-image
and then referencing the selector in this option.

• Visual Count

– Chart Type
Optional. Select the type of chart appropriate for your data. Options
include Vertical Bar chart, Horizontal Bar chart, Donut chart, and Pie chart.
Default = Vertical Bar chart

– Active Column
Mandatory. Enter the name of the column from the data source that
provides the matching values to be counted.
Default = The name of the first column in the data source.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 47


Chapter 2 Working with WebReports

Notes

○ When you enter the column name, you must be careful of the
case sensitivity if your data source is a LiveReport that queries a
case-sensitive database.
○ Avoid choosing an Active Column that returns unique values
because the data will not be meaningful on a count-based chart.
Ideally, this widget works best for data with columns containing
no more than 20 distinct values.
○ Include fewer than ten columns to make the chart more user-
friendly. More than ten columns are more complex to configure
and may potentially have a performance cost.
○ You can include and exclude columns by editing the reportview
used for the WebReports object associated with this widget.
– Theme
Select a color palette for the chart.
Default = Evening 10
– Values As Percentage
Optionally, choose whether to show the values as percentages of the total
count. If False, the values will appear as the actual count instead.
Default = False
– Animate
Optional. Chose whether the chart animates or not when changing
certain settings in the interface.
Default = True
– Group After
Optional. Choose the number, from one to twenty, as the threshold for
the maximum number of discrete values whose total counts will appear
on the chart. Values that exceed this threshold are grouped as “Other”
and will show the combined total. Options include values from one to
twenty and “Use Chart Default”, which will use the default number
appropriate for the chart type selected.

○ Bar chart default = 15


○ Pie chart default = 5
○ Donut chart default = 5
– Sort By
Optional. Choose the sorting criteria for the chart. Options include the
following:

○ Count – Sort numerically by the total count of similar values.

48 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.8. Setting the Default WebReport Output Destination

○ Active Column – Sort alphanumerically, using the actual values from


the Active Column selection described in “Active Column”
on page 47.

Default = Count
– Sort Direction
Optional. Choose whether the criteria specified in the “Sort By”
on page 48 setting are sorted in ascending or descending order.
Default = Descending
– Button WebReports
Optionally, configure one or more buttons, each associated with selected
WebReport. When the user clicks the button, the associated WebReport
will run using fixed values.

○ Maximum Items to Process


Enter the maximum number of rows in the data set that the Button
WebReport will process. If the filtered data set exceeds this limit, the
WebReport launched by the button will return an error.
Default = 5000 rows

Note: There is a hard limit of 50,000 rows. If you try to set a


value higher than 50,000, you will get an error.
○ Button WebReport
Optional. Browse for the WebReport that will open when you click
the button.

Tip: To add an additional Button WebReport, click the Add

Button WebReport button and browse for another


WebReport. To remove a Button WebReport, click the Delete

Button WebReport button .

3. Click Update.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 49


Chapter 2 Working with WebReports

2.8.8 Setting the Server Output Destination


This feature is only available to users who are signed in as the Content Server
administrator. It allows an admin user to define a location on the server as the
output destination for a WebReport. Users with permission to run the WebReport
can run the report but they cannot change the existing server path or define a new
export path. The Server File Path should be specified like any other path on the file
system. For example C:\export_testing\test_export.xml

Tips

• This feature is for advanced report developers who might, for example,
want their report to send the output data to a specific location on a regular
schedule. This can enable a third party application to pick the data up, and
then use it in a different application.
• WebReports supports server files as a data source type. If you have
multiple Content Server instances that you need to share data between, you
might configure one WebReport to write data to a specific location, and
another WebReport to read from that location.

To set the default output to the server destination:

1. From the WebReport Functions menu, click Properties > Destination.


2. On the Destination tab, from the Output Destination list, click Server.
3. In the Server File Path box, enter the path to the Content Server file system.
4. From the Export Media Type list, select the media type of the document to be
created.
5. Optional Configure the following settings as applicable:

• To use the external conversion engine, select the Use External Conversion
Engine check box.
• To export even if there is no data in the report, select the Export if no Data
check box.
• To show a status screen after performing the default action, select the Show
Status Screen check box.
• To return immediately to your browser, select the Run in Background check
box.
6. Optional To set a scheduled time for the WebReport to run, select the Set
Schedule check box and do the following:

a. In the Next run after area, set the next time when you want the WebReport
to run.
b. In the Run area, choose how many times you want the WebReport to run.
c. In the Run Condition area, select the conditions under which the
WebReport will run.

50 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.8. Setting the Default WebReport Output Destination

d. In the Every area, select the interval for which the WebReport will run.
7. Click Update.

2.8.9 Setting a Workflow Output Destination


This feature can trigger Content Server Workflows based on results in a WebReport.
Use it in conjunction with sub-WebReports to launch an unlimited number of
Workflows from an unlimited number of Workflow maps. You can optionally attach
the report to the Workflow as a document. Any forms associated with the Workflow
may be populated with data from any number of the WebReports.

Additionally, you can populate any number of Workflow attributes, as well as other
metadata including things like the Workflow due date and title. To determine which
elements of a WebReport set data in a Workflow, you need to use the sub-tags
SETWFATTACH, SETWFATTR , SETWFCOMMENT, SETWFFORM, SETWFINFO, and
SETWFTASKINFO. For more information about sub-tags, see the Dynamic Tag Guide.
For information about how to access the Dynamic Tag Guide, see “To Access the
Dynamic Tag Guide” on page 77.

Tip: Use sub-WebReports to trigger multiple Workflow instances in the same


way that was described for sending multiple emails.

To set the default output to a workflow destination:

1. In the workspace, from the WebReport Functions menu, click Properties >
Destination.
2. On the properties Destination tab, in the Output Destination list, click
Workflow.
3. In the Initiate Map box, click Browse Content Server and select the initiate map
to start the workflow.
4. In the Workflow Title box, enter the title of the workflow.
5. Optional In the Workflow Description box, enter a description of the workflow.
6. Optional In the Workflow Due area, select one of the following options:

• To avoid specifying a due date, click No time limit.


• To specify a due date, click Due on a specific date.
• To specify a due date a certain number of days after initiating the workflow,
click Due in a set number of days after initiation.
7. Optional Configure the following settings as applicable:

• To attach the report output to the workflow, select the Attach Output to
Workflow check box.
• To export even if there is no data in the report, select the Export if no Data
check box.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 51


Chapter 2 Working with WebReports

• To show a status screen after performing the default action, select the Show
Status Screen check box.
• To return immediately to your browser, select the Run in Background check
box.

8. Optional To set a scheduled time for the WebReport to run, select the Set
Schedule check box and do the following:

a. In the Next run after area, set the next time when you want the WebReport
to run.
b. In the Run area, choose how many times you want the WebReport to run.
c. In the Run Condition area, select the conditions under which the
WebReport will run.
d. In the Every area, select the interval for which the WebReport will run.

9. Click Update.

2.8.10 File Conversion Using XML Job Tickets


This feature allows you to use the Adlib XML Job Ticket feature during file
conversion. A user with Administrative rights may specify a previously created
XML Job Ticket file from the server, that allows a wide variety of conversion options
when a file is converted using Adlib Express Server software for conversion.

For more detailed information about using XML Job Tickets for file conversion, see
“PDF Conversion” on page 168. If you have administration rights, you can also see
OpenText Content Server - WebReports Administration Guide (LLESWEBR-AGD).

2.9 Exporting the WebReport Output


When you export a WebReport, you can configure an output destination without
affecting the default behavior of the WebReport when you click on it. To export the
WebReport, from the Functions menu for the WebReport, click Export.

You can export the WebReport output to the following locations:

• “Running a WebReport and Exporting the Output to Content Server”


on page 53
• “Running a WebReport and Exporting the Output to a Desktop File”
on page 55
• “Running a WebReport and Exporting the Output to Email” on page 55
• “Running a WebReport and Exporting the Output to a Server File” on page 57

Notes

• You can also use URL parameters to export the WebReport Output. For
information, see “Export Using URLs” on page 122.

52 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.9. Exporting the WebReport Output

• For information about how to configure the default output destination when
you click on the WebReport, see “Setting the Default WebReport Output
Destination” on page 38.

2.9.1 Running a WebReport and Exporting the Output to


Content Server
You can run the WebReport and export the output to the following Content Server
output destinations:

• “To run a WebReport and export the output to a new Content Server node:“
on page 53

Tip: For information about how to use URL parameters to export to a


Content Server node, see “Exporting to a Content Server Node - Parameters
and Example” on page 122.
• “To run a WebReport and export the output to a Content Server version:“
on page 54

Tip: For more information about how to use URL parameters to export to a
Content Server version, see “Exporting to a Content Server Version -
Parameters and Example” on page 124.

To run a WebReport and export the output to a new Content Server node:

1. In the workspace, from the WebReport Functions menu, click Run & Export.

Tip: Alternatively, you can click Run & Export from the quick links.

2. On the Run & Export WebReport:<WebReportName> page, from the Output


Destination list, select Content Server.

3. In the Export Type area, select the Content Server Node option.

4. In the Name box, enter a unique file name.

Notes

• If you provide a name that is not unique, a unique postfix will be


appended. For example, New WebReport Snap Shot 5
• The default name will be the WebReport name followed by Snap Shot.

5. Optional In the Description box, enter a description of the resulting document.

6. In the Create In area, click Browse Content Server, navigate to the container
you want to store this exported document, then click the Select link for that
container.

Note: The default location will be the folder containing the WebReport.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 53


Chapter 2 Working with WebReports

7. Optional To apply a category to this exported document, in the Categories area,


select a Category.

8. Optional To specify the media type of the document, in the Export Media Type
list, select a MIME type.

9. Optional To use the external conversion engine, select the Use External
Conversion Engine check box.

10. Optional To return immediately to your browser, select the Run in Background
check box.

11. Click Run & Export.

To run a WebReport and export the output to a Content Server version:

1. In the workspace, from the WebReport Functions menu, click Run & Export.

Tip: Alternatively, you can click Run & Export from the quick links.

2. On the Run & Export WebReport:<WebReportName> page, from the Output


Destination list, select Content Server.

3. In the Export Type area, click Content Server Version.

4. In the Add to box, click Browse Content Server and select the existing
document or Custom View to which you want to export a version.

5. Optional In the Append Results area, select the option for whether or not you
want the WebReport results to be appended to the new version and if so, how.

6. In the Description box, enter a description of the new node.

7. Optional To apply a category to this exported document, in the Categories area,


select a Category.

8. Optional To specify the media type of the resultant document, in the Export
Media Type list, click a media type.

9. Optional To use the external conversion engine, select the Use External
Conversion Engine check box.

10. Optional To return immediately to your browser, select the Run in Background
check box.

11. Click Run & Export.

54 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.9. Exporting the WebReport Output

2.9.2 Running a WebReport and Exporting the Output to a


Desktop File
To run the WebReport and export its output to the Desktop, you will also need to
specify the Export Media Type. WebReports uses the media type to determine the
file extension, file type, and the application to use to open the file.

Tip: For information about how to use URL parameters to export to the
desktop, see “Exporting to the Desktop - Parameters and Example”
on page 125.

To run a WebReport and export the output to a desktop file:

1. In the workspace, from the WebReport Functions menu, click Run & Export.

Tip: Alternatively, you can click Run & Export from the quick links.

2. On the Run & Export WebReport:<WebReportName> page, in the Output


Destination list, click Desktop.

3. In the Download File Name box, type the export file name.

Tip: This box supports tag replacement, so you can use WebReports tags
here to dynamically set the file name.

4. From the Export Media Type list, select the export format.

5. Click Run & Export.

2.9.3 Running a WebReport and Exporting the Output to


Email
You can run a WebReport and export its output to email.

Tip: For information about how to use URL parameters to export to email, see
“Exporting to Email - Parameters and Example” on page 125.

To run a WebReport and export the output to email:

1. In the workspace, from the WebReport Functions menu, click Run & Export.

Tip: Alternatively, you can click Run & Export from the quick links.

2. On the Run & Export WebReport:<WebReportName> page, in the Output


Destination list, click Email.

3. In the Email Address area, specify one or more emails using any of the
following methods, in any combination:

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 55


Chapter 2 Working with WebReports

• In the first text box, type one or more email addresses, separating them with
the separator character configured for the system.

Notes

– The default separator character for the system is a comma, but it can
be changed in the opentext.ini file using the
MailtoAddressSeparator key.

– You can also specify From, CC (Carbon Copy), and BCC (Blind
Carbon Copy) fields. For example, to send an email to recipient 1, CC
recepient2, and BCC recipient3, and make it appear to be from
sender1, using “$” as the separator, you would specify the following:
[email protected][email protected]
[email protected][email protected]

• In the second box, click the User button and select either a Content Server
User or a Content Server Group.

Notes

– No email is sent if an email address is not specified in the user


Content Server profile.
– Emails are only sent to direct members of the selected Content Server
groups.
• In the third box, click Browse Content Server and select a CSV file that
contains a list of email addresses.

Note: The total email address list must not exceed 10,000 characters,
roughly 500 email addresses.

4. In the Email Subject box, enter a subject for the email.

Tip: This box supports tag replacement, so you can use WebReports tags
here to dynamically set the file name.

5. Optional To specify the media type of the resultant document, in the Export
Media Type list, click a media type.

6. Optional Configure the following settings as applicable:

• To use the external conversion engine, select the Use External Conversion
Engine check box.
• To attach the report output to the email, select the Attach Results to Email
check box.
• To return immediately to your browser, select the Run in Background check
box.

7. Click Run & Export.

56 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.9. Exporting the WebReport Output

2.9.4 Running a WebReport and Exporting the Output to a


Server File
This feature is only available to users who are signed in as a Content Server
administrator. It allows an administrator to define a location on the server as the
output destination for a WebReport. Users with permission to run the WebReport
can run the report but they cannot change the existing server path or define a new
export path. The Server File Path should be specified like any other path on the file
system. For example C:\export_testing\test_export.xml

Tips

• WebReports supports server files as a data source type. If you have


multiple Content Server instances that you need to share data between, you
might configure one WebReport to write data to a specific location, and
another WebReport to read from that location.
• For information about how to use URL parameters to export to the server,
see “Exporting to the Server - Parameters and Example” on page 128.

To run a WebReport and export the output to a server file:

1. In the workspace, from the WebReport Functions menu, click Run & Export.

Tip: Alternatively, you can click Run & Export from the quick links.

2. On the Run & Export WebReport:<WebReportName> page, in the Output


Destination list, click Server.

3. In the Server File Path box, enter the path to the Content Server file system.

Tip: This box supports tag replacement, so you can use WebReports tags
here to dynamically set the file name.

4. From the Export Media Type list, select the media type of the document to be
created.

5. Optional Configure the following settings as applicable:

• To use the external conversion engine, select the Use External Conversion
Engine check box.
• To return immediately to your browser, select the Run in Background check
box.

6. Click Run & Export.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 57


Chapter 2 Working with WebReports

2.10 Property Tabs


As with all Content Server items, WebReports have a Properties page, accessible
from the item Functions menu. In addition to the standard Content Server tabs,
there are some unique tabs that allow control over WebReports sources,
destinations, constants and parameters. The basic features of these tabs, and the
Specific tab are described here.

Specific
The Specific tab for a WebReport is similar in functionality to the Specific tab for a
document. The document properties, such as Current Version, Max Versions, and
MIME Type, are used to manage version control for the reportview associated with
the WebReport. In addition to these properties, WebReports has the following
unique properties:

• Run As: this option allows the WebReport in question to run as a specific user,
regardless of the userid of the person executing the report. Because this
capability can surface data that the person running the report might not usually
see, the ability to change this field is controlled by a privilege with the Usage
Type of “WebReports” and the Usage Name of “Run As”.
For more information, see “WebReports Run As Feature” on page 175.
• Run/Export Audits Enabled: this option is cleared by default and allows each
WebReport to have additional audit events enabled so that every RUN or EXPORT
event generates an entry in the AUDIT log.

Important
By default, this option is cleared to avoid the volume of audits that can be
generated if you use this feature without careful consideration.
• Oscript Scripting Enabled: this option only appears when the reportview
includes tags related to the Server Side Scripting feature. It enables or disables
the running of any scripts that may be defined and run with the reportview.
For more information about this feature, see “Server-Side Scripting”
on page 177.

Constants
Use the Constants tab to create and manage values that can be used in the
reportview, or other designated fields. For more information, see “Procedures
Defining How to Use Constants” on page 67.

Destination
Use the Destination tab to specify the location to which the report is delivered. This
could be email, Workflow initiation, or any of several other destinations. For more
information, see “Exporting the WebReport Output” on page 52.

58 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.11. Running WebReports

Parameters
Use the Parameters tab to define parameter behavior for the WebReport. This
controls things like the prompt order, the default value and whether a parameter is
mandatory or not. For more information, see “WebReport Parameters Procedures”
on page 74.

Source
Use the Source tab to specify different types of data sources and the format in which
the source data will appear. For more information, see “Data Source Configuration”
on page 34.

2.11 Running WebReports


By default, running a WebReport causes the combined output of the processed
reportview and any data source to be delivered to the user's browser. WebReports
can also be “delivered” to other destinations using a variety of Export options. There
are three common ways to run a WebReport:

1. Select the WebReport link from Content Server: where a WebReport is visible
in a Content Server container, you can click the name link to run the current
version of the WebReport. Use this approach for versions that have been listed
from the WebReport Functions menu, by selecting Properties > Versions. This
differs from normal documents where this action would cause a view or open
option to run.

Note: You can change the behavior of the WebReport link by changing the
defaults from a WebReport Functions menu by selecting Properties >
Destination.
2. Select the Open option from the Functions menu: this performs the same action
as clicking the name link.
3. Invoking the appropriate WebReport URL: can create complex relationships
between different objects in Content Server. Examples include:

• A Content Server Custom View can invoke a WebReport to collect data for
display.
• A Content Server WebForm can invoke a WebReport to build form
information, such as pick lists.
• A WebReport can invoke another WebReport to create relational database
type applications.

Use this option to invoke a WebReport from a Content Server URL object. You
might use this approach to create unique URLs that include parameters that can
be used in the reportview. You can use special tags within the reportview to
reference any parameters passed in the URL. For example, [LL_REPTAG_&
parmname /]. Thus, you can create multiple URLs to change how a single

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 59


Chapter 2 Working with WebReports

WebReport behaves. You can also include input parameters to be passed directly
to the underlying data sources. For more information, see “Using WebReports
Parameters” on page 69.

Passing Parameters
When running a WebReport, parameters can be included in the URL for the
WebReport itself as well as for the associated data source. For more information, see
“WebReport Parameters Procedures” on page 74.

2.11.1 Form Submission Mechanism


WebReports provides a form submission mechanism, Initiate WebReport, that is
similar to SQL Table. The main differences being that when the data is stored in the
SQL table, the primary key, or SEQ, is identified and passed to a WebReport that is
initiated immediately after the form submission.

The data stored in each method is interchangeable. In other words, you can change
the form submission mechanism between Initiate WebReport and SQL Table
without affecting the existing data.

Initiate WebReport requires only two configuration options that are set on the
Specific tab of the form:

• You need to set the WebReport that is to run immediately following the form
submission.
• You need to determine whether the WebReport is to run transparently, or is to
present to the user following form submission.

In each case, the SEQ, from the form just submitted, is available as a parameter [LL_
REPTAG_&SEQ /]. This can be used in the WebReport as a key to look up additional
data associated with the form just submitted. Alternatively, it can be passed as a
parameter to a separate, sub, WebReport that has its destination set to Populate
Form. This allows basic relational tables to be maintained through a series of
WebReports because the act of using a WebReport to export data to a form triggers a
further WebReport to initiate if the submission mechanism is set appropriately.

The Initiate WebReport form submission mechanism is not visible until the Manage
Relational Table option has been used to configure an associated SQL table.

Form tags of the type [LL_FormTag_1_1_3_1 /] are only supported when Show
WebReport is not selected. You might need to select Show WebReport, for example,
if you need to display data that has just been submitted. In that case, you must use
the [LL_REPTAG_&SEQ /] tag as a parameter to a sub-WebReport or a sub-
LiveReport to retrieve the submitted data.

60 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.12. Setting Schedules for WebReports

2.12 Setting Schedules for WebReports


WebReports developers and users with reserve permission can set up run schedules
for individual WebReports to run without user intervention. Scheduled reports run
in the background and can output to a Content Server document node, email, server
file, Workflow, form or FTP destination. The schedule allows for reports to run a
fixed number of times or forever, starting from a specific date and time. One
schedule can be set for each user for each WebReport.

Run Conditions
A scheduled WebReport can be configured to run in one of the following four ways:

1. Using repeat intervals. The period between repeated report runs can range from
5 minutes to 520 weeks.
2. On specific dates of the month. For example, the 1st and the 15th of the month.
The “Last” option will run the report on the last day of the month. For example,
January 31st, February 28th (or 29th for a leap year), March 30th, and so on.
3. On specific days of the month. For example, the first/second/third/fourth/last
Sunday of the month.
4. On specific days of the week. For example, every Sunday and Wednesday.

Important Notes and Recommendations


1. Users should be cautious about when and how often to schedule a report that
returns a very large dataset. Such reports can require significant resources and
might impact system performance if run too often or at peak times.
2. If Content Server Admin service is not running, or if the Content Server Agents
are disabled for another reason, scheduled reports will not run. Once enabled
again, WebReports will run a report at the earliest opportunity if a report was
missed, regardless of the schedule. After this, WebReports will run the report at
the next time in the future that fits the schedule. This may cause irregular run
times.
3. The output destination settings are the same for scheduling as for the default
action for a user clicking the WebReport link. If these need to be different,
OpenText recommends that you use two WebReports with the same reportview.
The scheduled report can be hidden or placed in a permissioned folder.
4. Scheduled WebReports run as if they were run by the user that set the schedule.
Where a permissions filter is used in a data source, such as a LiveReport or a
search query, it returns results that the user has the permissions to see. Always
output sensitive reports to an appropriately-permissioned location in Content
Server.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 61


Chapter 2 Working with WebReports

2.12.1 To Set a Schedule


To set a schedule:

1. On the Functions menu of any WebReport for which you want to set a
schedule, select Properties > Destination.

2. On the Destination tab, choose the desired output destination. Destinations that
support scheduling are Content Server node, email, server file, Workflow, form,
and FTP.
3. Depending on your selection and the new fields that appear on the page,
provide the required details for your chosen output destination.

4. In the Set Schedule section, select the check box.

5. In the Next run after area, set the date and time that the report should first run.

Note: Actual run times may be up to five minutes after the time set here.

6. In the Run Condition area, select the option for the frequency that you want the
report to run:

Using repeat Set the interval between report runs in minutes (0 to 59 minutes),
intervals hours, days, or weeks.

Note: If the WebReports Scheduling Agent Sleep Interval is


set to longer than the repeat interval for a WebReport, the
WebReport only runs after the sleep interval has elapsed.
For example, if a WebReport is configured to run every one
minute, but the WebReports Scheduling Agent Sleep Interval
is configured to be three minutes, then the WebReport will run
every three minutes.
The WebReports Scheduling Agent Sleep Interval is set in the
Manage WebReports Schedules administration pages. For
more information, see OpenText Content Server - WebReports
Administration Guide (LLESWEBR-AGD).
On specific Set the report to run on specific dates. Select the check boxes for the
dates of the dates that you want. You can use the All Dates check box to toggle
month between selecting or clearing all dates.

Note: The Last check box sets the report to run on the last day
of the month. For example, January 31st, February 28th (or 29th
for a leap year), March 30th and so on.

62 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.12. Setting Schedules for WebReports

On specific Set the report to run on specific days of the month. Select at least one
days of the check box to set the weeks of the month and at least one check box to
month set the day of those weeks to run the report. For example, the first
and last Sunday of the month. You can use the Week of the Month
check box to toggle between selecting or clearing all weeks. You can
use the Day of the Week check box to toggle between selecting or
clearing all days.
On specific Set the report to run on specific days of the week. Select at least one
days of the check box to set which days of the week to run the report. For
week example, every Monday and Friday. You can use the All Days of the
Week check box to toggle between selecting or clearing all days.

7. In the Run area, do one of the following:

• Select the Forever check box.


• In the Times field, enter the number of times you want to run the report.

8. Click Update to set the schedule.

2.12.2 To Remove or Change a Schedule


To remove or change a schedule:

1. To remove a schedule, from the WebReport Functions menu, select Properties >
Destination.

2. On the Destination tab, clear the Set Schedule check box.

3. Click Update.

Notes

• Other schedule settings are retained, but the report will no longer run
until the Set Schedule check box is selected. To alter settings, make your
changes and then click Update.
• If a report is scheduled to run a fixed number of times, Content Server
will update the number of times and the next run time. This allows you
to see how many more runs are expected as well as the next scheduled
run time.
• Note that the Content Server administrator has the ability to disable or
delete schedules created by other users. This is achieved in the Content
Server administration pages. For more information, see OpenText
Extended ECM - Installation Guide (LLESCOR-IGD).

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 63


Chapter 2 Working with WebReports

2.13 Setting WebReports Permissions


WebReports permissions have some unique considerations. WebReports are
effectively an amalgamation of three different object types in Content Server:

• Documents: used to store and manage the reportviews.


• Text Documents: used to support online reportview editing.
• LiveReports: used to produce the report output.

The following table indicates the most common roles for WebReports users and
what the recommended permissions should be:

WebReport User Role Minimum Permissions Associated Commands


General users who are not See Make Shortcut
allowed to run or edit a
report
General end user that is See Contents RunReport
allowed to run the
WebReport... Also standard See Contents
commands. For example, Set
This will be the main Notification or Add to
permissions setting for all Favorites.
end users of WebReports.
This differs from normal
documents where end users
would need to View, Open,
or Download. With
WebReports these commands
are only used for the users
who create or edit the
reportviews.
Users who might create or Modify Copy, Open, Download,
edit other WebReports but View
who are not allowed or
required to have access to
this specific WebReport
Users who are responsible for Reserve Add Reportview Version,
modifying the reportviews or Edit Reportview, Properties >
selecting different associated Specific
data sources.

These are typically the


WebReport owners and
administrators; however,
they do not necessarily need
to have delete or permissions
access.
Administrative users As Required. Normal Examples include: Delete and
permissions behavior. Permissions.

64 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.14. WebReports Constants

2.14 WebReports Constants


The WebReports Constants feature provides the capability to pre-define data that
can be inserted into the report output. This feature is typically used in the following
situations:

• If some text or information in the WebReport requires changing periodically, you


can use a constant to allow easy maintenance, which can be performed by a non-
technical person.
• If you must manually define values, such as attribute numbers, constants make it
easy to define and maintain these parameters.
• If you use the same reportview for multiple WebReports in different ways, each
WebReport can have different constant settings.
• If you create a reportview with references that may vary between systems,
constants allow you to manage system transparency.

Note: The XML import/export feature attempts to translate any references


to Content Server objects between systems.

2.14.1 Referencing Constants in the WebReport Reportview


After you define a constant, you can insert the corresponding value into the
reportview as many times as required. You do not need to define a constant before
adding the corresponding tag in the reportview. It may be faster to define them
using the automatic method, as detailed in “To Automatically Add a New Constant
for the WebReport” on page 68, after you have changed the reportview.

Example: In this first example, if a constant called reportID had been stored to reference
another WebReport, the syntax used could be as follows:

?func=ll&objid=[LL_REPTAG_$reportID /]&objaction=runreport

Example: However, it might be more appropriate to use the same constant with LLURL as
follows:

[LL_REPTAG_$reportID LLURL:REPORT /]

which should resolve to ?func=ll&objid=xyz&objaction=runreport, where xyz is is


the value of the constant reportID.

The benefit of the approach in the previous second example occurs if Content Server
changes the way this URL works, the report will continue to function, whereas the
first example would require changes to the report.

If working in the WebReports online editor, you can use the drag functionality to
speed up some activities. For more information about how to use the drag
functionality, see “To Drag and Drop a Constant to the WebReport Reportview”
on page 68.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 65


Chapter 2 Working with WebReports

2.14.2 Global Constants


Global Constants are an extension of standard constants and provide the ability to
centrally manage constants for a particular collection of WebReport that rely on the
same data. This is particularly useful where the user has a group of WebReports,
Forms and other Content Server objects that are working together to create an
application. Each WebReport can refer to a single Global Constants Node, which
can be either a WebReport or an ActiveView, defined in the Global Constants
section of the Properties > Constants tab.

In effect, all WebReports for a particular application will point to a single node that
manages the constants for the entire application. The benefit of this is that after you
define a constant in your global node, it becomes available to all WebReports and
ActiveViews that point to that node. This significantly reduces management
overhead for the WebReports application and can also simplify debugging.

Global constants can be linked so that one WebReport points to another and so on.
Even so, global constants adhere to Content Server permissions, so that if a user
does not have permission to see a given WebReport, they cannot use the constants
defined in it.

When working in the online editor, global constants in the list are indicated with an
asterisk (*).

2.14.3 Using a Secure Constant


Secure Constants are global and provide the ability to centrally manage constants
with secure values for a collection of WebReport or ActiveView templates that can
share the same constants. Your administrator may define secure constants and make
them available for specific WebReports or ActiveView templates. Each WebReport
or ActiveView template can refer to one or more secure constants listed at the
bottom of its Properties > Constants tab. The values of these constants are hidden
for security reasons and can only be changed by an administrator.

Secure constant can only be referenced as arguments for the


LL_WEBREPORT_RESTCLIENT tag, using the syntax {{<secure constant
name>}}.

2.14.4 Server Specific Constants (INI Preferences)


Use the standard constant syntax to reference preferences specified in the opentext.
ini file. This is subject to some limitations. For more information, see “INI
Preferences” on page 133 and the OpenText Content Server - WebReports
Administration Guide (LLESWEBR-AGD)Administration Help.

66 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.14. WebReports Constants

2.14.5 Procedures Defining How to Use Constants


This section includes the following procedures:

• “To Manually Add a New Local Constant for the WebReport” on page 67
Use this procedure when you have constants you want to define, but have not
yet used, in the WebReport. Once defined here, you can reference them in the
reportview.
• “To Automatically Add a New Constant for the WebReport” on page 68
Use this procedure when you have made reference to one or more constants in
the reportview and you want to quickly populate them on the Constants tab.
This procedure saves time because it allows all the constants to be populated at
once. It will also, where possible, determine the constant type programmatically.
Where this is not possible, the constant will be of type string.
• “To Drag and Drop a Constant to the WebReport Reportview” on page 68
If you use the WebReports online editor, you can use the drag functionality to
speed up some activities.
• “To Delete a WebReport Constant” on page 69
Use this to delete a constant.

To Manually Add a New Local Constant for the WebReport


To manually add a new local constant for the WebReport:

1. On the WebReport Functions menu, select Properties > Constants.

2. On the Constants tab, in the Local Constants section, in the Actions column,
click the Add Row button .

Tip: If no other constants have been defined, in the Name column, click
the Click here to add new constant link.

3. In the newly created blank row, do the following:

a. In the Name box, type a name for this new constant. The constant name
cannot include spaces.
b. In the Value box, type a value for this new constant. You can also select
Browse to find a Content Server object, then click the Select link for that
object. After you click the Select link for a Content Server object, that object
ID is automatically populated in the Value box.
c. From the Type list, select the constant type.
d. Optional In the Description box, enter a description for this constant.

4. Click Update or Apply.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 67


Chapter 2 Working with WebReports

To Automatically Add a New Constant for the WebReport


To automatically add a new constant for the WebReport:

1. On the WebReport Functions menu, select Properties > Constants.

2. On the Constants tab, click the Extract Parameters from Content button to
add all the constants that are used in the reportview.

Note: This icon only appears when the reportview contains constants that
are not defined on the Constants tab.

3. For all the new constants, do the following:

a. In the Constant Value box, type a value for this new constant. You can also
select Browse to find a Content Server object, then click the Select link for
that object. After you click the Select link for a Content Server object, that
object ID is automatically populated in the Constant Value box.
b. Where possible, WebReports will determine the Constant Type of each
constant programmatically. Where this is not possible, the constant will
default to type String. You can optionally change the setting of Constant
Type.
c. Optional In the Constant Description box, enter a description for this
constant.

4. Click Update.

To Drag and Drop a Constant to the WebReport Reportview


To drag a constant to the WebReport reportview:

1. You can drag constants by selecting the appropriate constant from the list, and

then dragging the Drag tag onto a reportview section button to the point in
the reportview where you want to insert the constant.

2. Optional You can open the Constants tab in a new window by selecting the
Constant hyperlink associated with the list.

3. Optional You can update the list of constants in the list by clicking the Check

Constants tab for updates button . This updates the list without reloading
the page.

Tip: Constants in the list that are marked with an asterisk (*) are “Global
Constants” on page 66. These can be used in the same way as regular
constants, the difference being that they are defined in a different
WebReport.

68 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.15. Using WebReports Parameters

To Delete a WebReport Constant


To delete a WebReport constant:

1. On the WebReport Functions menu, select Properties > Constants.

2. On the Constants tab, on the row for the constant that you want to delete, in the
Row column, click the Delete Row button .

3. To confirm you want to delete this constant, click OK.

4. Click Update.

Tip: To delete all constant definitions for the entire WebReport, click the
Clear All Constants from the Tab button , and then click Update.

2.15 Using WebReports Parameters


When running a WebReport, parameters can be included in the URL for the
WebReport itself as well as for the associated data source. The following sections
describe two parameter types: WebReport parameters and Data Source parameters.

Note: Any WebReport that you intend to display in Smart View must not
contain custom parameters since they can only be accessed from Classic View.
You can create a custom parameter in Classic View using the Parameters tab
when you select “Custom” from the Type list. If you use Smart View to open a
WebReport that includes a custom parameter, the custom parameter prompt
screen will automatically open in Classic View.

WebReport Parameters
There are several parameters that control the behavior of the WebReport. Many of
these parameters are designed to allow WebReport designers to construct unique
URLs to modify the WebReport behavior according to application requirements.

For a list of available parameters for data sources, see “Data Source Parameters”
on page 111. For a list of parameters to control exporting, see “Export Using URLs”
on page 122.

In addition to these built-in parameters, the WebReports module also supports the
creation and use of unique parameters as defined by the WebReport developers.
These are passed by placing &parmname=data in the parameter list of the URL where
parmname can be any string of standard alpha-numeric characters.

Example: ?func=ll&objId=47478&objAction=RunReport&myparm=testdata&nexturl=

This data is then accessible within the reportview using the defined tag syntax. Using this
example, [LL_REPTAG_&myparm /] returns “testdata”. Use sub-tags to modify the data
returned by a parameter tag.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 69


Chapter 2 Working with WebReports

Data Source Parameters


The data sources, LisveReports, and Search Queries allow you to define and collect
input parameters when the report is run:

1. When you use a LiveReport as the data source, the standard LiveReport prompting is
allowed before the WebReport runs if no parameters have been supplied in the
URL. In this scenario, when you run the WebReport, the user sees the
LiveReport prompts as if they had run the LiveReport directly. After the user
has entered the required prompts, the WebReport continues.
2. When you define a WebReport with a saved query as the data source, you can insert
variables into the full text search specification of the saved query. For example,
you can place the term %1 in the Full Text Search Terms field of any full text
search boxes. These variables are substituted with any corresponding
parameters in the URL. URL parameters follow the same convention as a
LiveReport.
For example, inputlabel<x>=value, where <x> is a number from 1 to 99, which
corresponds with variables %1, %2, and so on.

Example: ...?func=ll&objId=47478&objAction=RunReport&inputLabel1=
WebReport&nexturl=...

In this example, a variable, such as %1, would be replaced with the word “WebReport” by
using a URL parameter in the form: inputlabel1=WebReport.

Use these variables in complex queries as part of the Content Server Query
Language, LQL (Livelink Query Language). Additional information about using
search can be found in OpenText Content Server - Search User Guide (LLESWBB-UGD).

If you run a WebReport by invoking its URL from a user-developed page, for
example from an HTML document or another WebReport, you can supply the
necessary input parameters for both the WebReport and any data source in the URL
that invokes the WebReport. If you pass all required LiveReport parameters within
the URL, the user will not be prompted for the input parameters.

Default Parameters
WebReports provides a feature to allow defaults to be set for any parameters that
would typically be passed through the URL. When you set a default value for a
parameter, then this value is used if no corresponding parameter is found in the
URL.

For more information about default parameters, see “WebReport Parameters


Procedures” on page 74.

70 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.15. Using WebReports Parameters

2.15.1 Parameter Tab Settings


This table provides details of the different options available on the Parameters tab
and the effect they have on the end report.

Prompt File Provide a file whose contents, either text-based or a separate WebReport,
will render at the top of the Prompts page. This facilitates quickly
applying the same branding or instructions at the top of all prompt pages.
Using a WebReport provides flexibility to bring back dynamic content to
the prompt screen. For example, a prompt file could perform some
summary counts on the data the user is about to select from the
prompting screen.
Show Select the Show Descriptions check box to determine whether the
Descriptions description text for each parameter, as defined in the associated Parameter
Description box, appears on the prompt page.
Parameter This is the name of the parameter as it will appear in the URL after the
Name user has selected their values and selected Run on the prompting page.
The parameter name must not contain spaces or other characters that
cannot be passed in a URL. Supported characters for use in the parameter
name include the following:
• alphanumeric ASCII (a-z, A-Z, 0-9)
• underscores (_)
• hyphens (-)
• periods (.)
• tildes (~)

The end user will be largely unaware of this value.


Display Text This is the text that the user will see as a prompt. It can be more
descriptive than the parameter name and can contain spaces.
Prompt Select the Prompt check box to prompt the user to provide a value for the
parameter. If this check box is clear, the user is not prompted for the
parameter and the default value is used.

Important
If you turn off prompting, ensure that you avoid placing users in a
situation where they are stuck. For example, this might occur if you
make a parameter mandatory, turn the prompting off, and do not
select a default value.
Mandatory Select the Mandatory check box to make a parameter mandatory. If a
parameter is mandatory, the user cannot progress beyond the prompt
screen without providing a value for the parameter, unless the parameter
has a default value. On the prompt screen, mandatory parameters have

prompt text that is e marked with the Required Field icon.


Prompt Order Provide an integer value to determine the order in which the parameters
will appear on the prompt screen.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 71


Chapter 2 Working with WebReports

Type Select a type from the list to determine the type of parameter for which the
user is prompted. This can be String, ObjectID, User, Number, Object,
Date, or Custom. For more information, see “Parameter Types”
on page 72.

Note: Any WebReport that you intend to display in the Smart UI


cannot contain parameters of type “Custom”. Custom parameters
can only be displayed in the Classic UI. By default, any custom
parameter screen run from the Smart UI will run in the Classic UI.
Default Value Provide a default value that is used if the user does not provide a value on
the prompt screen. The value auto-populates on the prompt screen and is
used by WebReports that are running on a schedule.
Parameter Enter descriptive information in this free text field. Use this description in
Description one of the following ways:
• Enter comments that document implementation details for developers.
• At the top of the Parameters tab, select the Show Descriptions check
box. Then, in the Parameter Description box, enter on-screen
instructions, which can contain HTML tags, that will appear to the end
user.

2.15.2 Parameter Types


This table illustrates the different parameter types that can be selected on the
Parameters tab and the effect that they have on the end report.

String Use the String parameter type to prompt the user with a free text field.
ObjectID Use the ObjectID parameter type to specify types of Content Server
objects from which the user can select on the prompt screen. One or more
items can be selected from the multi-value list, and at least one type must
be selected before the developer can browse for a default value.
User Use the User parameter type to create a user prompt. The developer can
decide whether the user is allowed to browse for Users, Groups or Users
and Groups.
Number The Number parameter type is similar to the String parameter.
However, the Number type forces the user to enter a numeric value.
Object The Object parameter type allows the user to select a Content Server
subtype. For example, select Document (144) or Folder (0).
Date Use the Date parameter type to prompts the user with a date field. The
developer can decide whether the time is displayed or not. The developer
can also decide if the user is prompted with a blank date, the current date,
or a specific date in time.

72 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.15. Using WebReports Parameters

Custom You can browse for a WebReport or HTML document that is being used to
provide a custom prompt. You can create any HTML input field using a
custom Parameter type. For example, you could create a custom list
parameter, as follows:
• Create an HTML file or WebReport that contains the following:
<select name="inputLabel1">
<option value="red">red</option>
<option value="yellow">yellow</option>
<option value="blue">blue</option>
</select>

• On the Parameters tab of the main WebReport, create a new Parameter


with the following settings:

Name Setting Value


Parameter Name inputLabel1

Note: The name here must


match the name as it is
entered in the HTML
element.
Display Text “Select a Color”
Prompt Checked
Mandatory Optional
Prompt Order Optional
Type Custom
Default Value Click the Browse button and
select the WebReport or HTML
file that was created in the first
step.

When the main WebReport is run, the user will be prompted to select a
value from the HTML drop-down list. This value will be available in the
main WebReport as [LL_REPTAG_&inputLabel1 /].

Notes
• You can build dynamic input fields by using a WebReport to
construct the HTML element. In this example, the HTML
<option> elements could be added to the Row Section of the
WebReport. This means the list could be populated according to
values returned by the data source.
• Any WebReport that you intend to display in Smart View must
not contain custom parameters since they can only be accessed
from Classic View. You can create a custom parameter in Classic
View using the Parameters tab when you select “Custom” from
the Type list. If you use Smart View to open a WebReport that
includes a custom parameter, the custom parameter prompt
screen will automatically open in Classic View.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 73


Chapter 2 Working with WebReports

SQL List Use the SQL List parameter type to pass a list of values to a Livereport
SQL List parameter. The values can be any valid SQL type. For example,
“text value1”, “text value2”, “text value3”.

When resolving the SQL List input parameter, WebReports encloses the
parameter in parentheses so that it can be used in an SQL IN clause. For
example:
...WHERE Name IN %1...

would resolve to
...WHERE Name IN ('text value1', 'text value2', 'text value3')...

RSI If the Records Management module is installed, the developer can browse
for a Record Series Identifier (RSI).
Check Box Use the Check Box parameter type to prompt the user with a check box. If
the parameter is configured as mandatory, then it must be selected to run
the WebReport.

2.15.3 WebReport Parameters Procedures


The following procedures describe how to manually or automatically add a
WebReport parameter; how to reference a WebReport parameter in a reportview;
and how to delete a WebReport parameter.

• You should manually add a WebReport parameter when you have parameters
you want to define but have not yet used in the WebReport. Once defined you
can reference them in the reportview. For more information, see “To Manually
Add a WebReport Parameter” on page 75.

• You should automatically add a WebReport parameter when you have made
reference to a parameter, or multiple parameters, in the reportview and you want
to quickly populate them on the Parameters tab. In addition, parameters defined
in LiveReport data sources will also be populated on the tab. This method saves
time on the manual method described previously because it allows all the
parameters to be populated at once. It also, where possible, will determine the
parameter type programmatically. Where this is not possible, the parameter will
be of type string. For more information, see “To Automatically Add a
WebReport Parameter” on page 75.

• After you have defined a parameter, you can insert the corresponding value into
the reportview as many times as required. It is not necessary to define a
parameter before adding the corresponding tag in the reportview. It may be
faster to define them using the automatic method once you have finished
changing the reportview. If working in the WebReports online editor, you can
use the drag functionality to speed up some activities. For more information, see
“To Reference Parameters in the WebReport Reportview” on page 76.

• You can delete one, or more, or all the WebReport parameters. For more
information about how to delete a WebReport parameter, see “To Delete a
WebReport Parameter” on page 76.

74 WebReports User Guide LLESWEBR230300-UGD-EN-01


2.15. Using WebReports Parameters

To Manually Add a WebReport Parameter


To manually add a WebReport parameter:

1. On the WebReport Functions menu, select Properties > Parameters.

2. On the Parameters tab, do the following:

a. To add a new parameter, click the Add Row button .

Tip: If no other parameters have been defined, in the Parameter


Name column, click the Click here to add new parameter link.
b. In the new, blank row that is created, add a parameter name, display text,
prompt order, default value, and other settings. For more information
about parameter options, see “Parameter Tab Settings” on page 71.
c. Click Update.

To Automatically Add a WebReport Parameter


To automatically add a WebReport parameter:

1. On the WebReport Functions menu, select Properties > Parameters.

2. On the Parameters tab, do one of the following:

• Click the Extract Parameters from Content button to add all the
parameters that are used in the reportview or LiveReport data source.

Note: The Extract Parameters from Content button only appears


when the reportview or LiveReport contains parameters that are not
defined on the Parameters tab.
• For all new parameters, add a parameter name, display text, prompt order,
default value and other settings. For more information about parameter
options, see “Parameter Tab Settings” on page 71.

3. Click Update.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 75


Chapter 2 Working with WebReports

To Reference Parameters in the WebReport Reportview


To reference parameters in the WebReport reportview:

• Do one of the following to reference parameters:

– Drag parameters by selecting the appropriate parameter from the list and
then dragging the Copy tag to clipboard or drag it onto a reportview section

button to the location in the reportview where you want to insert the
parameter.
– Open the Parameters tab in a new window by clicking the Parm link before
the list.
– Update the list of parameters in the list without reloading the page by

clicking the Check Parameters Tab for Updates button .

To Delete a WebReport Parameter


To delete a WebReport parameter:

1. On the WebReport Functions menu, select Properties > Parameters.

2. On the Parameters tab, do the following:

a. On the Parameters tab, on the row for the parameter that you want to
delete, in the Row column, click the Delete Row button .
b. Confirm you want to delete this parameter by clicking OK.

3. Click Update.

Tip: To delete all parameters definitions for the entire WebReport, click the
Clear All Parameters from the Tab button , and then click Update.

76 WebReports User Guide LLESWEBR230300-UGD-EN-01


Chapter 3
Help with Using WebReports Tags

There is a dynamic tag guide that ships as part of the module. This tag guide allows
developers to drag tags from the guide to the header, row, or footer sections of the
online editor. For more information about how to access this dynamically created
tag guide, see “To Access the Dynamic Tag Guide” on page 77.

3.1 To Access the Dynamic Tag Guide


To access the dynamic tag guide:

1. From any WebReports Functions menu, do one of the following:

• Click Open Tag Guide.


• Click Edit Reportview. On the Edit WebReport page, on the WebReports
tool bar, select Tag Guide.

2. Optional In the WebReport Tag Syntax Browse window, double click anywhere
on a row to expand or contract the specific description.

3. When you have finished using the dynamic tag guide, close the window.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 77


Chapter 4
WebReports Advanced Information

The following sections detail the advanced information required by WebReports


developers.

4.1 Action Sub-tags


The term Action sub-tags describes a set of sub-tags that perform specific actions as
opposed to manipulating the data returned by a WebReports tag. The following list
describes the current set of these sub-tags and what they do.

ADDVAR Used to take the tag data and add it numerically to a named variable.
ASSOCACTION Used to manipulate data stored in a Content Server Assoc data type.
CATACTION Used to set Category Attributes with tag values.
CONCATVAR Used to take the tag data and concatenate it to a named variable.
FORMACTION Used to perform actions on Content Server Forms.
NODEACTION Used to perform actions on Content Server nodes.
PERMACTION Used to permissions related actions on Content Server nodes.
RMACTION Used to set Records Management Attributes with tag values.
RMHOLDACT Used to set Records Management Hold Attributes with tag values.
SCACTION Used to set node Security Clearance Attributes with tag values.
SCUSERACTION Used to set user Security Clearance Attributes with tag values.
SETEMAILATTA Used to set email attachments with Email as a Destination.
CH
SETWFFORM Used to set form fields with tag values.
SETVAR Used to take the tag data and set a named variable with it.
SETWFATTACH Used to set Workflow attachments.
SETWRATTR Used to set Workflow Attributes with tag values.
SETWFCOMMENT Used to add comments to Workflow steps.
SETWFFORM Used to set Workflow form fields with tag values.
SETWFINFO Used to change the Title of a Workflow instance.
SETWFTASKINF Used to change the Priority of a user or group task in a Workflow
O instance.
WFTASKACTION Used to update data for a Workflow step.
USERACTION Used to perform actions on Content Server users and groups.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 79


Chapter 4 WebReports Advanced Information

WFACTION Used to perform actions on Workflows.

The ADDVAR, CONCATVAR, and SETVAR sub-tags are all associated with managing
variables. For more information about these sub-tags, see the Dynamic Tag Guide. For
information about how to access the Dynamic Tag Guide, see “To Access the Dynamic
Tag Guide” on page 77. For more information about how to work with variable
action sub-tags, see “Using Variables” on page 194.

4.1.1 Action Sub-tag Properties


One of the main differences between these sub-tags and the many other sub-tags is
that each of these sub-tags is designed to store or set the tag data in some other data
storage location. Normally, this means that the data from the corresponding tag will
not be returned and displayed in the output of the WebReport.

An action sub-tag can have any number of non-action sub-tags following it in the tag
syntax. Any changes to the tag data are used in the value that is eventually used to
perform the specified action.

Most sub-tags preceding an action sub-tag are ignored. The SHOW sub-tag, described
as follows, and the CURRENTVAL sub-tag described in “Using Variables” on page 194
are notable exceptions to this rule. The “Using Variables” on page 194 section also
provides a detailed description of the difference between these two sub-tags.

For more information about sub-tags, see the Dynamic Tag Guide. For information
about how to access the Dynamic Tag Guide, see “To Access the Dynamic Tag Guide”
on page 77.

4.1.2 Display Considerations


Typically, if you use an Action Sub-tag in a tag, it means that the tag data is not
returned to the output of the WebReport. If you need the tag data to also appear in
the report output, then the SHOW sub-tag must be used. This should usually be in the
last position in the sub-tag list. Note that, before the action is performed, this sub-tag
always causes the original tag value to appear. For variable action sub-tags it is
important to note that any variable calculations are not included in the displayed
data. The following examples should clarify this.

Note: The following examples all use a literal tag that returns a fixed value as
specified between quotes. This tag is sometimes useful when you must use a
specific number with action sub-tags, for example to add a specific number,
but it is used here primarily to simplify the examples.

[LL_ A variable called test is created and set to the value: 2. It is not displayed
REPTAG_"2" in the output. This value for test is assumed in the subsequent examples.
SETVAR:test
/]

80 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.2. AJAX Function Reference

[LL_ The value 123 is added to the variable named test, making the new value
REPTAG_"123" of test equal to 125. Nothing is displayed in the report output.
ADDVAR:test
/]
[LL_ The value 123 is added to the variable named test, assuming test is still set
REPTAG_"123" to 2. This makes the new value of test equal to 125. The tag value of 123 is
ADDVAR:test displayed in the report output.
SHOW /]
[LL_ The value 123 is decremented by the DEC subtag, changing the value to
REPTAG_"123" 122. This is then added to the variable named test making the new value
DEC of test equal to 124. The tag output, after the DEC sub-tag has modified it,
ADDVAR:test of 122 is displayed in the report output.
SHOW /]

4.2 AJAX Function Reference


The ajax.js file contains a list of useful functions that utilize AJAX, Asynchronous
JavaScript and XML, technology, which you can use within WebReports. One of the
benefits of AJAX is its ability to bring information to the browser in small pieces, as
the user requests it, without redrawing the entire page. The following functions
provide this ability as well as help in the design of powerful web-based applications
using WebReports and AJAX technology.

The following sections detail the additional information of the functions, required
and optional parameters, and some detailed examples using the functions in ajax.
js.

AJAX Library Functions


• “getURLParm( parm )” on page 82
• “updatePage( URLreference, HTMLelementID, optionalParms, JSfunction )”
on page 83
• “getJSData( URLreference, optionalParms, JSfunction )” on page 83
• “sendRequest( URLreference, responseFunction, reqType, optionalParms )”
on page 84
• “executeWRService( serviceType, responseTarget, parmList, responseType,
getPost, secure )” on page 84

AJAX Functions Examples


• Example 4-1, “getURLParm( parm ) Example” on page 85
• Example 4-2, “getJSData Example” on page 86
• Example 4-3, “sendRequest( WebReportId, responseFunction, reqType,
optionalParms ) Example” on page 88
• Example 4-4, “executeWRService( serviceType, responseTarget, parmList,
responseType, getPost ) Example” on page 90

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 81


Chapter 4 WebReports Advanced Information

• Example 4-5, “executeWRService( serviceType, responseTarget, parmList,


responseType, getPost ) Example” on page 91
• Example 4-6, “executeWRService( serviceType, responseTarget, parmList,
responseType, getPost ) with Secure Request Token in CS10 Example”
on page 92

4.2.1 AJAX Functions Reference Guide


The ajax.js file packaged with WebReports includes a list of functions designed to
aid in the use of WebReport services. The ajax.js file is accessed using a SCRIPT
include like this:
<SCRIPT SRC="/<support_dir>/webreports/library/ajax.js"></SCRIPT>

If you are including this file in a WebReport or ActiveView, you can use the LIBPATH
tag as follows:
<SCRIPT SRC="[LL_REPTAG_LIBPATH /]ajax.js"></SCRIPT>

Note: If you use [LL_WEBREPORT_EXCLUDEHTML /] in a WebReport that is also


using the AJAX Library Functions, you will need to define the following
variable in a script block. The reason is the baseURL variable is defined within
the Content Server page code that is inserted into the WebReport output but
this is excluded by the tag. The following code will ensure this variable is
defined and prevent the AJAX library from breaking.
<script>
baseURL = "[LL_REPTAG_URLPREFIX /]";
</script>

A description of the available functions in ajax.js and its parameters is provided in


the following sections.

getURLParm( parm )
• Returns the value that is associated with the parameter name in the current URL.
• Takes the following arguments:

– parm: a required parameter. parm is a String and a valid parameter name in


the current URL.
• If the required parameter, parm, is not found an alert message is displayed and
“undefined” is returned.
• Any parameter from the current URL can be retrieved using the getURLParm
function.
• For an example, see Example 4-1, “getURLParm( parm ) Example” on page 85.

82 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.2. AJAX Function Reference

updatePage( URLreference, HTMLelementID, optionalParms,


JSfunction )
• Either invokes a specified URL or invokes a WebReport that updates an HTML
component on the current page. The target WebReport usually returns a set of
HTML to be inserted into an HTML component in the current page.
• Takes the following arguments:

– URLreference (number/String): a required parameter. Either a URL or the


numeric objectId (dataId) or the nickname (String) of a WebReport. If the
nickname is numeric then it should be enclosed in quotes.
– HTMLelementID: a required parameter. A String that matches the ID of an
HTML element in the current page that is to be updated by the target
WebReport.
– optionalParms (String): an optional parameter. Any parameters to be
passed to the target WebReport being run. optionalParms has the format: &
parm1=value1,&parm2=value2...
– JSfunction: an optional parameter. An optional function that runs after the
specified HTML component has been updated. This function will be passed
the HTML object (as referenced by HTMLelementID) as a parameter.
• HTMLelementID represents any HTML element where the attribute innerHTML is
writable and can be used.
• Additional information can be passed to JSfunction as parameters. For more
information, see Example 4-2, “getJSData Example” on page 86.
• If you run the target WebReport on its own, everything you see in the browser is
returned to the invoking WebReport. For this reason, remember to use [LL_
WEBREPORT_EXCLUDEHTML /] to turn off the standard Content Server headers,
footers, and include files.
• If an error is encountered, a descriptive alert message will appear in the browser.
• Another example can be found in “Case 1 - Updating a Custom View with a
WebReport” on page 211.

getJSData( URLreference, optionalParms, JSfunction )


• Either invokes a specified URL or invokes a WebReport. The function expects
that in either case JavaScript code is returned for running by the calling web
page.
• Takes the following arguments:

– URLreference (number/String): a required parameter. Either a URL or the


numeric objectId (dataId) or the nickname (String) of the WebReport. If the
nickname is numeric then it should be enclosed in quotes.
– optionalParms (String): an optional parameter. Any parameters to be
passed to the target WebReport being run. optionalParms has the format: &
parm1=value1,&parm2=value2...

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 83


Chapter 4 WebReports Advanced Information

– JSfunction: an optional parameter. An optional function that is invoked


after any JavaScript is returned by the target WebReport and run. Any
JavaScript that needs to run only after a response is returned should be called
from here.
• Additional information can be passed to JSfunction as parameters.
• If an error is encountered a descriptive alert message will appear in the browser.
• For an example, see Example 4-2, “getJSData Example” on page 86.

sendRequest( URLreference, responseFunction, reqType,


optionalParms )
• Generic function that can send an AJAX request to invoke a WebReport. This
function is also used by both the updatePage and getJSData functions.
• Takes the following arguments:

– URLreference (number/String): a required parameter. Either a URL or the


numeric objectId (dataId) or the nickname (String) of the WebReport. If the
nickname is numeric then it should be enclosed in quotes.
– responseFunction (function): a required parameter. Function to run
when the AJAX request returns.
– reqType ('string','json','xml'): an optional parameter. The type of
request to send to the web server (Content Server). Valid types are either GET
or POST. The default value is GET.
– optionalParms (String): an optional parameter. Any parameters to be
passed to the target WebReport being run. optionalParms has the format: &
parm1=value1,&parm2=value2...

• If an error is encountered a descriptive alert message will appear in the browser.


• For an example, see Example 4-3, “sendRequest( WebReportId,
responseFunction, reqType, optionalParms ) Example” on page 88.

executeWRService( serviceType, responseTarget, parmList,


responseType, getPost, secure )
• Used to run a WR service and provides a way of retrieving information from the
WebReports engine. For example, it provides tag or sub-tags in a request and
returns the resulting data.
• Takes the arguments: serviceType, responseTarget, parmList, responseType,
getPost, and secure.

– serviceType: a required parameter. This parameter expects a String with one


of the supported servicetypes for running a WR service. For example,
gettagdata, getstatictags, liststatictags. For more information, see
“WR Services” on page 195.
– responseTarget: a required parameter. This parameter expects either a
JavaScript function that has been created by the developer, or a String
representing the ID of an HTML object where the returned data should be

84 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.2. AJAX Function Reference

inserted. If a JavaScript function is created (and passed to this parameter) it


should be written to accept the http_request as a parameter. For example:
function myHandlerFunction(httpRequest) {
alert('the response was: '+ httpRequest.responseText);
}
executeWRService( 'gettagdata', myHandlerFunction, "&statictag=userid
&subtags=USERINFO:GROUPID", 'json')

– parmList (String): an optional parameter. This parameter specifies a String


containing additional parameters to be added to the URL as required by each
servicetype. For example, the gettagdata service type uses a combination of &
tagdata, &statictag or &subtags as detailed in the syntax described in “WR
Services” on page 195. The parms should be specified in the &name=value
type format. For example, &tagdata=12345&subtags=
CAT:myCategory:attr1:display
– responseType ('string','json','xml'): an optional parameter. This
parameter expects a string with one of the supported response types for WR
services For example, 'string', 'json', 'xml' - as described in “WR Services”
on page 195. If not specified, it defaults to json.
– getPost ('GET','POST'): an optional parameter. Use this parameter to
specify whether the AJAX request should be GET or POST. If omitted, the POST
method is used.
– secure - (true/false): an optional parameter. Use this parameter to
specify whether a secure token should be requested first and then added to
the actual request. If omitted, this feature is not used.
• If an error is encountered a descriptive alert message will appear in the browser.
• For examples, see “Examples Using the AJAX Functions” on page 85.

4.2.2 Examples Using the AJAX Functions


Example 4-1: getURLParm( parm ) Example

Simple example demonstrating how to use the getURLParm function. In this


example, you can copy and paste the following code into a WebReport. No
Data Source Type needs to be specified (For example, no LiveReport needs to
be created) for the WebReport. For this example the current URL will have the
form: /Livelink971/livelink.exe?func=ll&objId=139061&objAction=
RunReport&nexturl=%2FLivelink971%2Flivelink%2Eexe%3Ffunc%3Dll
%26objid%3D138743%26objAction%3Dbrowse%26sort%3Dname
<SCRIPT SRC="[LL_REPTAG_LIBPATH /]ajax.js"></SCRIPT>

<TABLE>
<!-- Display values returned from getURLParm into the HTML page -->
<TR>
<TD>objId parameter: </TD>
<TD id="objectId"></TD>
</TR>
<TR>
<TD>objAction parameter: </TD>
<TD id="objectAction"></TD>
</TR>
<TR>
<TD>nexturl parameter: </TD>
<TD id="nextUrlParm"></TD>

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 85


Chapter 4 WebReports Advanced Information

</TR>
<TR>
<TD>Invalid parameter: </TD>
<TD id="invalidParm"></TD>
</TR>
</TABLE>

<SCRIPT>
// Example calls to getURLParm on the current URL
// Populate the above HTML
document.getElementById('objectId').innerHTML = getURLParm('objId');
document.getElementById('objectAction').innerHTML = getURLParm('objAction');
document.getElementById('nextUrlParm').innerHTML = unescape( getURLParm('nexturl') );
document.getElementById('invalidParm').innerHTML = getURLParm('badParm'); //
alert message is displayed and undefined is returned.

</SCRIPT>

WebReport Output:
objId parameter: 139061
objAction parameter: RunReport
nexturl parameter: /Livelink971/livelink.exe?
func=ll&objid=138743&objAction=browse&sort=name
Invalid parameter: undefined

Example 4-2: getJSData Example

This example demonstrates dynamically counting filter hits as the user types. It
is an alternative approach to implementing “Case 2 - Dynamically Counting
Filter Hits as the User Types” on page 213 found in the Detailed Examples
section. In this approach, we use getJSData function to retrieve the number of
matches, whereas the “Case 2 - Dynamically Counting Filter Hits as the User
Types” on page 213 example explicitly sends the AJAX request from the
WebReport. Both approaches are acceptable and a matter of preference to the
developer.

Create the two LiveReports as specified in Case 2 - Dynamically counting filter


hits as the user types. Next add a new WebReport and link it to the first
LiveReport you created. Copy and paste the following code into the
WebReport.
[LL_WEBREPORT_EXCLUDEHTML /]

[LL_WEBREPORT_STARTROW /]
hits = '[LL_REPTAG=hits /]';
[LL_WEBREPORT_ENDROW /]

The [LL_WEBREPORT_EXCLUDEHTML /] tag excludes all the HTML, JavaScript


and Style definitions that Content Server uses to wrap any given page. This tag
is necessary when using the getJSData function. This WebReport returns the
count information as specified by the column 'hits' and set a JavaScript variable.
Note that you do not need to set the destination MIME type to text or xml, as
stated in Case 2.

86 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.2. AJAX Function Reference

Call this WebReport from where the user will run their query. Create a second
WebReport and use the second LiveReport created as its data source. Edit the
reportview so that you have something like this:
<!-- Include the AJAX library functions -->
<SCRIPT SRC="[LL_REPTAG_LIBPATH /]ajax.js"></SCRIPT>

<SCRIPT>
// This variable 'hits' is updated when the target WebReport is called and executed
by getJSData
var hits = "";

function updateHits(myFilter) {
// $TargetWR is constant and WebReportID of the first WebReport
// displayHits is the JSfunction called after any JavaScript has been returned
and executed from the getJSData function
getJSData([LL_REPTAG_$TargetWR /], '&inputLabel1=' + myFilter, displayHits);
}

function displayHits() {
// Update the count info in the HTML
document.getElementById("hitsText").innerHTML = "Matches: " + hits;
}
</SCRIPT>

[LL_REPTAG_MYID NODEINFO:NAME /]
[LL_REPTAG_MYID LLURL:FUNCTIONMENU /]
[LL_REPTAG_MYID LLURL:UPALEVEL /]
<BR>

<INPUT TYPE=TEXT ID="MYFILTER" ONKEYUP="updateHits(this.value);">


<INPUT TYPE=BUTTON VALUE="Run" ONCLICK="document.location='[LL_REPTAG_MYID
LLURL:REPORT /]&inputLabel1=' + document.getElementById('MYFILTER').value">

<DIV ID="hitsText">Updates when you type</DIV>


<TABLE>
<TR>
<TD>[LL_REPTAG_COLNAME1 /]</TD>
<TD>[LL_REPTAG_COLNAME++ /]</TD>
<TD>[LL_REPTAG_COLNAME++ /]</TD>
<TD>[LL_REPTAG_COLNAME++ /]</TD>
<TD>[LL_REPTAG_COLNAME++ /]</TD>
</TR>

[LL_WEBREPORT_STARTROW /]

<TR>
<TD> [LL_REPTAG_1 /]</TD>
<TD> [LL_REPTAG_2 /]</TD>
<TD> [LL_REPTAG_3 /]</TD>
<TD> [LL_REPTAG_4 /]</TD>
<TD> [LL_REPTAG_5 /]</TD>
</TR>

[LL_WEBREPORT_ENDROW /]

</TABLE>

This report uses a constant, TargetWR, which needs to be defined on the


Constants tab by setting the object type to Content Server and browsing for the
first WebReport created previously.

This second WebReport also expects a parameter that, unless the report
developer states otherwise, causes a prompt when the report runs. The
developer could enter the parameter name, “inputLabel1” in this case, along

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 87


Chapter 4 WebReports Advanced Information

with an empty default value and the prompt field set to “no”. This will have
the effect of causing all the results to be returned initially.

The code example has been cut down to a minimum to demonstrate principles
and techniques. It takes no account of error paths, web browser type, or
Content Server permissions. These things can accounted for by the developer.

Example 4-3: sendRequest( WebReportId, responseFunction, reqType,


optionalParms ) Example

This is a simple example demonstrating the sendRequest function. In this


example, we use sendRequest to call a WebReport to retrieve a list of objects in
the Content Server DTree table that start with 'Livelink'. The results are
tabulated and returned to the calling (Main) WebReport where they are
displayed to the user. Please note that you can use sendRequest to call any
WebReport and retrieve any report data that is relevant to your business
application. For simplicity sake, we are retrieving report data from the DTree
table.

Create a very simple LiveReport that retrieves a list of objects from DTree
based on its name. Something like: select * from dtree where Name like
'%1%'

Define the parameter, %1, as type insertString. The LiveReport should


prompt for user input.

Next, add a new WebReport that uses the LiveReport as its data source. This is
the target WebReport that tabulates the report data and returns it to the calling
WebReport. Copy and paste the following code into the WebReport:
<!-- To prevent the standard Content Server headers, footers, and include files to be
shown in the page -->
[LL_WEBREPORT_EXCLUDEHTML /]

<TABLE>
<!-- Display column names -->
<TR>
<TD>DataID</TD>
<TD>Name</TD>
<TD>Modify Date</TD>
<TD>SubType</TD>
</TR>

[LL_WEBREPORT_STARTROW /]
<TR CLASS="[LL_REPTAG_ROWNUM ODDEVEN:Browserow1:Browserow2 /]" VALIGN="CENTER" NOWRAP
ALIGN="LEFT">
<TD> [LL_REPTAG=DataID /]</TD>
<TD> [LL_REPTAG=Name /]</TD>
<TD> [LL_REPTAG=ModifyDate DATE:"SHORT" /]</TD>
<TD> [LL_REPTAG=SubType /]</TD>
</TR>
[LL_WEBREPORT_ENDROW /]
</TABLE>

As you can see, the report data is tabulated using WebReports. The [LL_
WEBREPORT_EXCLUDEHTML /] is necessary and excludes all the HTML,

88 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.2. AJAX Function Reference

JavaScript, and Style definitions that Content Server uses to wrap any given
page.

Finally, create the calling (Main) WebReport that calls sendRequest. For this
example, we do not need to specify a data source for this WebReport because
we are only demonstrating the sendRequest functionality. Copy and paste the
following code into the Main WebReport:
<B>[LL_REPTAG_MYID NODEINFO:NAME /]</B>
[LL_REPTAG_MYID LLURL:FUNCTIONMENU /]
[LL_REPTAG_MYID LLURL:UPALEVEL /]<BR><BR>

<!-- Include the AJAX library functions -->


<SCRIPT SRC="[LL_REPTAG_LIBPATH /]ajax.js"></SCRIPT>

<SCRIPT>
var optHandlerFunc = function () { JSfunction() };
var handlerFunc = function () { executeJS( http_request, optHandlerFunc ) };

// $TargetWR is a constant and objectID of the target WR. Here we pass the name
'Livelink' as a parameter to the target WR.
sendRequest([LL_REPTAG_$TargetWR /], handlerFunc, '&inputLabel1=Livelink');

// Handle the response to sendRequest


function executeJS(http_request, JSfunction) {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
// Display the results from the target WR in the current page
document.getElementById('showDocs').innerHTML =
http_request.responseText;

if ( JSfunction ) {
// execute any user passed function
JSfunction();
}
} else {
alert('There was a problem with the request.');
}
}
}

function JSfunction() {
// Add anything else here after the results are displayed
}
</SCRIPT>

<BR>
[LL_WEBREPORT_STARTROW /][LL_WEBREPORT_ENDROW /]
<TABLE>
<TR>
<TD><b>List of objects in DTree that start with 'Livelink' - using the AJAX
sendRequest function</b></TD>
</TR>
<TR>
<TD id="showDocs"> </TD>
</TR>
</TABLE>

Please note that you must define $TargetWR on the constants tab of the Main
WebReport by setting the object type to Content Serverr and browsing for the
target WebReport. Also, after the results are returned and displayed, you can
add any additional JavaScript to JSfunction. The report table data is inserted in
the innerHTML of the TD tag showDocs shown earlier. The output of Main
WebReport is displayed as follows:

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 89


Chapter 4 WebReports Advanced Information

Main WebReport Output: list of objects in DTree that start with Livelink -
using the AJAX sendRequest function.

DataID Name Modify Date Sub Type


2018 Livelink Templates 09/17/2008 541
2013 Livelink 09/17/2008 481
Appearances
2004 Livelink Categories 09/17/2008 133
2002 Livelink Reports 09/17/2008 211
2001 Livelink System 09/17/2008 148

Example 4-4: executeWRService( serviceType, responseTarget, parmList,


responseType, getPost ) Example

This example shows two different ways to call the gettagdata service using
the predefined function: executeWRService. In one instance we have written a
special function called handleServiceJSON, which is designed to “eval” the
JSON data (convert the JSON data to Javascript objects) and use the resulting
JavaScript structures to display the result of the request. In this request we are
using &tagdata= with a data ID and then using the NODEINFO:NAME sub-tag
variation to look up the name of an item. Note that because we requested a
responseType of json, the resulting data structure includes a field called
“error”, which indicates whether or not we have valid data. In the
handleServiceJSON function, we use this field to determine whether to alert
an error or to display the content. In the second instance, (the Get URL button)
we pass the name of an HTML object on the page. When the request returns
from Content Server, it automatically inserts the resulting text into the specified
HTML component. Because we want text dumped into the page (and we do not
plan on analyzing the response for errors or handling it programmatically) the
reponseType of string was selected in this example.
<SCRIPT SRC="[LL_REPTAG_LIBPATH /]ajax.js"></SCRIPT>
<script>

function handleServiceJSON(request) {
var rt = request.responseText;
var jsvar = eval('(' + rt + ')')
var error = jsvar.error;
var content = jsvar.content;
if (error == 'true') {
alert('error text is: ' + content);
} else {
alert('Object name is:' + content);
}
}

function getName(did){
did = document.getElementById('dataid').value;
getNameParms = '&tagdata=' + did + '&subtags=nodeinfo:name';
executeWRService( 'gettagdata', handleServiceJSON,getNameParms,'json');
}

90 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.2. AJAX Function Reference

function showURL(did){
did = document.getElementById('dataid').value;
getURLparms = '&tagdata=' + did + '&subtags=LLURL:OPEN';
executeWRService('gettagdata', 'displayname', getURLparms,'string');
}
</script>

<input type=text value="[LL_REPTAG_MYID /]" ID=dataid> URL: <SPAN ID=displayname></


SPAN><br>
<input type=button value="Get Item Name" onclick=getName()> <input type=button
value="Get URL" onclick=showURL()>

Example 4-5: executeWRService( serviceType, responseTarget, parmList,


responseType, getPost ) Example

This example shows how to use the getstatictags service. The service is
invoked using the executeWRService function in ajax.js. Besides using the
identifier getstatictags to select the correct service, a function called
handleStaticTags (specifically written for this sample application) is passed
to the executeWRService function, which, in turn, sets up a request to Content
Server. The request is set up so that when the request returns from Content
Server, the handleStaticTags function is called. In this example, we've
written code in handleStaticTags to take the JSON structure from the
request.responseText, convert it to a JavaScript structure and then traverse
this structure to show all the static tag values that were returned from Content
Server.
<SCRIPT SRC="[LL_REPTAG_LIBPATH /]ajax.js"></SCRIPT>
<script>

function handleStaticTags(request) {

var rt = request.responseText;
var jsvar = eval('(' + rt + ')')
var error = jsvar.error;
var content = jsvar.content; // This should be an array of tags

if (error) {
alert('error text is: ' + content);
} else {
tempStr = '';
for (tag in content) {
tempStr += tag + ' = ' + content[tag] + '<br>';
}
document.getElementById('display').innerHTML = tempStr;

}
}

function getStaticTags(){

executeWRService( 'getstatictags', handleStaticTags,'json');


}

</script>
<input type=button value="Get Static Tags" onclick=getStaticTags()>
<hr>
<DIV ID="display">

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 91


Chapter 4 WebReports Advanced Information

</DIV>

Example 4-6: executeWRService( serviceType, responseTarget, parmList,


responseType, getPost ) with Secure Request Token in CS10 Example

Supported in Content Server 10.0 and up.

This example is the same as Example 4-4, “executeWRService( serviceType,


responseTarget, parmList, responseType, getPost ) Example” on page 90
earlier, except that it has been secured by using a Secure Request Token for the
NODEINFO subtag. In WebReports 10.0.1 Update 01, NODEINFO is, by default,
considered a “secured” sub-tag and will not run in a WR Service call unless
you provide a Secure Request Token. To obtain a Secure Request Token (SRT),
you must make an additional call using the getsecureToken function in
WebReport Services. For more information, see the following getToken()
function. This function returns a token, and an additional handler,
handleToken(), in this example passes the token to the getName() function.
getName() has been altered to append the token to the NODEINFO request URL
before the executeWRService() call runs for that sub-tag.
<SCRIPT SRC="[LL_REPTAG_LIBPATH /]ajax.js"></SCRIPT>
<script>

function handleToken(request) {
var token = request.responseText;
getName(token);
}

function handleServiceJSON(request) {
var rt = request.responseText;
var jsvar = eval('(' + rt + ')')
var error = jsvar.error;
var content = jsvar.content;
if (error == 'true') {
alert('error text is: ' + content);
} else {
alert('Object name is:' + content);
}
}

function getToken(){
executeWRService( 'getsecureToken', handleToken,'','string');
}

function getName(token){
did = document.getElementById('dataid').value;
getNameParms = '&tagdata=' + did + '&subtags=nodeinfo:name&securerequesttoken=' +
token;
executeWRService( 'gettagdata', handleServiceJSON,getNameParms,'json');
}

function showURL(did){
did = document.getElementById('dataid').value;
getURLparms = '&tagdata=' + did + '&subtags=LLURL:OPEN';
executeWRService('gettagdata', 'displayname', getURLparms,'string');
}

</script>

92 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.3. Browse Function Reference

<input type=text value="[LL_REPTAG_MYID /]" ID=dataid> URL: <SPAN ID=displayname></


SPAN><br>
<input type=button value="Get Item Name" onclick="getToken()"> <input type=button
value="Get URL" onclick=showURL()>

For more information about the NODEINFO sub-tag, see the Dynamic Tag Guide.
For information about how to access the Dynamic Tag Guide, see “To Access the
Dynamic Tag Guide” on page 77.

4.3 Browse Function Reference


The following functions are available to use in your ActiveView/WebReport
reporting applications. They provide useful page browsing utilities to enhance and
simplify the design process for developers. Add URL parameters, create sortable
columns, or create useful COPY, MOVE, DELETE buttons in your reports using any
of the following functions.

4.3.1 Browse Functions Reference Guide


The browse.js file packaged with WebReports includes a list of functions designed
to aid in page browse design. The browse.js file is accessed using a SCRIPT include
like this: <SCRIPT SRC="/<support dir>/webreports/library/browse.js"></
SCRIPT>

If you include this file in a WebReport or ActiveView, you can use the LIBPATH tag
as follows: <SCRIPT SRC="[LL_REPTAG_LIBPATH /]browse.js"></SCRIPT>

setFilter( name, value )


• Used to register any parameters and add to the current URL. Calling this will
ensure the parameters will exist even if a column is re-sorted and can be accessed
later on in a session.
• Takes the following arguments:

– name: a required parameter. name is a String that represents the name of the
new parameter to be added to the URL.
– value: a required parameter. name is a String or a Number that represents the
value of the parameter.
• Example: setFilter( 'count', 2 );
The parameter &count=2 is added to the current URL.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 93


Chapter 4 WebReports Advanced Information

setupContext( support_Dir, url_Prefix, my_URL, next_URL,


def_SortCol, sort_Dir, form_name, style_Type )
• This function initializes a set of global variables in browse.js used by various
utility functions. For example, to manage sort columns.
• Takes the following arguments:

– support_Dir: a required parameter. The location of the support directory:


[LL_REPTAG_SUPPORTDIR /]. For example: /Livelink971support/
– url_Prefix: a required parameter. [LL_REPTAG_URLPREFIX /]. For
example: /Livelink971/livelink.exe
– my_URL: a required parameter. The current location: [LL_REPTAG_SOURCEID
LLURL:BROWSE /]. For example: ?func=ll&objId=<xxx>&objaction=browse
Where <xxx> is an objectId.
– next_URL: a required parameter. Location of the next URL: [LL_REPTAG_
NEXTURL ESCAPEURL /]
– def_SortCol: a required parameter. The current value of the sort column. For
example, name. Usually specified with a parameter tag, such as [LL_REPTAG_&
SORT /]. Where there is more than one possible sort column, you can specify
an array in JSON format with the current values of all columns. The
setColumn functions will look for the first non-blank value. Typically, this
will look like this: ['[LL_REPTAG_&AVSORT /]','[LL_REPTAG_&SORT /]'].
– sort_Dir: a required parameter. The default sort direction. For example: '' or
desc.
– form_name: an optional parameter. The name of the form in the reportview/
template, defaults to BrowseViewFrm.
– style_Type: an optional parameter. Optional boolean parameter (true/false)
to indicate if you want CS10 styling (true) or pre-CS10 styling (false) for the
report columns.
• This function must be called before using any of the other functions in browse.
js.

setupContextPOST( support_Dir, def_SortCol, sort_Dir,


form_name, style_Type )
• This function is equivalent to setupContext but is used when POST requests are
required instead of GET. This is useful when the page being submitted has data
being passed using form fields.

94 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.3. Browse Function Reference

setColumn( title, parm2, parm3, parm4, parm5, parm6 )


• Creates a column in an ActiveView/WebReport that is sortable when the title is
clicked. A set of formatting attributes can also be specified and applied to the
column.
• Takes the following arguments:

– title: a required parameter. The title to appear for the column. If no title is
specified, for example '', then a divider is added.
– HTML Attributes: an optional parameter. An optional parameter that
represents a comma separated list of HTML formatting attributes for the
column. For example “align=right,width=10%,etc...”
– Sort Reference: an optional parameter. An optional string that represents
the column name to be sorted on from the datasource. Simple column names
can be specified here. For example, “subtype” or “name”. If you want to sort
by the value of a WebReport sub-tag, you can specify a simple “reference
key” here and define the sub-tag in the @PREDEFKEY directive in the SORT tag.
For example, if parm3='catValue' then the SORT tag will contain the
following: @PREDEFKEY REF:catValue PARM:"[LL_REPTAG=DATAID
CAT:'somecat':'someattr':DISPLAY /]")
– CS Sorting: an optional parameter. Optional boolean parameter, true/false, to
indicate that you want to use the Content Server sort, for example &sort=
name, &sort=-name, or the WebReport sort, for example &sort=name&
direction=asc, &sort=name&direction=desc syntax. Default value is
false. Simple column names should use the Content Server sort (true). Sorting
based on complex tag/sub-tags combinations should use the WebReport sort
(false).
– Alternate Sort Parm: an optional parameter. Optional string parameter that
allows you to define your own custom sort parameter in the URL. This is
used in conjunction with the @PARMNAMES directive, which needs to be defined
in the SORT tag. Example: parm5='AVsort' then the SORT tag will look for the
&AVsort parameter to sort by instead of the default &sort parameter.
– Current Value for Alt Parm: an optional parameter. Optional String
parameter to specify the sort value specified by the alternate sort parameter.
Usually, this is a parameter tag that uses the name in alternate sort parm.
For example, [LL_REPTAG_&AVSORT /]
• This function requires that setupContext function be run beforehand because
certain variables are referenced within the function. For example: supportDir,
urlPrefix, myURL, and sortCol.

• Additional documentation on the @PREDEFKEY and @PARMNAMES directives can be


found in “Sorting WebReports Results” on page 187.
• Example:
setColumn( '' );
// No title is specified, just add a divider
setColumn( 'Type', 'width=2%', 'subtype', true );
// Simple usage. Sort by the column 'subtype' returned from the datasource using
the Content Server sort.
setColumn( 'Name', 'align=left', 'name', true );
// Simple usage. Sort by the column 'name' returned from the datasource using the

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 95


Chapter 4 WebReports Advanced Information

Content Server sort.

// Sort the column by the value of '=DATAID NODEINFO:VERSIONNUM' tag/sub-tag. Here


'verNum' is a reference key for the @PREDEFKEY directive defined in the SORT tag
below. Here we are using the WebReport sort.
setColumn( 'Version', 'align=right,width=15%', 'verNum' );

// Sort the column by a category-attribute value. 'catValue' is a reference key and


'AVsort' is a custom sort parameter defined in @PARMNAMES directive in the SORT tag
below.
setColumn( 'Attribute', '', 'catValue', false, 'AVsort' );

...

[LL_WEBREPORT_STARTROW /]

[// Sort tag with the directives @PARMNAMES and @PREDEFKEY defined. Add
additional @PREDEFKEY's here if you need to sort by complex tag/sub-tag
combinations.
[LL_WEBREPORT_SORT @PARMNAMES SORTCOL:AVsort SORTDIR:direction @PREDEFKEY
REF:verNum PARM:"[LL_REPTAG=DATAID NODEINFO:VERSIONNUM /]" @PREDEFKEY REF:catValue
PARM:"[LL_REPTAG=DATAID CAT:'somecat':'someattr':DISPLAY /]" /]

[LL_WEBREPORT_ENDROW /]

...

setColumnPOST( title, parm2, parm3 )


This function is equivalent to setupColumn but is used when POST requests are
required instead of GET. This is useful when the page being submitted has data being
passed using form fields.

multiButton( gifName, label, reqHandler, reqName )


• Creates and inserts a button into a ActiveView/WebReport page. It displays the
appropriate button style based on the Content Server instance.
• Takes the following arguments:

– gifName: a required parameter. String specifying the name of the image in the
support directory.
– label: a required parameter. String specifying the label to appear on the
button in the page.
– reqHandler: a required parameter. String specifying the request handler
action to take when the button is clicked.
– reqName: a required parameter. String specifying the name of the request.
• This function requires that setupContext function be run beforehand because
supportDir variable is referenced within the function.

• Example:
<SCRIPT>
// Create the buttons Copy, Move, Delete, Zip & Download, Zip & Email, and
Print on the page
multiButton('copy', 'Copy', 'll.ProcessMultiCopy','copy');
multiButton('move', 'Move', 'll.ProcessMultiMove','move');
multiButton('del', 'Delete', 'll.ProcessMultiDelete','delete');
multiButton('multifile/zipdwnld', 'Zip & Download', 'multifile.zipdwnldmulti',
'zipdwnld');
multiButton('multifile/zipemail', 'Zip & Email', 'multifile.zipemailmulti',

96 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.3. Browse Function Reference

'zipemail');
multiButton('multifile/print', 'Print', 'multifile.printmulti', 'print');
</SCRIPT>

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 97


Chapter 4 WebReports Advanced Information

4.4 CAT:JSARRAY Examples

Figure 4-1: Example Category definition

Figure 4-2: Example Category data

Category data can be returned in a JavaScript data structure by using the JSARRAY
parameter with the CAT or VERSIONCAT sub-tags, for example [LL_REPTAG=DATAID
CAT:JSARRAY /] returns data for the current version of a node. The data returned is
shown following, with the addition of comments. The values shown in Figure 4-2
can be seen in the following JavaScript data structure.

For more information about the CAT and VERSIONCAT sub-tags, see the Dynamic Tag
Guide. For information about how to access the Dynamic Tag Guide, see “To Access
the Dynamic Tag Guide” on page 77.

It should be noted that a JavaScript prototype approach was used to store the
category data. The new catData() statement refers to a constructor function and
cat_data.newNode(...) is a method of the catData object used to store the
category.

Example 4-7: Example JavaScript

The following code is produced when calling [LL_REPTAG=DATAID


CAT:JSARRAY /]:

98 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.4. CAT:JSARRAY Examples

<script>
/* Call to catData constructor function to instantiate a object. */
var cat_data = new catData();

/* newNode is a method to store the category data into the object. */


/* 108158 is the objectid of the node the categories are applied to */
cat_data.newNode(108158,{

/* 108157 is the objectid of the first category applied to node 108158 */


/ * 'Type Testing Category' is the name of the first category applied to the node */
"108157":{"id":108157, "name":"Type Testing Category", "req":false, "catver":1,
"nodever":1,

/* attr_data is where all the attribute data is stored */


"attr_data":{
/* 2 is the id of the first attribute in the category */
/* 'Date of Test' is the name of the first attribute */
/* -7 is the internal Content Server representation of the attribute type */
/* multi is set to true if the attribute is a multi value attribute */
/* set is set to true if the attribute is a set */
"2":{"id":2, "name":"Date of Test", "req":false, "type":-7, "len":null,
"maxlen":null, "rows":null, "maxrows":null, "multi":false, "set":false, "values":
[["_1_1_2_1", "2008/2/5:0:0:0"]]},
"3":{"id":3, "name":"Pass or Fail", "req":false, "type":5, "len":null,
"maxlen":null, "rows":null, "maxrows":null, "multi":false, "set":false, "values":
[["_1_1_3_1", true]]},
"4":{"id":4, "name":"Value", "req":false, "type":2, "len":null, "maxlen":null,
"rows":null, "maxrows":null, "multi":false, "set":false, "values":[["_1_1_4_1", 453]]},

"5":{"id":5, "name":"Tester Details", "req":false, "type":-18, "len":null,


"maxlen":null, "rows":null, "maxrows":null, "multi":true, "set":true,
/* here the structure gets a little more complex because we are looking at a
multi value set */
"attr_data":{
"0":{
"6":{"id":6, "name":"First Name", "req":false, "type":-1, "len":32, "maxlen":
32, "rows":1, "maxrows":1, "multi":false, "values":[["_1_1_5_1_6_1", "Lee"]]},
"7":{"id":7, "name":"Last Name", "req":false, "type":-1, "len":32, "maxlen":
32, "rows":1, "maxrows":1, "multi":false, "values":[["_1_1_5_1_7_1", "Butler"]]},
"8":{"id":8, "name":"Phone Number", "req":false, "type":-1, "len":20,
"maxlen":20, "rows":1, "maxrows":1, "multi":false, "values":[["_1_1_5_1_8_1",
"44556677"]]},
/* here we are adding multi value attributes into a multi value set */
"9":{"id":9, "name":"Associates", "req":false, "type":-1, "len":32, "maxlen":
32, "rows":1, "maxrows":3, "multi":true, "values":[["_1_1_5_1_9_1", "Greg Petti"],
["_1_1_5_1_9_2", "Steve Osborn"], ["_1_1_5_1_9_3", "Darren Hodder"]]}
},

"1":{
/* here we defined the second element of the multi-value set */
"6":{"id":6, "name":"First Name", "req":false, "type":-1, "len":32, "maxlen":
32, "rows":1, "maxrows":1, "multi":false, "values":[["_1_1_5_2_6_1", "James"]]},
"7":{"id":7, "name":"Last Name", "req":false, "type":-1, "len":32, "maxlen":
32, "rows":1, "maxrows":1, "multi":false, "values":[["_1_1_5_2_7_1", "Brown"]]},
"8":{"id":8, "name":"Phone Number", "req":false, "type":-1, "len":20,
"maxlen":20, "rows":1, "maxrows":1, "multi":false, "values":[["_1_1_5_2_8_1",
"77441199"]]},
"9":{"id":9, "name":"Associates", "req":false, "type":-1, "len":32, "maxlen":
32, "rows":1, "maxrows":3, "multi":true, "values":[["_1_1_5_2_9_1", "Brian Howson"],
["_1_1_5_2_9_2", "Peter Brown"]]}
}
}
}
}
}
})
</script>

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 99


Chapter 4 WebReports Advanced Information

4.4.1 CAT:JSARRAY and Functions Example


Additional functions to retrieve category data can be found in “CAT:JSARRAY
Function Reference” on page 103 to use in your reporting applications. This
reference guide provides detailed information about the functions, function
parameters, return types, and simple example usage. These functions can be
conveniently used in your reporting applications to retrieve category data.

Example 4-8: A simple real world usage of CAT:JSARRAY and its


functions

Please note that this example contains no formatting of the output. It is


illustrated here to show users how to access and display the key elements of the
data structure. It should be a relatively simple task to add formatting. In
addition, a LiveReport (not shown) was created and linked to this WebReport,
which retrieves a list of documents with a category applied. For this example,
the LiveReport retrieves the columns DataID, Name, and CreateDate of the
document.
<style type="text/css">
.note {
position: absolute;
top: 0px;
left: 0px;
background: #ffc;
padding: 10px;
border: 1px solid #000;
z-index: 1;
width:300;
visibility: hidden;
font: 11px "Verdana", Arial, Helvetica, sans-serif;
color: #000;
}
</style>

<script>

var theDivId;

// simple function to make a DIV visible - this is where the category data will appear
function showNote(event, noteid){
note=document.getElementById(noteid);
note.style.left=event.clientX + document.body.scrollLeft;
note.style.top=event.clientY + document.body.scrollTop;
note.style.visibility='visible';
}

// opposite to the above function, just hide the DIV


function hideNote(event, noteid){
note=document.getElementById(noteid);
note.style.visibility='hidden';
}

// Function used to determine if the passed parameter is an array or not


// Returns true if its an array, false if its not
function isArray(obj) {
if (obj.constructor.toString().indexOf("Array") == -1)
return false;
else

100 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.4. CAT:JSARRAY Examples

return true;
}

// function that will populate the note with all category data associated with the node
function showCatData(nodeId) {

theDivId = 'note' + nodeId;


theDiv = document.getElementById(theDivId);
theDiv.innerHTML = '';

// Retrieve category data structure for this particular node


var thisNode = cat_data.nodes[nodeId];

// Iterate thru the data strucutre to display all category fields and data
for (catid in thisNode) {

// Display the category name


theDiv.innerHTML += '<TABLE><TR><TD CLASS="browseBoxHeader" WIDTH="100%">' +
cat_data.getCatName(catid, nodeId) + '</TD></TR></TABLE>';

// cycle through the attributes


for ( attid in thisNode[catid].attr_data ) {

// just look at regular attributes and multi-value attributes


if (thisNode[catid].attr_data[attid].set == false){

// display the attribute name and corresponding value using the CAT:JSARRAY
functions
theDiv.innerHTML += '<b><font color="#2B3856">' +
cat_data.getAttrName(catid, attid, nodeId) + ':</font></b> ';
theDiv.innerHTML += '<font color="#5E5A80">' + cat_data.getAttrValue(catid,
attid, nodeId) + '</font>';
theDiv.innerHTML += "<br>";

// Here we have a set or a multi-value set


} else {
// display the set name
theDiv.innerHTML += '<b><font color="#2B3856">' +
cat_data.getAttrName(catid, attid, nodeId) + '</font></b> ';
theDiv.innerHTML += "<br>";

// cycle through the sets - one iteration for a regular set and multiple for
multi-value sets
for ( row in thisNode[catid].attr_data[attid].attr_data ){

// cycle through the attributes in the set


for ( rowAttr in thisNode[catid].attr_data[attid].attr_data[row] ){

// Retrieve the value of the set attribute


var attrValue = cat_data.getAttrValue(catid, rowAttr, nodeId);
var theValue = "";

// Check to see how the data is wrapped


if ( isArray(attrValue) ) {

// Data is wrapped in an array. Return the value based on the row we


are on. For example [ [row1 values], [row2 values], [row3 values], ... ]
theValue = attrValue[row];

} else {

// Just a single value is returned. For example A string, number, ...


theValue = attrValue;

// display the attribute name and corresponding value within the set
theDiv.innerHTML += '<b><font color="#2B3856">' +
cat_data.getAttrName(catid, rowAttr, nodeId) + ':</font></b> ';
theDiv.innerHTML += '<font color="#5E5A80">' + theValue + '</font>';

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 101


Chapter 4 WebReports Advanced Information

theDiv.innerHTML += "<br>";

}
}
}
}

theDiv.innerHTML += "<br>";

</script>

<table border=1>
<tr>
<td><b>Name</b></td>
<td><b>Create Date</b></td>
<td><b>Cat data</b></td>
</tr>

[LL_WEBREPORT_STARTROW /]

[LL_REPTAG=DataId CAT:JSARRAY /]

<tr>
<td>[LL_REPTAG=Name /] [LL_REPTAG=DataId LLURL:FUNCTIONMENU /]</td>
<td>[LL_REPTAG=CreateDate DATE:SHORT /]</td>
<td>
<IMG height=14 width=14 SRC="[LL_REPTAG_SUPPORTDIR /]webattribute/16category.gif"
BORDER="0" STYLE="decoration:none;" ONMOUSEOVER="showNote(event,
'note[LL_REPTAG=DataId /]');showCatData([LL_REPTAG=DataId /]);return false;"
ONMOUSEOUT="hideNote(event, 'note[LL_REPTAG=DataId /]');return false;">
<div id="note[LL_REPTAG=DataId /]" class="note" ONMOUSEOUT="hideNote(event,
'note[LL_REPTAG=DataId /]');return false;"><nobr><center>Aquiring Category Data</
center></nobr><br><br><nobr><center>please wait</center></nobr></div>
</td>
</tr>

[LL_WEBREPORT_ENDROW /]

</table>

Figure 4-3: Example output from the first example

102 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.5. CAT:JSARRAY Function Reference

4.5 CAT:JSARRAY Function Reference


The following functions are used in conjuction with the [LL_REPTAG=DATAID
CAT:JSARRAY /] tag. This tag returns a JavaScript object representation of all the
category and attribute data for a specific node. The following detailed information
describes the functions that you can use for indexing CAT:JSARRAY values.

The following functions are available to use in your reporting applications.

4.5.1 CAT:JSARRAY Functions


categoryID is the objectID of the category.

nodeID is the objectId of the node that the category is applied to. This corresponds to DATAID
in the [LL_REPTAG=DATAID CAT:JSARRAY /] tag.

cat_data.getCatName(categoryId, nodeId)
Description returns the name of the category.

Parameters

• categoryID a required parameter.


• nodeID an optional parameter. If not specified pass 'null', '', or nothing.

Returns null if an error is encountered or the category name is not found.

cat_data.getAttrName(categoryId, attributeId, nodeId)


Description returns the name of the attribute.

Parameters

• categoryID a required parameter.


• attributeID a required parameter. Has the format '2','3','4',... (string) or 2,3,4,...
(integer).
• nodeID an optional parameter. If not specified pass 'null', '', or nothing.

Returns null if an error is encountered or the attribute is not found.

cat_data.getAttrDataByField(categoryId, attributeId, fieldName,


nodeId)
Description returns attribute info based on the field name specified.

Parameters

• categoryID: a required parameter.


• attributeID: a required parameter. Has the format '2','3','4',... (string) or 2,3,4,...
(integer).

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 103


Chapter 4 WebReports Advanced Information

• fieldName: a required parameter. should be one of the following: 'req', 'type',


'len', 'maxlen', 'rows', 'maxrows', 'multi', 'set'. It must be case-sensitive.
• nodeID: an optional parameter. If not specified pass 'null', '', or nothing.

Returns null if an error is encountered or the field name is not found.

cat_data.getAttrNameValuePairs(categoryId, nodeId)
Description returns a JS array (multi-dimension) with all the fieldIds and attribute values. For
example, [ ('_1_1_2_1', '2008/2/5:0:0:0'), ('_1_1_3_1', true), ... ]

Parameters

• categoryID: a required parameter.


• nodeID: a required parameter.

Basically everything you need to make a submission of the category data.

Returns null if an error is encountered or if the fieldId/value pairs are not found.

cat_data.getAttrValue(categoryId, attribute, nodeId)


Description returns the value of an attribute. If the attribute is multi-value it returns an array, for
example, [1,2,3]. If the attribute is multi-value in a multi-value set, an array of
arrays is returned, for example, [ [1,2,3], [2], [4,6,8] ].

Parameters

• categoryID: a required parameter.


• attribute: a required parameter. It can be any of the following:

– attributeId - 2,3,4, ... (string) or 2,3,4,... (integer)


– Attribute display name - for example, Date of Test. It must be case-sensitive
for the function to return a value(s).
In addition, the set name can also be passed, for example Tester Details,
which returns all attribute values in the set in a multi-dimensional array.
Each index in the array will represent the row attribute values. For example, [
[row1 attr values], [row2 attr values], [row3 attr values], ...]
– fieldId - has the representation _1_1_2_1 where 2 is the attributeId. It is a
unique identifier and always return 1 attribute value.
• nodeID: a required parameter.

The function will determine whether a name or id is passed in, and take the
appropriate action.

Returns null if an error is encountered or if the attribute value is not found.

104 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.5. CAT:JSARRAY Function Reference

4.5.2 Example Using the CAT:JSARRAY Functions


Example 4-9: CAT:JSARRAY Functions Example

Figure 4-4: Example Category definition

Figure 4-5: Example Category data

The following is example code for accessing or retrieving data from Figure 4-5
using the CAT:JSARRAY functions:
[LL_WEBREPORT_STARTROW /]
[LL_WEBREPORT_ENDROW /]

[LL_REPTAG_"108158" CAT:JSARRAY /]

<script>

// categoryId = 108157 (categoryId of Type Testing Category)


// nodeId = 108158 (objectId of a document which has this category applied to
it)

// Get category name


var catName = cat_data.getCatName(108157, 108158);

// Get attribute name


var attrName = cat_data.getAttrName(108157, 2, 108158);

// Get attribute info based on field names


var attrReq = cat_data.getAttrDataByField(108157, 3, 'req', 108158);
var attrMulti = cat_data.getAttrDataByField(108157, 5, 'multi', 108158);

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 105


Chapter 4 WebReports Advanced Information

var attrMaxlen = cat_data.getAttrDataByField(108157, 6, 'maxlen', 108158);

// Get all attribute fieldIds and values


var attrs = cat_data.getAttrNameValuePairs(108157, 108158);

// Get some attribute values


var valueAttr = cat_data.getAttrValue(108157, 4, 108158);
var lastNameAttr = cat_data.getAttrValue(108157, 'Last Name', 108158);
var phoneNumAttr = cat_data.getAttrValue(108157, '_1_1_5_1_8_1', 108158);

// Display Results
alert(catName); // 'Type Testing Category' is displayed
alert(attrName); // 'Date of Test' is displayed
alert(attrReq); // 'false' is displayed, meaning 'Pass or Fail'
attribute is not required.
alert(attrMulti); // 'true' is displayed. 'Tester Details' is a multi-
value set.
alert(attrMaxlen); // '32' is displayed, which is the max length of 'First
Name' attribute.
alert(attrs.toString()); // Displays all the attribute fieldId and values in the
category in an array representation.
alert(valueAttr); // '453' is displayed.
alert(lastNameAttr); // Array is returned with the values: 'Butler','Brown'
alert(phoneNumAttr); // '44556677' is returned.

</script>

More CAT:JSARRAY examples can be found at “CAT:JSARRAY Examples”


on page 98.

4.6 Custom Sub-tags


Use ordinary text documents to create your own sub-tags and place them into a
folder on the server. This allows you to generate sub-tag features customized for
your needs that you can include in your WebReport reportview and use just like any
other sub-tag. There are no restrictions on what you can code in a custom sub-tag
because they are located on the server. This means that OScript packages that are
normally blocked for use in a WebReport reportview with server-side scripting are
available in a custom sub-tag. This results in a WebReports sub-tag that behaves just
like any other sub-tag that is packaged with WebReports. A sample custom sub-tag
called sample.txt is located in the <Content Server_home>\appData\webreports
\subtags folder on the server where you installed Content Server. Use this file as a
template to build new sub-tags and save them into the same folder. In addition,
there is an associated <Content Server_home>\appData\webreports\subtags\
sample.txt.json file that provides configuration for the sub-tag. This sample.txt.
json file is required for sub-tag functionality.

Notes
• To make the new custom sub-tags available, you must restart the Content
Server service.
• To test that your sub-tag code compiles correctly, use the Content Server
Administration > WebReports Administration > WebReports Sub-tag
Builder page. For more information, see OpenText Content Server -
WebReports Administration Guide (LLESWEBR-AGD).

106 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.6. Custom Sub-tags

Example 4-10: Creating a custom sub-tag called ADDINTEGERS which


adds together the integers passed into the tag

1. Create a copy of the sample.txt file and rename it to addintegers.txt.


2. Create a copy of the sample.txt.json file and rename it to addintegers.
txt.json.

3. Replace the text in the addintegers.txt file with the following:


function Object Execute( \
List args = {} )

// Calling the "dataAs..." casting functions will operate on the data passed
to the sub-tag
// from any previous tags (.fData), provided the functions are not passed a
specific value to cast.
// For the [LL_REPTAG_'2' ADDINTEGERS:3:4 /] example this is operating on the
tag literal integer 2
// from [LL_REPTAG_'2'

Integer value1 = .dataAsInteger()

// Each tag argument separated by a colon is added to a list.


// For the [LL_REPTAG_'2' ADDINTEGERS:3:4 /] example the first argument, 3
would be accessible
// using args[1] as it is the first element in the args list
// The second argument, 4 would be accessible using args[2] as it is the
second element in the args list

Integer value2 = .dataAsInteger( args[1] )


Integer value3 = .dataAsInteger( args[2] )

if ( IsDefined( value1 ) && IsDefined( value2 ) )

.fData = value1 + value2

if ( IsDefined( value3 ) )

.fData += value3

end

else

return .SetError( 'ADDINTEGERS', 'Arguments must be valid integers',


1001 )

end

return this
end

This will create a custom sub-tag called ADDINTEGERS. The sub-tag takes
between one and two arguments and adds them to the value in the main
tag, returning the total. The code contains error handling, so if any of the
arguments are not integers, an error message will be returned instead of the
total.
4. Save the updated addintegers.txt file.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 107


Chapter 4 WebReports Advanced Information

5. Replace the text in the addintegers.txt.json file with the following:


{
"fMinParms":1,
"fMaxParms":2,
"fShowInTagGuide":true,
"OverrideRule": "UPVERSION",
"Version": "1.0.1",
"Documentation":"<p>
Add the value of the main tag to the arguments passed in.
</p>
<br>
Examples:<br><br>

[LL_REPTAG_'2' ADDINTEGERS:3 /] returns 5.<br><br>

[LL_REPTAG_'2' ADDINTEGERS:3:4 /] returns 9.<br><br>

[LL_REPTAG_'x' ADDINTEGERS:'y' /] returns '* ADDINTEGERS: Arguments must be


valid integers *'.<br><br>
"
}

The keys in the JSON file are populated as follows:

• fMinParms is an integer defining the minimum number of arguments


that the sub-tag will accept. If less than the minimum arguments are
passed in, then an error will be returned.
• fMaxParms is an integer defining the maximum number of arguments
that the sub-tag will accept. If more than the maximum arguments are
passed in, then an error will be returned.
• fShowInTagGuide defines whether the sub-tag will appear in the online
Tag Guide. Can be set to TRUE or FALSE.
• OverrideRule defines the circumstances where the sub-tag will be
applied. It can have three values:

– UPVERSION: the custom sub-tag will only be added if it doesn't


already exist, or if there is already a version of the sub-tag in your
version of WebReports, then the custom sub-tag will take
precedence over the existing sub-tag only if the custom sub-tag has a
higher version number.
– NEWONLY: the custom sub-tag will only be added if it doesn't already
exist in your version of WebReports.
– ALWAYS: the custom sub-tag will always be applied, regardless of
whether or not it already exists in your version of WebReports.

Notes

• If a version field is present, the default is: UPVERSION , otherwise


ALWAYS.

• Documentation defines the text that will be displayed in the online


Tag Guide if fShowInTagGuide is set to TRUE.

108 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.7. Using a Content Server Category as a Data Source

6. Restart Content Server.

Example 4-11: Call the new custom sub-tag

Call the new custom sub-tag from any WebReport reportview as follows:

• [LL_REPTAG_'2' ADDINTEGERS:3 /] returns 5.


• [LL_REPTAG_'2' ADDINTEGERS:3:4 /] returns 9.
• [LL_REPTAG_'x' ADDINTEGERS:'y' /] returns “* ADDINTEGERS:
Arguments must be valid integers *”.

4.7 Using a Content Server Category as a Data


Source
A WebReport can use a Content Server Category as a data source. A user may select
one or many Content Server Categories, then select one or many Attributes within
each Category. The WebReport will process an SQL query against the Content
Server database DTREE and LLATTRDATA tables and return one record for each
Content Server item with the selected Categories applied.

Each record returned from the query will contain the following values:

DataID The DataID for the object as stored in the Content Server DTREE database
table.
ParentID The ParentID for the object as stored in the Content Server DTREE
database table.
SubType The SubType for the object as stored in the Content Server DTREE
database table.
Name The Name for the object as stored in the Content Server DTREE database
table.
Attribute The current value for each selected Attribute as stored in the Content
Values Server LLAttrData table. The column header is the attribute system
name. For example, the original attribute name with spaces replaced by
underscores.

Features of a Category as a Data Source


When you select the Content Server Category data source, the following features
are available:

• Select a Category On the Source tab, in the Content Server Category area, click
Browse Content Server to select a Content Server Category. After you select a
Category, the page will reload with a display of all Attributes within the
Category.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 109


Chapter 4 WebReports Advanced Information

• Select Attributes In the Content Server Category area, select the check box for a
specific Attribute to include the attribute within the query results. When you
select an attribute, the Add Parameter Operators menu icon appears for that
attribute. When you clear an attribute, the Parameter menu for that attribute is
removed.
• Click Check All or Uncheck All to select or clear all check boxes for all attributes
in the category.
• In the Content Server Category area, click the Delete <CategoryName> button
to delete a specified category.
• In the Content Server Category area, click Add a New Content Server Category
icon to add another category. The Add a New Content Server Category icon
only appears at the end of the current listing of categories. The Content Server
administrator may configure the number of categories that may be included in
the Data Source list and the Add a New Content Server Category icon will
not appear when the limit has been reached.
• Category And/Or Join Operator - For each new Category, select either the And
option or the Or option to specify whether the categories are joined in the query
with an inner join (And) or a left outer join (Or).

Using Parameters with a Category as a Data Source


The WebReport designer may define Category/Attributes as WebReport parameters
and specify a query operator from the WebReports Data Source page. When a
Category/Attribute has been checked on the Data Source page, a new Add
Parameter Operators menu icon appears, from which a query operator may be
selected. When a query operator has been selected from the Parameter Menu, the
attribute is now available using the Parameter Extraction process on the Parameters
tab.

When an attribute has a selected parameter query operator, the Edit Parameter
Operators menu icon appears and a check mark appears to indicate the selected
query operator.

If an attribute is currently used as a parameter and the query operator is changed


from the Data Source page, the query will now be based on the newly selected
query operator. The WebReport designer is prompted with the option to update the
display text on the Parameter page. Regardless of the display text on the Parameter
page, the SQL Query processed always uses the query operator as selected on the
Parameter menu on the Data Source page.

To clear a selected query operator from the parameter menu, do one of the
following:

• Select another query operator from the same menu to set a new query operator.
• Select the existing query operator to reset the query operator to undefined.

110 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.8. Data Source Parameters

Category Data Source Actions


Three additional actions are available to the WebReport designer when Content
Server Category is the selected data source.

1. Click View SQL to view the generated SQL for currently selected categories,
attributes and defined parameters.

Note: Only a WebReport designer with Modify privileges may view the
SQL.
2. Select the Filter Results by User Permissions check box to limit the query
results based on the permissions of the user running the WebReport. The user
must have see permission to view a specific item.

Note: The default value for this feature is selected; only a user with Content
Server administrator privileges may modify this feature.
The permissions filter is applied to query results as a separate process, after
the database query has completed processing.
3. Set the Maximum Number of Results to an integer value indicating the
maximum number of results to be returned by the database query. Note that the
number of items displayed may be less than the defined Maximum Number of
Results when the permissions filter is applied after the query return. The
WebReports designer may select a value no greater than the value defined by the
Content Server administrator.

4.8 Data Source Parameters


WebReport data sources can be manipulated using special parameters called data
source parameters. Examples of WebReport data sources include LiveReports,
Search Queries or Forms. These parameters are passed in the URL when a
WebReport runs and they control things like the maximum number of results on
each page.

Pagination
One useful application of data source parameters is pagination. This is discussed in
full detail in “WebReports DSstartrow and DSendrow” on page 225.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 111


Chapter 4 WebReports Advanced Information

4.8.1 Data Source Parameters and Descriptions


The following table describes the data source parameters.

Parameter Name Description


sourceid The sourceid parameter allows an
alternative data source to be specified as a
dataid. The dataid must correspond with one
of the node types that WebReports currently
supports as a data source.

For more information, see “Data Source


Configuration” on page 34.
DSstartrow The DSstartrow parameter allows the
starting row from the data source to be
specified using a number from 1 to <N>. This
means that any rows before the specified
DSstartrow will not be used in the report.

You can combine the DSstartrow


parameter with the DSendrow or
DSmaxrows parameters.

For more information, see “Data Source


Parameters Examples” on page 115.
DSendrow The DSendrow parameter allows the last
row from the data source to be specified
using a number from 1 to <N>. This means
that any rows after the specified DSendrow
will not be used in the report.

If the DSendrow parameter is specified as a


negative number, then zero (0) rows are
returned. If the DSendrow parameter
specifies a row number less than the
DSstartrow parameter then zero rows are
also returned.

Use the DSendrow parameter with the


DSstartrow or DSmaxrows parameters.
When used with the DSmaxrows parameter,
the parameter that results in the most limited
set of data will have precedence.

For more information, see “Data Source


Parameters Examples” on page 115.

112 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.8. Data Source Parameters

Parameter Name Description


DSmaxrows The DSmaxrows parameter uses a number
from one to <N> to specify the maximum
number of rows to be used from the data
source. There will never be more rows than
the number specified in DSmaxrows.

As described for DSendrows, DSmaxrows


specifies a maximum number of rows, but
the actual number of rows may be less than
DSmaxrows if the DSstartrow and
DSendrow parameters combine to specify a
smaller set of data. If you specify the
DSmaxrows parameter as a negative
number, then zero (0) rows are returned.

For more information, see “Data Source


Parameters Examples” on page 115.
By default, the Content Server search process returns all columns set as Displayable on the
Enterprise Search Manager page > Regions tab. This was a change introduced in Content
Server 10. The Livelink 9.7.1. behavior returned only those columns set as Displayed in the
Edit Display Options settings within the search template, plus some default columns. To
support this type of behavior, and allow this feature to be more flexible, we have added
some data source parameters for Saved Search and Search Query Integration data sources.
This can be useful when you want to use templates that dynamically output columns, such
as the Comma Separated Values Report - Scripted default template.
DSdisplayedOnly When set to true, the DSdisplayedOnly
parameter returns only those columns set as
Search Query Launch and Saved Search Displayed in the search template under Edit
Query data sources only. Display Options. This will not return the
Content Server default search columns.

For more information, see “Data Source


Parameters Examples” on page 115.
DSkeepDefaultCols When set to true, the
DSkeepDefaultCols parameter will
Search Query Launch and Saved Search enable the default columns to be retained.
Query data sources only. This setting is only applicable when
DSdisplayedOnly is also set to true.

For more information, see “Data Source


Parameters Examples” on page 115.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 113


Chapter 4 WebReports Advanced Information

Parameter Name Description


DSuseResultsDisplayStyle When using the Search Query Launch data
source, you can dynamically change the
Search Query Launch data source only. display style on the Advanced Search page
before running the search. By default,
WebReports ignores these changes and will
still return the columns defined in the
original search template.

When set to true, the


DSuseResultsDisplayStyle parameter
will override this default behavior so that the
columns defined under Results Display
Style are returned. This setting is only
applicable when DSdisplayedOnly is also
set to true.

For more information, see “Data Source


Parameters Examples” on page 115.
RankBy Part of an optional group of three
parameters: sortBy, rankBy, and
Search Query Launch and Saved Search rankDirection. All three must be
Query data sources only. configured when you need to enforce Search
Results by a specific Search Region.

rankBy is a string parameter that can takes


the name of the region that you want to use
to sort your Search Results. For example, you
could use OTName for the proper name of the
object, OTSubType for the content type, or
any number of the Search Regions
configured to be sortable by the
administrator on the Enterprise Search
Manager page > Regions tab.

For information about advanced search


development, see OpenText Content Server -
Search API Programming Guide (LLESSRC-
PGD) available from My Support.

114 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.8. Data Source Parameters

Parameter Name Description


RankDirection Part of an optional group of three
parameters: sortBy, rankBy, and
Search Query Launch and Saved Search rankDirection. All three must be
Query data sources only. configured when you need to enforce Search
Results by a specific Search Region.

rankDirection is a string parameter that


takes either ascending or descending as a
string to return a subset of pre-sorted Search
Results.

For information about advanced search


development, see OpenText Content Server -
Search API Programming Guide (LLESSRC-
PGD) available from My Support.
SortBy Part of an optional group of three
parameters: sortBy, rankBy, and
Search Query Launch and Saved Search rankDirection. All three must be
Query data sources only. configured when you need to enforce Search
Results by a specific Search Region.

sortBy is a string parameter that allows you


to insert a custom parameter directly into a
display options command to refine
Search Results. For example, this can be
“custom”, “region”, and so on.

For information about advanced search


development, see OpenText Content Server -
Search API Programming Guide (LLESSRC-
PGD) available from My Support.

4.8.2 Data Source Parameters Examples


Example 4-12: DSstartrow

If the data source has 100 rows of data, and a DSstartrow of 21 is specified,
without any DSendrow or DSmaxrows parameters, then only rows 21 through
100 would be used.

Example 4-13: DSendrow

If the data source has 100 rows of data, and you specify a DSendrow of 75,
without any DSstartrow or DSmaxrows parameters, then only rows 1 through
75 are used.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 115


Chapter 4 WebReports Advanced Information

Example 4-14: DSstartrow, DSendrow, and DSmaxrows

If you specify the parameters DSstartrow=1, DSendrow=75, and DSmaxrows=


20, then only rows 1 through 20 are used.

Furthermore, if you specify the parameters DSstartrow=1, DSendrow=20, and


DSmaxrows=100, only rows 1 through 20 are used.

Example 4-15: Example of URL invocation

Consider the following:

?func=ll&objId=1234&objAction=RunReport&sourceid=12345&
DSstartrow=11&DSendrow=100&DSmaxrows=50

In this example, the data source identified by nodeid 12345 is used to supply
data for the WebReport.

The data used will end at row 50, despite the DSendrow parameter being set to
100, because the DSmaxrows parameter is set to 50.

Example 4-16: DSdisplayedOnly, DSkeepDefaultCols and


DSuseResultsDisplayStyle

When using DSdisplayedOnly and DSkeepDefaultCols with Search Query


Launch it is necessary to add the parameters to the parameters page of the
WebReport with the default value of “true”. When using a Saved Search
Query data source, these can also be passed in using a URL invocation:
?func=ll&objId=1234&objAction=RunReport&sourceid=12345&
DSdisplayedOnly=true&DSkeepDefaultCols=true

You can only use DSuseResultsDisplayStyle with the Search Query Launch
data source type, so you cannot use this for a URL invocation.

Considering the following:

Consider using Search Query Launch to call a WebReport from the Advanced
Search page. The WebReport is using the Comma Separated Values Report -
Scripted default reportview. The search template you choose only specifies the
Name, Location, and MIME Type fields as Displayed when you go to Edit
Display Options.

If DSdisplayedOnly is set to “true” and DSkeepDefaultCols is set to “false”,


then the data source only includes the Name, Location, and MIME Type
columns.

116 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.8. Data Source Parameters

If DSdisplayedOnly is set to “true” and DSkeepDefaultCols is also set to


“true”, then the data source will include the Name, Location, and MIME Type
columns. It will also include the Content Server default columns. For example:
'OwnerID','DataID','ParentID','versionNum','CreatedBy',
'ModifyDate','SubType','Record','shortSummary','Summary'

If you go back to the search screen and change the Displayed columns for your
template to show Location you will see that the same result is returned, and
this change is not accounted for.

If you add DSuseResultsDisplayStyle with a default parameter value of


“true” and run the same test, you should see the Name and MIME Type have
been removed from the data source.

4.8.3 Using WebReports Search as a Data Source


WebReports enables you to use a saved Content Server search query as a data
source. This means that you can query documents within the system based on their
textual content and then format and process the results as you would like.

“Using Variable Parameters in Search Queries” on page 176 describes how to use
parameters within the Full Text field of a saved search. A simple example would be
to just add %1 to the Full Text field and then save the search. You could then set this
to be the source of a WebReport and specify the search term using a WebReport
parameter when running the report.

To dynamically specify other parameters other than simple search terms in the Full
Text field, you need to use Livelink Query Language (LQL). LQL is a structured way
to build queries in the Full Text field and then specify %n parameter values within
the LQL clauses. You can, for example, use LQL to specify to only search within a
particular folder or to filter based on System Attribute values.

For more information about LQL, see the following:

• OpenText Content Server - Search User Guide (LLESWBB-UGD)


• OpenText Content Server - Search User Guide (LLESWBB-UGD)
• OpenText Content Server - Search User Guide (LLESWBB-UGD)
• OpenText Content Server - Search User Guide (LLESWBB-UGD)
• Quick Reference: Constructing Search Bar Queries (https://
knowledge.opentext.com/knowledge/cs.dll/open/22490878)

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 117


Chapter 4 WebReports Advanced Information

Create a WebReport that Uses Livelink Query Language for a


Saved Search Data Source
This WebReport takes in parameter values for the search term, a folder location to
search under and to return all document versions created between a specified date
range.

To create the saved search to use as a data source

1. On the Search box, click the Open Search Panel button and then click the
Advanced Search link.

2. From the workspace, click Tools > Search.

3. On the Advanced Search page, in the Full Text box, enter the following:
( [ qlregion "OTLocation" ] "%1" ) AND "%2" AND ( [ qlregion "OTVerCDate" ]
qlrange "%3~%4" )

where

( [ qlregion is the DataID for the folder that you want to search
"OTLocation"
] "%1" ) - %1
"%2" - %2 is the search keyword that you want to use
( [ qlregion searches the Version Create Date between the range of %3 and %4.
"OTVerCDate"
] qlrange
"%3~%4" )

4. Request that the administrator do the following:

a. On the Content Server Administration page, in the Search


Administrationarea, click the Open the System Object Volume link.
b. On the <ObjectVolumeName> System page, click the Enterprise Data Source
Folder that the administrator should have been defined during system set
up.
c. On the Enterprise Data Source Folder page, click the Enterprise Search
Manager Functions menu and then click Properties > Regions.
d. On the Enterprise Search Manager properties page, on the Regions tab, on
the OTVerCDate row, select both the Queryable check box and the
Displayable check box.

5. On the Advanced Search page, in the Slices box, selectEnterprise [All


Versions].

6. In the Save Options area, click Save Search Query.

After you define and save the search query, you can use it as the data source for
your WebReport.

118 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.8. Data Source Parameters

To create a WebReport that uses the basic template to pass the parameters
and return the results

1. Create a new WebReport, choosing the search query we just created as Data
Source and choosing the HTML Table Report - Basic Formatted for the
reportview file.

2. For the WebReport node, click the Functions menu, then click Properties >
Parameters.

3. To auto-populate the parameters from the saved search data source created in
“To create the saved search to use as a data source“ on page 118, click the

Extract Parameters from Content button .

Note: The Extract Parameters from Content button only appears if


you have previously specified a FullText Search Query or similar data
source.

4. On the row for the each parameter, do the following:

a. In the Display Text column, configure display text that will make sense to
the end user. For example:

• ParentID
• SearchTerms
• FromDate
• ToDate
b. To allow the user running the report to browse for the folder, in the Type
column, from the Type menu, select Object ID, then click Browse. In the
Filter Object window, click the Select link for the container that you want.

Note: In the Default Value box, you can choose to filter the browse to
only show the selected object types to the end user. For example, if
you clicked Folders, the Filter Object window would only show
Select links for folders.
c. For the date parameters, FromDate and ToDate, in the Parameter
Description column, you must explain to the end user that they must enter
the date in the YYYYMMDD format.

5. Click Update to save the parameter settings.

6. From the workspace, on the row for the WebReport, click the Edit Reportview
link.

7. On <WebReportName> page, add new column headers to the default basic


reportview to show some relevant columns about the versions. For example:

• For the HEADER SECTION for Column Headings:

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 119


Chapter 4 WebReports Advanced Information

<TR>
<TD>[LL_REPTAG_"DataID" /]</TD>
<TD>[LL_REPTAG_"ParentID" /]</TD>
<TD>[LL_REPTAG_"Name" /]</TD>
<TD>[LL_REPTAG_"Version Create Date" /]</TD>
<TD>[LL_REPTAG_"Version Number" /]</TD>
<TD>[LL_REPTAG_"Location" /]</TD>
<TD>[LL_REPTAG_"Version Filename" /]</TD>
<TD>[LL_REPTAG_"Search Record" /]</TD>
</TR>

• For the ROWSECTION for Column Data:


<TR CLASS="[LL_REPTAG_ROWNUM ODDEVEN:userRow1:userRow2 /]" VALIGN="CENTER"
NOWRAP
ALIGN="LEFT">
<TD>&nbsp;[LL_REPTAG=DataID /]</TD>
<TD>&nbsp;[LL_REPTAG=ParentID /]</TD>
<TD>&nbsp;[LL_REPTAG=Name /]</TD>
<TD>&nbsp;[LL_REPTAG=OTVerCDate /]</TD>
<TD>&nbsp;[LL_REPTAG=Record RECORD:"Version" /]</TD>
<TD>&nbsp;[LL_REPTAG=Location /]</TD>
<TD>&nbsp;[LL_REPTAG=Record RECORD:"Filename" /]</TD>
<TD>&nbsp;[LL_REPTAG=Record /]</TD>
</TR>

Notes

• Due to the way that data is returned from the Search Data Source, you
may need to use the RECORD sub-tag. To see which columns are stored
within this record, you can use [LL_REPTAG=Record /] in the row
section. You can then access the content using the syntax for this sub-
tag. For example: RECORD.<fieldName>.
• The ROWSECTION example uses the following syntax to access the
version number and file name information:
[LL_REPTAG=Record RECORD:"Version" /]
[LL_REPTAG=Record RECORD:"Filename" /]

8. Click Add Version so that you can immediately test your changes.

4.9 Drag-and-Drop Functionality


The ability to use drag-and-drop functionality is now included with WebReports
and ActiveViews. The core drag-and-drop functionality is contained within a
WebReport reportview that can be called from another WebReport, enabling drag-
and-drop functionality for the parent container for the initiating WebReport.

Integrating drag-and-drop functionality into WebReports and ActiveView consist of


two main steps. The first step is to add a new tab for the user to click to switch into
drag-and-drop mode for the container, and the second step requires a viewable
WebReport that contains the drag-and-drop functionality. The running of these two
steps is straightforward, but varies slightly between WebReports and ActiveView.

Example 4-17: Step 1: The Core Drag-and-Drop Functionality Reportview

The first step of integrating drag-and-drop functionality in WebReports and


ActiveView is to create a WebReport using one of the core drag-and-drop

120 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.9. Drag-and-Drop Functionality

functionality example reportviews. There are two of these core drag-and-drop


functionality reportviews. They differ depending on whether the product is
WebReports or ActiveView.

Example 4-18: Step 2: Demonstration of Sample Code for WebReports to


Call the Core drag-and-drop Reportview

The following three blocks of code are an example of how to add the drag-and-
drop functionality to any WebReport. In this case, adding this code to a
browse-style WebReport provides a new tab at the top of the WebReport to
click and go to the drag-and-drop view.

Check that drag-and-drop has been specified:


[// Test to see if we have a drag and drop view set
[LL_WEBREPORT_IF "[LL_REPTAG_$D&DVIEW /]" <> "[LL_REPTAG_$undefined /]" /]
[LL_REPTAG_$D&DVIEW SETVAR:DRAGDROP /]
[LL_WEBREPORT_ELSE /]
[// No constant, just use a blank string
[LL_REPTAG_'' SETVAR:DRAGDROP /]
[LL_WEBREPORT_ENDIF /]

Add the javascript function to go to drag-and-drop when called:


[LL_WEBREPORT_IF "" <> "[LL_REPTAG_%DRAGDROP CURRENTVAL /]" /]
function goToDragAndDrop() {
document.location = '[LL_REPTAG_$D&DVIEW LLURL:DEFAULTHREF /]';
}
[LL_WEBREPORT_ENDIF /]

Add user interface to select drag-and-drop (in this case a tab):


[// Check to see if a Drag and Drop reportview has been specified
[LL_WEBREPORT_IF "" <> "[LL_REPTAG_%DRAGDROP CURRENTVAL /]" /]
<TD WIDTH="100%">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD class="selectedTab" NOWRAP ALIGN="RIGHT" VALIGN=TOP
BACKGROUND="[LL_REPTAG_SUPPORTDIR /]tab-active.gif"><NOBR><IMG
SRC="[LL_REPTAG_SUPPORTDIR /]tableftup-active-0.gif" ALT="" WIDTH="5" HEIGHT="31"
BORDER="0"></NOBR></TD>
<TD NOWRAP VALIGN="MIDDLE" NOWRAP class="selectedTab" WIDTH="80"
BACKGROUND="[LL_REPTAG_SUPPORTDIR /]tab-active.gif"><NOBR> Browse </NOBR></TD>
<TD class="selectedTab" NOWRAP ALIGN="RIGHT" VALIGN=TOP
BACKGROUND="[LL_REPTAG_SUPPORTDIR /]tab-active.gif"
BACKGROUND="[LL_REPTAG_SUPPORTDIR /]tab-inactive.gif"><NOBR><IMG
SRC="[LL_REPTAG_SUPPORTDIR /]tabrightup-active.gif" WIDTH="10" HEIGHT="31" BORDER="0"
ALT=""></NOBR></TD>
<TD class="unselectedTab" NOWRAP ALIGN="LEFT" VALIGN=TOP><NOBR><IMG
SRC="[LL_REPTAG_SUPPORTDIR /]tableftup-inactive.gif" ALT="" WIDTH="5" HEIGHT="31"
BORDER="0"></NOBR></TD>
<TD NOWRAP class="unselectedTab" WIDTH="80" BACKGROUND="[LL_REPTAG_SUPPORTDIR /]tab-
inactive.gif"><NOBR><A HREF="javascript:goToDragAndDrop();">Drag & Drop</A></NOBR></TD>
<TD class="unselectedTab" NOWRAP ALIGN="RIGHT" VALIGN=TOP
BACKGROUND="[LL_REPTAG_SUPPORTDIR /]tab-inactive.gif"><NOBR><IMG
SRC="[LL_REPTAG_SUPPORTDIR /]tabrightup-inactive.gif" WIDTH="10" HEIGHT="31"
BORDER="0" ALT=""></NOBR></TD>
<TD ALIGN="RIGHT" BACKGROUND="[LL_REPTAG_SUPPORTDIR /]tabrightline.gif" WIDTH="100%"></
TD>
</TR>

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 121


Chapter 4 WebReports Advanced Information

</TABLE>
</TD>
[LL_WEBREPORT_ENDIF /]

4.10 Export Using URLs


This section provides information about how to use a URL to export WebReport
output. Specifically, it provides details on how to use URL parameters to control
various export types. This is particularly useful for developments where you can
invoke WebReport exports from tailored web pages instead of the standard export
interface that is described in “Exporting the WebReport Output” on page 52. For
each export type, all of the available URL parameters are described along with an
example of usage.

Each export destination has a table with the following columns:

• Parameter Name: the name of the parameter as it would appear in the URL.
• Name in interface: the name of the field on the Export WebReport page. For
more information, see “Exporting the WebReport Output” on page 52.
• Mandatory: indicates whether the parameter is mandatory or not. An export will
fail if mandatory parameters are missing.
• Valid Values: these are the values that are supported for the specified parameter.

Note: When a value containing a space, or other special character, is


passed, it must be escaped appropriately for use in a URL.
• Replacement Tags: some parameters support WebReports replacement tags
being passed in the URL. This field indicates whether tag replacement is
supported for the parameter.

Note: When a replacement tag containing a space, or other special


character, is passed, it must be escaped appropriately for use in a URL.

4.10.1 Exporting to a Content Server Node - Parameters and


Example
Parameter support when exporting to a Content Server Node:

Parameter Name in Mandatory Valid Values Replacement


Name Interface Tags
objAction Yes RunReport No
export_ Output Yes livelink No
location Destination

122 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.10. Export Using URLs

Parameter Name in Mandatory Valid Values Replacement


Name Interface Tags
livelink_ Export Type Yes livelinknode No
node
newNode_ID Create In Yes Any valid Yes
Content Server
container ID.
nodeName Name Yes Any valid Yes
Content Server
node name.
mimetype Export Media No All values as No
Type shown in the
Export Media
Type field.
expcomment Description No Any valid Yes
Content Server
node
description.
nexturl Yes An escaped URL No
where the user
will go following
the export.

Example 4-19: Example of a URL invocation when exporting to a Content


Server Node:

?func=ll&objId=1234&objAction=RunReport&export_location=
livelink&livelink_node=livelinknode&newNode_ID=2000&nodeName=
%5BLL_REPTAG_DATE%20%2F%5D&mimetype=text%2Fplain&nexturl=...

In this example, WebReport 1234 exports to a new Content Server node with a
Media Type of text/plain. The resulting file is placed in the folder with an id
of 2000 and the folder name is the current date.

For information about exporting to Content Server node, see “Running a WebReport
and Exporting the Output to Content Server” on page 53.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 123


Chapter 4 WebReports Advanced Information

4.10.2 Exporting to a Content Server Version - Parameters and


Example
Parameter support when exporting to a Content Server Version:

Parameter Name in Mandatory Valid Values Replacement


Name Interface Tags
objAction Yes RunReport No
export_ Output Yes livelink No
location Destination
livelink_ Export Type Yes livelinkversion No
node
newVersion_ Add to Yes Any valid Yes
ID Content Server
document or
customview ID.
mimetype Export Media No All values as No
Type shown in the
Export Media
Type field.
expcomment Description No Any valid Yes
Content Server
node
description.
nexturl Yes An escaped URL No
where the user
will go following
the export.

Example 4-20: Example of a URL invocation when exporting to a Content


Server Version:

?func=ll&objId=1234&objAction=RunReport&export_location=
livelink&livelink_node=livelinkversion&newVersion_ID=5678&
mimetype=text%2Fplain&nexturl=...

In this example, WebReport 1234 adds a new Content Server document version
with a Media Type of text/plain to the document id 5678.

For information about exporting to a Content Server version, see “Running a


WebReport and Exporting the Output to Content Server” on page 53.

124 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.10. Export Using URLs

4.10.3 Exporting to the Desktop - Parameters and Example


Parameter support when exporting to the desktop:

Parameter Name in Mandatory Valid Values Replacement


Name Interface Tags
objAction Yes RunReport No
export_ Output Yes desktop No
location Destination
mimetype Export Media No All values as No
Type shown in the
Export Media
type field.

Example 4-21: Example of a URL invocation when exporting to the


Desktop:

?func=ll&objId=1234&objAction=RunReport&export_location=desktop&
mimetype=application%2Fvnd.ms-excel

In this example, WebReport 1234 exports to the desktop with a Media Type of
application/vnd.ms-excel.

For information about exporting to the Desktop, see “Running a WebReport and
Exporting the Output to a Desktop File” on page 55.

4.10.4 Exporting to Email - Parameters and Example


Parameter support when attaching results to email:

Parameter Name in Mandatory Valid Values Replacement


Name Interface Tags
objAction Yes RunReport No
export_ Output Yes email No
location Destination
emailAddress Email Address Yes Any valid email Yes
address.
Note:
Only one
is
mandatory
but you
can use
three, if
required.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 125


Chapter 4 WebReports Advanced Information

Parameter Name in Mandatory Valid Values Replacement


Name Interface Tags
newVersion_ Email Address Yes The object ID of Yes
ID a text file
Note: containing CSV Note:
Only one email addresses. Replaceme
is nt tags are
mandatory supported
but you to
can use determine
three, if the value
required. of
newVersi
on_ID,
which
must be a
text
document.
However,
the value
of
newVersi
on_ID can
also be
contained
within the
document
itself.
usergroup_ID Email Address Yes A Content Yes
Server user ID or
Note: group ID.
Only one
is
mandatory
but you
can use
three, if
required.
emailSubject Email Subject No Any text. Yes
mimetype Export Media No All values as No
Type shown in the
Export Media
Type field.
attachToEmai Attach Results to No yes or no No
l email
emailAttachm Attachment No Any valid file Yes
entName Name name.

126 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.10. Export Using URLs

Parameter Name in Mandatory Valid Values Replacement


Name Interface Tags
emailbody Email body text No Text to appear in Yes
the body of the
email.
nexturl Yes An escaped URL No
where the user
will go following
the export.

Example 4-22: Example of a URL invocation when exporting to E-Mail:

?func=ll&objId=1234&objAction=RunReport&export_location=email&
[email protected]&emailSubject=Status%20Report&
attachToEmail=on&emailbody=Please%20see%20attached&mimetype=
application%2Fvnd.ms-excel&nexturl=...

In this example, WebReport 1234 sends an email to [email protected]


with the subject “Status Report”. The report is attached to the email in Excel
format with a default name because emailAttachmentName is not specified.
The email body has the text “Please see attached”.

For information about exporting to email, see “Running a WebReport and Exporting
the Output to Email” on page 55.

4.10.5 Exporting to a Form - Parameters and Example


Parameter support when exporting to a Form:

Parameter Name in Mandatory Valid Values Replacement


Name Interface Tags
objection Yes RunReport No
export_ Output Yes form No
location Destination
form_ID Populate Form Yes A valid Content Yes
Server Form ID.
Not the template
ID.
appendForm Append Results Yes overwrite, No
append, update
nexturl Yes An escaped URL No
where the user
will go following
the export.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 127


Chapter 4 WebReports Advanced Information

Example 4-23: Example of a URL invocation when exporting to a Form:

?func=ll&objId=1234&objAction=RunReport&export_location=form&
form_ID=5678&appendForm=overwrite&nexturl=...

In this example, WebReport 1234 deletes the contents of Form 5678 and
populates it with data specified in the SETFORM field of the WebReport.

For information about setting a Form output destination, see “Setting a Form Output
Destination” on page 44.

4.10.6 Exporting to the Server - Parameters and Example


Parameter support when exporting to the server:

Parameter Name in Mandatory Valid Values Replacement


Name Interface Tags
objAction Yes RunReport No
export_ Output Yes server No
location Destination
serverFilePa Server File Path Yes A valid file path Yes
th on the server.
mimetype Export Media No All values as Yes
Type shown in the
Export Media
Type field.
nexturl Yes An escaped URL No
where the user
will go following
the Export.

Example 4-24: Example of a URL invocation when exporting to the Server:

?func=ll&objId=1234&objAction=RunReport&export_location=server&
serverFilePath=C:\export_testing\test_export.xml&nexturl=...

In this example, WebReport 1234 adds a new file to the Content Server file
system. This new file is exported to: C:\export_testing\test_export.xml.

For more information, see “Running a WebReport and Exporting the Output to a
Server File” on page 57.

128 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.10. Export Using URLs

4.10.7 Exporting to a Workflow - Parameters and Example


Parameter support when exporting to a Workflow:

Parameter Name in Mandatory Valid Values Replacement


Name Interface Tags
objAction Yes RunReport No
export_ Output Yes Workflow No
location Destination
workflow_id Initiate Map Yes A valid Yes
Workflow Map
ID.
attach Attach Output to No yes or no No
Workflow
nodeName Attachment Yes The name of the Yes
Name report to be
Note: This attached.
is only
mandatory
if you are
attaching
the report
data to the
Workflow.
workflow_ Workflow Title Yes Text to appear in Yes
title the title of the
Workflow
instance.
workflow_ Workflow No Text to appear in Yes
description Description the Workflow
description field.
mimetype Attachment no All values as No
Media Type shown in the
Export Media
Type field.
duedate Workflow Due no Due_on, Due_in, No
no_due
DueOn Due on No For example, D/ No
2014/1/15.
Workflow_ Due in No Integer No
duein representing a
number of days.
Expcomment Attachment No Any valid Yes
Description description text
for the
attachment.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 129


Chapter 4 WebReports Advanced Information

Parameter Name in Mandatory Valid Values Replacement


Name Interface Tags
nexturl Yes An escaped URL No
where the user
will go following
the export.

Example 4-25: Example of a URL invocation when exporting to a


Workflow:

?func=ll&objId=1234&objAction=RunReport&export_location=
workflow&workflow_ID=5678&attach=on&nodeName=report%20data&
mimetype=text/html&workflow_title=my%20new%20workflow&nexturl=...

In this example, WebReport 1234 initiates an instance of a Workflow map 5678


and sets the title to my new workflow. The report itself is attached to the
Workflow with a name of report data and a Media Type of text/html.

For information about setting a workflow output destination, see “Setting a


Workflow Output Destination” on page 51.

4.11 WR Power View


WR Power View is an option available in form templates that allows developers of
WebForms to quickly leverage WebReports’ unique ability to look up and
manipulate data from different sources but in the context of a form.

WR Power View Technical Notes


A WR Power View is designed to combine WebForms processing features along
with WebReports tag processing. It is designed to allow either of the following:

• To allow WebForms tags to provide text that can be used in WebReports tags or
sub-tags.
• To allow WebReports tags to return text that might affect WebForms tags.

To achieve these aims, a WR Power View is processed in the following order:

1. The WebReports processing engine parses the WebForm tags. This involves any
WebForms tag that can be substituted, for example [LL_FormTag_1_1_2_1 /].
This parsing will not resolve any WebForms LOOP sections and will not resolve
any tags that are dependent on the LOOP structure. This parsing also does not
manage any HTML changes, such as insertion of SELECTED for the correct item
in a SELECT statement.
2. The WebReports processing engine performs a parse, and all normal
WebReports tag substitution is completed.

130 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.11. WR Power View

3. The WebReports processing engine performs a parse again to resolve any form
tags that remain or that might have been created as a result of the first
processing.

A specialized content control tag called FORMPARSEOFF has been provided for certain
situations where the standard WebForms processing is not desirable. Because
WebForms attempts to interpret some form fields, for example SELECT fields, any
changes to these fields, or the addition of fields that are not in an expected format,
may cause the WebForms code to break or malfunction.

In these cases, a developer can use the FORMPARSEOFF content control tag to disable
the standard WebForms processing. When standard WebForms processing is
disabled, any WebForms tags are processed using the “simple parsing” provided by
WebReports.

Note: In addition to ignoring all HTML syntax, this simple parsing does not
handle any WebForms looping structures. Another benefit of using the
FORMPARSEOFF tag is that it typically improves performance for rendering a
WR Power View. For more information about the FORMPARSEOFF content
control tag, see the Dynamic Tag Guide. For information about how to access the
Dynamic Tag Guide, see “To Access the Dynamic Tag Guide” on page 77.

4.11.1 Creating Forms with WR Power View


Forms developers are presented with the option to add a WR Power View to a form
template in addition to the traditional HTML view. This new form view behaves in a
similar way to an HTML view with some useful additions:

• Native support for existing form tags like [LL_FormTag_1_1_2_1 /] and [LL_
FUNC /] meaning that Power Views are backwards compatible with HTML
views. To leverage this capability, download the latest version of your form view
and add it as a reportview version to a new WebReport added from the WR
Power View option.
• Full support for WebReports static tags, constants, and parameters, which you
can use together with form tags.
• Call an unlimited number of WebReports, through sub-WebReport calls, inside
the view enabling dynamic population of lookup fields from data sources both
inside and outside Content Server.
• Select a WR Power View for a Workflow form and use WebReports parameter
tags, [LL_REPTAG_& /], to access information about the executing Workflow. For
example, workid, subworkid, taskid, mapid, then use these to look up more
information specific to the current step, user or Workflow instance.
• Use dummy forms to run reports inside a Workflow.

To make immediate use of these features, do one or more of the following:

• From the form template Functions menu, select Export as HTML, then save the
file to your desktop.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 131


Chapter 4 WebReports Advanced Information

• From the form template Functions menu, select Properties > Views. On the
Views tab of the form template, click Add View, then select WR Power View.
• When selecting the reportview, browse for the file saved to your desktop in the
first step.
• Open the WebReports tag guide and use any of tags inside your form view.

Note: The WebForms module must be installed for this feature to work.

4.12 Initiate WebReport Form Submission Mechanism


WebReports provides an Initiate WebReport form submission mechanism that is
similar to SQL Table. It differs in how the data is stored in the SQL table: the
primary key, or SEQ, is identified and passed to a WebReport, which is initiated
immediately after the form submission. The data stored in each method is
interchangeable. For example, you can change the form submission mechanism
between Initiate WebReport and SQL Table without affecting the existing data.

The Initiate WebReport mechanism requires two configuration options, which are
set on the Specific tab of the form:

• The WebReport that is to run immediately following form submission.


• You will see a check box to choose whether to transparently run the WebReport
or present it to the user after form submission.

In each case the SEQ from the form just submitted is available as a parameter [LL_
REPTAG_&SEQ /]. Use this in the WebReport as a key to look up additional data
associated with the form just submitted or pass it as a parameter to a separate sub-
WebReport that has its destination set to Populate Form. This allows basic relational
tables to be maintained through a series of WebReports because the act of using a
WebReport to export data to a form triggers a further WebReport to initiate if the
submission mechanism is set appropriately.

The Initiate WebReport form submission mechanism is not visible until the Manage
Relational Table option has been used to configure an associated SQL table.

Form tags of the type [LL_FormTag_1_1_3_1 /] are supported only when “Show
WebReport” is not selected. If needing to display data just submitted with Show
LiveReport selected then the tag [LL_REPTAG_&SEQ /] must be used as a parameter
to a sub-WebReport or LiveReport to retrieve the submitted data.

132 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.13. INI Preferences

4.13 INI Preferences


In a WebReport, you can use the standard constant tag syntax to reference settings
from the opentext.ini file. This feature is subject to the following limitations:

• You can only reference items contained under the [WebReports] section of the
opentext.ini file.

• You cannot reference some standard options. This is a development decision


based on potential security issues. If in doubt, try to reference a particular setting
as defined in the following content. If the setting has been blocked an undefined
constant error message will appear.
• If you have defined a constant for a WebReport with the same name as a
preference, the constant takes precedence.

The most common application of this feature is to define unique preferences that are
only used with this feature, for example, preferences that do not yet exist in the
[WebReports] section. This results in a system-level (server-level) setting that can be
referenced by all WebReports. Because the opentext.ini file can vary from server
to server, this feature also allows WebReports to use logic based on a particular
server. Here are a few examples of how this feature may be used:

• Define system level messages, titles, or labels.


• Define file paths or URLs. This effectively creates a globally-available (system-
wide) constant.
• Define parameters that identify a particular instance of Content Server. For
example, “SERVERTYPE=SECURE”. In this way, logic can be added to
WebReports to control their behavior according to the instance of Content Server
from which they are being run.

For more information about how to use the constant tag syntax, see “Procedures
Defining How to Use Constants” on page 67.

4.14 Inserting JSON Data


JavaScript Object Notation (JSON) represents an efficient way of specifying data to
be sent from servers to browser-based client applications. The syntax used to create
a JSON data set is not important as long as the server software builds it correctly.
The main benefit of this feature is that it minimizes bandwidth and overhead
between the server and client. JSON allows an object to be encapsulated in a way
that can be understood by humans and swiftly parsed by software applications. It is
particularly well-suited to the exchange of data between clients and servers using
AJAX-type technology. Since Livelink 9.7.1, JSON aids in sending container browse-
related data through AJAX calls.

To support this technology, WebReports allows much of the data typically retrieved
using individual WebReports tags, to be delivered as a JSON structure.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 133


Chapter 4 WebReports Advanced Information

For more information about JSON, see the many different references available,
including RFC 4627, which defines the JSON standard. For example: www.json.org
(http://www.json.org).

4.14.1 Basic JSON Structure


For Content Server purposes, the JSON structure typically looks something like this:

{"field1":123, "field2":"some text", "myRows":[{row1 fields}, {row2


fields},etc.]}

In other words, there are various fields at the top level of the object, followed by an
optional array called myRows that contains all of the rows of data for a WebReport
data source or the contents of a container for ActiveViews. As described in the
following sections, some directives allow you to use WebReports tag syntax to add
fields to the top level of the JSON structure, outside of the myRows array.
Additionally, based on WebReports tag syntax, you can add fields or columns to
each row in the myRows array. In this way, data that is returned in individual
WebReports tags to the client can be returned in a JSON structure to be used in any
way the client requires, usually in a web browser, converted to a JavaScript array.

4.14.2 INSERTJSON Tag Syntax and Options


The main syntax for this tag is as follows:
[LL_WEBREPORT_INSERTJSON /]

You can only use this tag in the Header or Footer of the reportview. Unlike the
INSERTJSARRAY content control tag, when you use this tag, the row section is
processed as usual. You cannot use INSERTJSON in the row section because it returns
all data rows outside of the row section.

INSERTJSON supports multiple “directives” that control what type of data the tag
returns. Each directive is preceded by an “at” sign, “@”. This differs from other
content control tags but allows for a very flexible feature set. The supported
directives include the following:

@BROWSECOLUMNS
Syntax @BROWSECOLUMNS

Description This directive is only supported in Livelink version 9.7.1 and later. It does not
require any additional information. It enables the INSERTJSON tag to return a data
set identical to that typically used in Content Server container browsing. This is
useful when emulating Content Server folder views, particularly in Livelink 9.7.1.

Notes

• The rows of data that are returned are filtered based on any WebReports
conditional row tags. For example, INCLUDEIF, EXITIF, and INCLUDERANGE.

134 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.14. Inserting JSON Data

• This directive and the “@ALLDATASOURCE” on page 135 directive are


mutually exclusive.
• When you use this directive with a WebReport, the items returned by the
data source must be valid Content Server items that would typically exist in
a Content Server container. For example, if the data source is not returning
Dtree data, an error message is generated. Similarly, if the data source
returns an item like a Volume, this would also cause an error message
because this item would not typically appear in a folder.

@ALLDATASOURCE
Syntax @ALLDATASOURCE

Description This directive does not require any additional information. It enables the
INSERTJSON tag to return all information from the data source in one declaration.
Besides creating an array with all rows and columns, this directive also provides
some standard fields to support the data source. These fields are: sourceID,
actualRows, filteredRows, totalRows, and totalSourceRows.

Notes

• Currently the filteredRows field is only populated with a valid number if


the FILTEREDROWS tag is included in the WebReport. If this tag is not
required, such as when only the INSERTJSON output is being used, then you
should comment out [LL_REPTAG_FILTEREDROWS /].
• This directive and the “@NODESTABLEFIELDS” on page 145 directive are
mutually exclusive.
• This directive and the “@BROWSECOLUMNS” on page 134 directive are
mutually exclusive.

Related See the corresponding report tag syntax: SOURCEID, ACTUALROWS, FILTEREDROWS ,
Information TOTALROWS, and TOTALSOURCEROWS in the Dynamic Tag Guide. For information about
how to access the Dynamic Tag Guide, see “To Access the Dynamic Tag Guide”
on page 77.

See the “Example Using a Simplified Data Source” on page 150.

@ALLSTATIC
Syntax @ALLSTATIC

Description This directive returns a single structure that contains all static tag values that would
typically be returned in individual WebReports tags. The name of each field is
identical to the name used in the corresponding static tag.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 135


Chapter 4 WebReports Advanced Information

@ROWCOLUMNS
Syntax @ROWCOLUMNS:<columns>

Description This directive is followed by multiple fields that specify additional columns to be
added to each row being returned from the data source or browse columns. Each
field can be either the name of a column or a WebReports tag and sub-tags. These
columns are typically added to existing columns built by the
“@ALLDATASOURCE” on page 135 directive or the “@BROWSECOLUMNS”
on page 134 directive. However, if you use neither of these directives, an array called
myRows is added to the resulting JSON structure containing only the columns that
have been specified in this @ROWCOLUMNS directive for each row in the data source.
Each column uses the following format: <JSON field name>:"<data reference>"

The data reference is either a simple column name from the data source or a
WebReports tag and sub-tag combination.

Examples

• This first example would force a column called “newColumn” to be added to the
myRows array for each row of data returned:
@ROWCOLUMNS newColumn:"[LL_REPTAG=DATAID CAT:price:amount1:display /]"

The tag syntax would be resolved for each row, in this case looking up a
Category/attribute value.
• In the second example, a new column field called Column2 is added to the
myRows array, using whatever data is returned by the modifyDate column in
the data source:
@ROWCOLUMNS Column2:"modifyDate"

Related See the “Example Using a Simplified Data Source” on page 150.
Information
@EXCLUSIVE PARM
Syntax @EXCLUSIVE PARM:<parm name>

Description This directive provides a mode where only the data produced by the INSERTJSON
tag is returned. In this mode, all other WebReports output is omitted; however, the
reportview is still processed to ensure that any variable processing still takes place.
This mode is controlled by the presence or absence of a parameter in the URL. This
parameter is specified using the PARM: option. For example, PARM:jsononly
specifies that if &jsononly is found in the URL, then only JSON data is returned.
This parameter defaults to true. Therefore, if you include it in the URL, or set it to
true (&jsononly=true), then exclusive mode is used. Conversely, if you omit the
parameter or set it to false (&jsononly=false), then normal mode is used.

Note: In normal mode, the JSON data is still included in the output of the
WebReport.

136 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.14. Inserting JSON Data

@FIELDS
Syntax @FIELDS

Description This directive is followed by multiple quoted fields that specify a name and value
for fields to be returned by the INSERTJSON tag. The fields use the following syntax:
<fieldname>:"<fieldvalue>"

The field value could be a literal value, but it is typically a WebReports tag. For
example, USERID:"[LL_REPTAG_USERID /]"

In addition to any existing fields for other directives, any fields specified by this
directive are added to the beginning of the existing JSON structure. These fields are
not added to the myRows array, only to the top-level object.

Related See the “Example Using a Simplified Data Source” on page 150.
Information
@ADDJSVAR VAR
Syntax @ADDJSVAR VAR:<var name>

Description This directive adds the JavaScript variable and associated syntax to assign the
returned JSON to a variable specified in <var name>.

Example For example, @ADDJSVAR VAR:temp would add the following to the beginning of the
JSON data: var temp = "json data object"

Related See the “Example Using a Simplified Data Source” on page 150.
Information
@ESCAPETEXT TYPE
Syntax @ESCAPETEXT TYPE:<escape type>

Description This directive allows the default text escaping to be modified for any text/string
fields being used in the INSERTJSON tag. Valid escape types include standard and
escapeurl.

The standard type uses the standard JSON specification for text escaping.

The escapeurl type uses URL encoding that you need to decode using the JavaScript
decodeURI() function.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 137


Chapter 4 WebReports Advanced Information

@FILTEREDCOUNT
Syntax @FILTEREDCOUNT

Description This directive is followed by multiple fields that specify options for the resulting
JSON data structure. The fields use the following syntax:
<fieldname>:"<fieldvalue>"

The field values include the following:

ACTIVECOLU • Description: The name of the Active Column used to group the data.
MN:<Active This tag looks at all the distinct values in the specified column and
Column> groups them into counts. This option is only required if either
GROUPBY or GROUPBYDATASOURCE is set to TRUE.
• Mandatory: TRUE (Only when GROUBY is also set to TRUE)
• Data Type: String

Tips
• When using Content Server Category data source, any attribute
names which contain spaces will be replaced with underscores
for the column names. For example, an attribute called
“Document Type” would have the column name of Document_
Type.
• If you are using a case-sensitive database and you have
GROUPBYINDATASOURCE set to TRUE, this value must also
be in the correct case.

138 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.14. Inserting JSON Data

FILTERBY:<Filt • Description: This option allows filters to be applied to the data in the
ers> data source before it is grouped and sorted. This works in a similar
way to INCLUDEIF and the FILTER sub-tag but allows multiple filters
to be defined in one JSON structure. This option will work whether
GROUPBY is set to TRUE or FALSE.
• Mandatory: FALSE
• Data Type: Array of JSON Objects
• Usage Examples:
– This will return all rows in the data source where the value in the
DocType column equals "Contract":
[{ "column":"DocType" , "operator":"==", "value":"Contract"}]

– This will return all rows in the data source where the value in the
DocType column is NOT equal to "Contract":
[{ "column":"DocType" , "operator":"!=", "value":"Contract"}]

– This will return all rows in the data source where the value in the
DocType column equals "Contract" AND the value in the
Status column equals "Final":
[{ "column":"DocType" , "operator":"==", "value":"Contract"},
{ "column":"Status" , "operator":"==", "value":"Final"}]

– This will return all rows in the data source where the value in the
DocType column equals "SOP" OR "Contract":
[{ "column":"DocType" , "operator":"IN", "value":["SOP","Contract"]}]

– This will return all rows in the data source where the value in the
DocType column is NOT equal to "SOP" OR "Contract":
[{ "column":"DocType" , "operator":"NOTIN", "value":["SOP","Contract"]}]

– This will return all rows in the data source where the value in the
Version column is less than 5:
[{ "column":"Version" , "operator":"<", "value":5}]

– This will return all rows in the data source where the value in the
Version column is less than or equal to 5:
[{ "column":"Version" , "operator":"<=", "value":5}]

– This will return all rows in the data source where the value in the
Version column is greater than 5:
[{ "column":"Version" , "operator":">", "value":5}]

– This will return all rows in the data source where the value in the
Version column is greater than or equal to 5:
[{ "column":"Version" , "operator":">=", "value":5}]

– This will return all rows in the data source where the value in the
DocType column contains the string "Con":
[{ "column":"DocType" , "operator":"CONTAINS", "value":"Con"}]

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 139


Chapter 4 WebReports Advanced Information

Tips
• For more information about how the operators work, see
“Logical Expressions” on page 161.
• For more information about the FILTER sub-tag and the
INCLUDEIF content control tag, see the Dynamic Tag Guide. For
information about how to access the Dynamic Tag Guide, see “To
Access the Dynamic Tag Guide” on page 77.
FORMATCOL • Description: Allows a formatted value to be returned for the Active
UMNNAMES:< Column name.
ColumnName1 • Mandatory: FALSE
>:”
[LL_REPTAG_< • Data Type: String.
DATA-TAG> • Usage Example: This option supports both hard-coded labels and
<SUB-TAG WebReports tags. The example would return formatted values in the
CHAIN> /]”:<C response columns array. The “Status” data source column name would
olumnName2>: be returned as “Document Status”. The “Type” data source column
”<NewColumn name would be converted to the localized string representing the
Name2>” English word “Type” for the current user.
FORMATCOLUMNNAMES: Status:"Document
Status":Type:"[LL_REPTAG_'WEBNODE_HTMLLABEL.Type' XLATE /]"

140 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.14. Inserting JSON Data

FORMATCOL • Description: Returns a formatted value for each grouped value in the
UMNS:<Colum returned Active Column.
nName1>:” • Mandatory: FALSE
[LL_REPTAG=<
ColumnName1 • Data Type: String. Using [LL_REPTAG=<ColumnName> syntax.
> <SUB-TAG • Usage Examples:
CHAIN> /]”:<C
– Returns a formatted value in the response data array. It will
olumnName2>:
convert each “0” value in the SubType data source column to the

localized string representing the English word “Folder” and it will
[LL_REPTAG=<
convert each “144” value in the SubType data source column to the
ColumnName2
localized string representing the English word “Document”.
> <SUB-TAG
CHAIN> /]” FORMATCOLUMNS:SubType:"[LL_REPTAG=SubType DECODE:0:
[LL_REPTAG_'LLAPI_LLNODEMISC.Folder' XLATE /]:144:
[LL_REPTAG_'LLAPI_LLNODEMISC.Document' XLATE /]:'' /]"

For more information about the sub-tags used in this example, see
DECODE and XLATE in the Dynamic Tag Guide. For information
about how to access the Dynamic Tag Guide, see “To Access the
Dynamic Tag Guide” on page 77.
– Returns a formatted value in the response data array. For each
valid Subtype integer in the SubType data source column the
value would be converted to a localized string representing the
Subtype label value. For more information about the sub-tag used
in this example, see LABEL in the Dynamic Tag Guide. For
information about how to access the Dynamic Tag Guide, see “To
Access the Dynamic Tag Guide” on page 77.
FORMATCOLUMNS:SubType:"[LL_REPTAG=SubType LABEL:SUBTYPE /]"

– This would return a formatted value in the response data array. For
each valid UserID integer in the “PerformerID” data source column
the value would be converted to the user's full name. For more
information about user information, see the USERINFO sub-tag in
the Dynamic Tag Guide. For information about how to access the
Dynamic Tag Guide, see “To Access the Dynamic Tag Guide”
on page 77.
FORMATCOLUMNS:PerformerID:"[LL_REPTAG=PerformerID USERINFO:FULLNAME /]"

Note: Since this option only formats grouped values, it only


takes effect if GROUPBY is set to TRUE. For more information
about the GROUPBY sub-tag, see the Dynamic Tag Guide. For
information about how to access the Dynamic Tag Guide, see
“To Access the Dynamic Tag Guide” on page 77.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 141


Chapter 4 WebReports Advanced Information

GROUPBY:<Gr • Description: Specifies that the WebReport will group the data using
oup By> the Active Column. If GROUPBY is set to TRUE and
GROUPBYDATASOURCE is set to FALSE or not set, the WebReport
will group the data using the Active Column.
• Mandatory: FALSE
• Data Type: Boolean
• Usage Example:
GROUPBY:TRUE

GROUPBYIND • Description: Specifies that the data in the data source should be
ATASOURCE:< grouped by the Active Column. If this flag is set to TRUE, then the data
Grouped In source will be grouping the data.
Data Source> • Mandatory: FALSE
• Data Type: Boolean
• Usage Example:
GROUPBYINDATASOURCE:TRUE

Tip: If this is set to TRUE, then GROUPBY:TRUE is implied and


GROUPBY does not need to be explicitly set to TRUE.
GROUPAFTER • Description: Defines a number of distinct values after which grouped
:<Group After> counts will be labeled as “Other”. For instance, if the Active Column
has 10 distinct values and GROUPAFTER is set to 6, the 4 lowest counts
will be aggregated and returned as “Other”.
• Mandatory: FALSE
• Data Type: Integer
• Usage Example:
GROUPAFTER:6

SORTCOL:<So • Description: Specifies the column to sort by after the filtering and
rt Column> grouping has been performed. This can either be the Active Column or
the Count Column.
• Mandatory: TRUE (Only mandatory when either GROUPBY or
GROUPBYDATASOURCE, or both, are set to TRUE.)
• Data Type: String
• Usage Examples:
– Sort by active column:
SORTCOL:"DocType"
– Sort by count column:
SORTCOL:"Count"

142 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.14. Inserting JSON Data

SORTDIR<Sort • Description: Specifies the sort direction to be used with the ???
Direction> on page 142value. Valid values are 'ASC' (Ascending) and 'DESC'
(Descending).
• Mandatory: TRUE (Only mandatory when GROUPBY or
GROUPBYDATASOURCE is set to TRUE.)
• Data Type: String
• Usage Examples:
– Sort by descending:
SORTDIR:"DESC"
– Sort by ascending:
SORTDIR:"ASC"

INCLUDECOL • Description: Specifies a list of columns that you want to include. If


UMNS:<Colum GROUPBY and GROUPBYDATASOURCE are each set to FALSE, then only
ns to Include> these columns will be returned. If either GROUPBY or
GROUPBYDATASOURCE is set to TRUE, then this list defines the
columns that the client can use to group and filter.
• Mandatory: FALSE
• Data Type: Supports both OScript List and JSON array data types.
• Usage Examples:
– An OScript example:
INCLUDECOLUMNS:"{'Reviewer','DocType'}"

– A JSON example:
INCLUDECOLUMNS:'["Reviewer","DocType"]'

EXCLUDECOL • Description: Specifies a list of columns that you want to exclude. If


UMNS:<Colum GROUPBY and GROUPBYDATASOURCE are each set to FALSE, then
ns to Exclude> all but these columns will be returned. If both GROUPBY or
GROUPBYDATASOURCE is set to TRUE, then this list defines the
columns that the client can use to group and filter.
• Mandatory: FALSE
• Data Type: Supports both OScript List and JSON array data types.
• Usage Examples:
– An OScript example:
EXCLUDECOLUMNS:"{'DataID','ParentID'}"

– A JSON example:
EXCLUDECOLUMNS:'["DataID","ParentID"]'

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 143


Chapter 4 WebReports Advanced Information

COUNTCOLU • Description: Specifies the name of the count column in the data
MN:<Name of source. Default is "Count".
Count • Mandatory: TRUE Only when GROUPBYDATASOURCE is set to
Column> TRUE and the Count column in the data source is NOT named
“Count”.
• Data Type: String
• Usage Examples:
– This example supports the ability to modify the values in the
Active Column using WebReports tags.
COUNTCOLUMN:"NumItems"
– This next example will divide all values in the DocType column by
100. It will also divide the total count value by 100.
COUNTCOLUMN:"Count":"DIVIDE:100".

COUNTFORM • Description: Returns a formatting string to the client to specify how to


AT:<Format of render the grouped count values. Default is "none". This directive
Count Values> supports the following values for use with the Visual Data Filtered
Count Smart UI widget:
– "none"
– "si"
– "bytes"
• Mandatory: FALSE
• Data Type: String
• Usage Examples:
For example, for a count value of 69877015, the following outputs
would appear:
– Example using “none”:
COUNTFORMAT:"none" Output: 69877015
– Example using “si”:
COUNTFORMAT:"si" Output: 69.9M
– Example using “bytes”:
COUNTFORMAT:"bytes" Output: 66.6MB

Related For more information about the definition of the JSON structure of the response, see
Information “@FILTEREDCOUNT Response Structure Definition Example” on page 151.

144 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.14. Inserting JSON Data

@NODESTABLEFIELDS
Syntax @NODESTABLEFIELDS

Description This directive is only supported in Content Server 16 and later. It does not require
any additional information and it enables the INSERTJSON tag to return a data set
similar to that typically used in the Content Server 16 Smart View UI container
browsing. This is primarily used for the Nodes List widget to generate the expanded
table view when using the “Nodes List WebReport Widget - Report JSON” default
reportview.

Notes

• The rows of data returned are filtered based on any WebReports conditional
row tags. For example, INCLUDEIF, EXITIF, and INCLUDERANGE.
• This directive and the “@ALLDATASOURCE” on page 135 directive are
mutually exclusive.
• When you use this directive with a WebReport, the items returned by the
data source must be valid Content Server items that would usually exist in a
Content Server container. There must also be a column called DataID and
each value must reference a valid node ID. If the data source is not returning
DTree/DTreeCore data, an error message is generated. If you query the
DTreeCore database table, you must ensure that deleted nodes are not in the
data source. Do this by only including records that have a value of 0 in the
Deleted column.

• The MIME type on the WebReport Destination tab must be set to


application/json when using this option so that the REST API sets the
response type correctly.
• This directive returns JSON data which is compliant with the Content Server
REST API and does not follow the standard JSON schema defined for other
INSERTJSON options.
This means that HTTP status codes are used to signify whether the run has
been successful or not. A successful run returns a 200 status code along with
the JSON data representing the nodes in the data source. Similarly, error
messages return the appropriate HTTP response code along with an error
message. For instance, if you run a WebReport which uses this directive
where no data source is defined you will receive the following response:
HTTP Status Code: 500
Response Type: application/json
Response Content:
{
"error": "No output returned from WebReport.",
"errorDetail": "Error in INSERTJSON tag, the NODESTABLEFIELDS directive was
specified but there is no data source for this WebReport."
}

Related If you are using this directive for purposes other than generating data to populate
Information the Nodes List widget and want details on the definition of the JSON structure of the

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 145


Chapter 4 WebReports Advanced Information

response, see “@NODESTABLEFIELDS Response Structure Definition Example”


on page 153.

@TABLEREPORT
Syntax @TABLEREPORT

Description Returns data in the correct format to be consumed by the WebReports Smart UI
Table Report components. This allows you to render data in a table format in the
Smart UI. This directive is followed by multiple fields that specify options for the
resulting JSON data structure. The fields use the following syntax:
<fieldname>:"<fieldvalue>"

The field values include the following:

COLLECTION • Description: Specifies where the collection processing is being


PROCESSING: performed. Collection processing refers to the paging/sorting/filtering
<Collection for the data, and can be one “webreport” or “datasource”.
Processing> • Mandatory: FALSE
• Data Type: String.
• Usage Examples:
– If “webreport” is specified then all the data from the data source
will be returned to Content Server and collection processing will be
performed by the WebReports engine. For more information, see
“Table Report Widget - Data Processing in WebReport JSON”.
COLLECTIONPROCESSING:"webreport"
– If “datasource” is specified then collection processing will be
performed by the WebReports data source. Not all data sources are
supported for this option. For more information, see “Table Report
Widget - Data Processing in Data Source JSON”.
COLLECTIONPROCESSING:"datasource"

INCLUDECOL • Description: Specifies a list of columns that you want to include.


UMNS:<Colum
• Mandatory: FALSE
ns to Include>
• Data Type: Supports both OScript List and JSON Array data types.
• Usage Examples:
– An OScript example:
INCLUDECOLUMNS:"{'Reviewer','DocType'}"

– A JSON example:
INCLUDECOLUMNS:'["Reviewer","DocType"]'

146 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.14. Inserting JSON Data

INCLUDEHID • Description: Specifies a list of columns that you want to include in the
DENCOLUMN data returned to the client for each data row. The column will not be
S:<Hidden included in the columns array in the response.
Columns to • Mandatory: FALSE
Include>
• Data Type: Supports both OScript List and JSON array data types.
• Usage Examples:
– An OScript example:
INCLUDEHIDDENCOLUMNS:"{'DataID','ParentID'}"

– A JSON example:
INCLUDEHIDDENCOLUMNS:'["DataID","ParentID"]'

EXCLUDECOL • Description: Specifies a list of columns that you want to exclude.


UMNS:<Colum
• Mandatory: FALSE
ns to Exclude>
• Data Type: Supports both OScript List and JSON array data types.
• Usage Examples:
– An OScript example:
EXCLUDECOLUMNS:"{'DataID','ParentID'}"

– A JSON example:
EXCLUDECOLUMNS:'["DataID","ParentID"]'

SORTABLECO • Description: Specifies a list of columns for which you want to enable
LUMNS:<Colu sorting.
mns to Make • Mandatory: FALSE. By default all data source columns will be
Sortable> sortable.

Note: When using the FORMATCOLUMNS option with


COLLECTIONPROCESSING:"datasource", columns will be
automatically disabled and cannot be enabled.
• Data Type: Supports both OScript List and JSON array data types.
• Usage Examples:
– An OScript example:
SORTABLECOLUMNS:"{'Reviewer','DocType'}"

– A JSON example:
SORTABLECOLUMNS:'["Reviewer","DocType"]'

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 147


Chapter 4 WebReports Advanced Information

UNSORTABLE • Description: Specifies a list of columns for which you want to disable
COLUMNS:<C sorting.
olumns to • Mandatory: FALSE. By default all data source columns will be
Disable Sorting sortable.
For>
Note: When using the FORMATCOLUMNS option with
COLLECTIONPROCESSING:"datasource", columns will be
automatically disabled and cannot be enabled.
• Data Type: Supports both OScript List and JSON array data types.
• Usage Examples:
– An OScript example:
UNSORTABLECOLUMNS:"{'DataID','ParentID'}"

– A JSON example:
UNSORTABLECOLUMNS:'["DataID","ParentID"]'

FORMATCOL • Description: Shows a formatted label for each data source column
UMNNAMES:< name.
ColumnName1
>: • Mandatory: FALSE.
“[LL_REPTAG=
• Data Type: String.
<ColumnName
1> <SUB-TAG • Usage Example:
CHAIN> /]”:<C
olumnName2>: This example supports hard-coded strings and tags. The XLATE sub-
“[LL_REPTAG= tag can be used here to support localized column labels.
<ColumnName FORMATCOLUMNNAMES:Status:"Document
2> <SUB-TAG Status":Type:"[LL_REPTAG_'WEBNODE_HTMLLABEL.Type' XLATE /]"
CHAIN> /]”

148 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.14. Inserting JSON Data

FORMATCOL • Description: Returns a formatted value for each value in the specified
UMNS:<Colum table column.
nName1>: • Mandatory: FALSE.
“[LL_REPTAG=
<ColumnName • Data Type: String. Using [LL_REPTAG=<ColumnName> syntax.
1> <SUB-TAG • Usage Examples:
CHAIN> /]”:<C
– This first example returns a formatted value in the response data
olumnName2>: array. It will convert each “0” value in the SubType data source
“[LL_REPTAG= column to the localized string representing the English word
<ColumnName “Folder” and it will convert each “144” value in the SubType data
2> <SUB-TAG source column to the localized string representing the English word
CHAIN> /]” “Document”. For more information about the sub-tags used in this
example, see DECODE and XLATE in the Dynamic Tag Guide. For
information about how to access the Dynamic Tag Guide, see “To
Access the Dynamic Tag Guide” on page 77.
FORMATCOLUMNS:SubType:"[LL_REPTAG=SubType DECODE:0:
[LL_REPTAG_'LLAPI_LLNODEMISC.Folder' XLATE /]:144:
[LL_REPTAG_'LLAPI_LLNODEMISC.Document' XLATE /]:'' /]"

– The second example returns a formatted value in the response data


array. For each valid Subtype integer in the SubType data source
column, the value would be converted to a localized string
representing the Subtype label value. For more information about
the sub-tag used in this example, see LABEL in the Dynamic Tag
Guide. For information about how to access the Dynamic Tag Guide,
see “To Access the Dynamic Tag Guide” on page 77.
FORMATCOLUMNS:SubType:"[LL_REPTAG=SubType LABEL:SUBTYPE /]"

– This final example would return a formatted value in the response


data array. For each valid UserID integer in the “PerformerID” data
source column the value would be converted to the user's full
name. For more information about user information, see the
USERINFO sub-tag in the Dynamic Tag Guide. For information
about how to access the Dynamic Tag Guide, see “To Access the
Dynamic Tag Guide” on page 77.
FORMATCOLUMNS:PerformerID:"[LL_REPTAG=PerformerID USERINFO:FULLNAME /]"

Related For more information about the definition of the JSON structure of the response, see
Information “@TABLEREPORT Response Structure Definition Example” on page 155.

Currently, the TABLEREPORT option cannot be added as a tile in Perspective Manager


automatically, but an administrator can manually add a TABLEREPORT using the
Perspective Manager.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 149


Chapter 4 WebReports Advanced Information

4.14.3 INSERTJSON Directive Examples


The following INSERTJSON examples:

• A simplified data source example shows the use of the “@ADDJSVAR VAR”
on page 137, “@ALLDATASOURCE” on page 135, “@FIELDS” on page 137, and
“@ROWCOLUMNS” on page 136 directives.
• Three examples show the definition of the JSON structure of the response for
“@FILTEREDCOUNT” on page 138, “@NODESTABLEFIELDS” on page 145, and
“@TABLEREPORT” on page 146 directives.
• An administrator can use Perspective Manager to apply the “@TABLEREPORT”
on page 146 directive as an HTML WebReport tile.

Example Using a Simplified Data Source


In this example, a WebReport is using a simplified data source that returns only
three columns, parentId, dataId and subType, and two rows from the DTREE.
Given the following INSERTJSON syntax:

[LL_WEBREPORT_INSERTJSON
@ADDJSVAR VAR:sampleData
@ALLDATASOURCE
@FIELDS SYSTEMDATE:"[LL_REPTAG_DATE /]"
@ROWCOLUMNS objName:"[LL_REPTAG=DATAID NODEINFO:NAME /]" supplier:"[LL_REPTAG=DATAID
CAT:VendorData:supplier:DISPLAY /]"
/]

Note that carriage returns have been inserted in the previous example for clarity but
should not be used in the reportview.

This is the data that would be returned to the client in the WebReport output:

var sampleData={
"SYSTEMDATE":"Oct 08 2008",
"sourceID":129293,
"actualRows":2,
"filteredRows":2,
"totalRows":2,
"totalSourceRows":2,
"myRows":[{"objName":"AAA test document", "Supplier":"Widgets Inc.", "parentid":
126758, "dataid":127200, "subtype":144}, {"objName":"BBB test document",
"Supplier":"Teletech Assets", "parentid":126758, "dataid":129514, "subtype":144}]
}

• The object is called “sampleData” according to the ADDJSVAR directive.


• A new field called SYSTEMDATE has been added to the object according to the
FIELDS directive.

• The fields sourceID, actualRows, filteredRows, totalRows and


totalSourceRows have been automatically created as part of the ALLDATASOURCE
directive.

150 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.14. Inserting JSON Data

• Two rows, as many as there are rows in the data source, are stored in the array
called myRows. This example shows all three fields that existed in the simple
data source: parentid, dataid and subtype. If the data source had returned all
the fields in DTREE then all of these columns would have been included in the
myRows array of data according to the ALLDATASOURCE directive.

• In addition to the columns returned by the data source, two new columns:
objName and Supplier have been added for each row of data. In this simplistic
example, Supplier uses the result of: [LL_REPTAG=DATAID CAT:'Test
Category':'Supplier Company':DISPLAY /] for each row to set the data value
called Supplier in each row of the array. The objName value is looked up in a
similar way using the NODEINFO:NAME sub-tag.
• LiveReports allow direct access to the Content Server database, so that access to
creating LiveReports is nearly always restricted to administrators. A WebReport
does not allow direct database access, instead it uses existing LiveReports, search
queries or other data sources. Therefore WebReports may be safely used by
business users and developers who are not administrators.
• The STARTROW and ENDROW tags are not visible. They do not need to be added
because the editor will insert them when editing is complete.
• Each address is separated using whatever symbol has been defined as a system
preference. The instruction for this field will indicate this symbol. Two examples
are: comma and semi colon.

@FILTEREDCOUNT Response Structure Definition Example

Implementation Notes

Returns data compatible with the Visual Data Filtered Count Smart UI widget. Can also be
used for generic grouping and filtering of a WebReports data source.

Response Class

Model

FCResponseCollection {
columns (array[FCColumns], optional): FC Columns - column data used to show available
columns and specify settings required for the facet filtering panel in the expanded view,
data (array[FCDataArray], optional): FC Data Array - the grouped or ungrouped data
derived from the data source,
fc_filters (array[FCFilters], optional): FC Filters - the filters that have been applied,
grouped_on_server (boolean, optional) : Grouped On Server - whether the data has already
been grouped and counted on the server,
source_id (integer, optional) : SourceID - the DataID of the WebReport data source,
total_count (integer, optional) : Total Count - the total count of rows in the data
source after filtering,
group_after (integer, optional) : Group After - The threshold used to determine how many
distinct data values should be displayed before grouping the remaining values under
Other,
grouped_in_data_source (boolean, optional) : Grouped in Data Source - whether the data
was grouped in the data source or not,
sorted_on_server (boolean, optional) : Sorted on Server - true if the grouped data has
been sorted on the server,
sort_col (string, optional) : Sort Column - the name column used to sort the grouped
data,
sort_dir (string, optional) : Sort Direction - the sort direction. Valid values are
"asc" and "desc",
total_count_formatted (string, optional) : Total Count - the formatted total count value.
}

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 151


Chapter 4 WebReports Advanced Information

FCDataArray {
data (object[FCGroupedData, optional): FC Data Array - this object type will be returned
if grouped_on_server is set to true.
data (object[FCUnGroupedData], optional): FC Data Array - this object type will be
returned if grouped_on_server is set to false.
}

FCGroupedData {
{{FCColumn active_column name}}(string, optional): Active Column - active column value,
key name is the FCColumn name key for the column which has active_column set to true,
{{FCColumn active_column name}}_formatted (string, optional): Active Column Formatted -
active column formatted value, key name is the FCColumn name key for the column which
has active_column set to true with the _formatted suffix,
{{FCColumn count_column name}} (integer, optional): Count Column - count column value,
key name is the FCColumn name key for the column which has count_column set to true,
{{FCColumn count_column name}}_formatted (string, optional): Count Column Formatted -
count column formatted value, key name is the FCColumn name key for the column which has
count_column set to true with the _formatted suffix
}

FCUnGroupedData {
{{FCColumn name}}(string, optional): FC UnGrouped Data - This object will contain one
property for each column in the FCColumns array. The key name will correspond to the
'name' field in the FCColumn object.
}

FCColumns {
columns (object[FCColumn], optional): FC Columns
}

FCColumn {
active_column(boolean, optional): Active Column - whether the current column is the
active column or not,
client_format (FormatDefinition, optional): Client Format - client format required for
the count values,
column_key (string, optional): Column Key - lower case string ID for the column,
count_column(boolean, optional): Count Column - whether the current column is the count
column or not,
data_type (integer, optional) Data Type - data type of column value. Supported types are
12 (Integer) and 10 (String),
id(integer, optional): ID - Unique identifier for the column. Dynamically generated
integer where the first column has ID 1000 and subsequent columns increment their IDs by
1,
name (string, optional): Name - display name for the column,
tag_format (string, optional): Tag Format - if the data source column value has been
modified on the server by a WebReports sub-tag this will be the sub-tag string used as
the modifier,
}

FCFilters {
fc_filters (object[FCFilter], optional): FC Filters
}

FCFilter {
column (string, optional) : Column - the column the filter is applied on,
operator (string, optional): Operator - the operator used for the filter condition.
Supported values are: "==","!","IN","NOTIN","<","<=",">",">=", "CONTAINS". See
WebReports logical operator documentation for full details,
value (array, optional): Values - an array of filter values to apply with the column and
operator
}

FormatDefinition {
type(string, optional): Format Definition - defines a particular numeric format to use
to display the counts. Currently supported values are "none", "si" and "bytes". See
INSERTJSON tag documentation for more information.,
}

ModelSchema

152 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.14. Inserting JSON Data

{
"columns":[
{
"active_column":"boolean",
"client_format":{
"type":"string"
},
"column_key":"string",
"count_column":"boolean",
"data_type":"integer",
"id":"integer",
"name":"string",
"tag_format":"string"
}
],
"data":[
{
"{{active_column}}":"string",
"{{active_column}}_formatted":"string",
"{{count_column}}":"integer",
"{{count_column}}_formatted":"string"
}
],
"fc_filters":[
{
"column":"string",
"operator":"string",
"value":[
"string"
]
}
],
"group_after":"integer",
"grouped_in_data_source":"boolean",
"grouped_on_server":"boolean",
"sorted_on_server":"boolean",
"sort_col":"string",
"sort_dir":"string",
"source_id":"integer",
"total_count":"integer",
"total_count_formatted":"string"
}

Error Status Codes:

HTTP Status Code: 401


Reason: Authentication Required

HTTP Status Code: 500


Reason: No output returned from WebReport.

@NODESTABLEFIELDS Response Structure Definition Example

Implementation Notes

Returns node data according to the contents of the WebReports node data source.

Response Class

Model

V2ResponseCollection {
results (array[V2Result], optional): Results,
paging (object[V2Paging], optional): Paging,
source_id (integer, optional) : SourceID - the DataID of the WebReport data source.
}
V2Result {
data (object[V2Data], optional): Data
}

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 153


Chapter 4 WebReports Advanced Information

V2Data {
properties (object[V2Properties], optional): Properties
}
V2Properties {
container (boolean, optional): Whether or not this item is a container,
container_size (integer, optional): The number of items in this container,
create_date (string, optional): The date that the item was created,
create_user_id (integer, optional): The id of the user who created the item,
description (string, optional): Description of the item,
description_multilingual (DescriptionMultilingual, optional): Locale specific item
description. One entry per language enabled in Content Server,
favorite (boolean, optional): Indicates if this item has been favorited by the current
user,
guid (string, optional): Globally unique id,
icon (string, optional): The item's icon,
icon_large (string, optional): The item's icon (large),
id (integer, optional): The item's unique object ID,
modify_date (date, optional): The date on which the item was last modified,
modify_user_id (integer, optional): The id of the user who modified the item,
name (string, optional): The name of the item,
name_multilingual (NameMultilingual, optional): Locale specific item name. One entry per
language enabled in Content Server,
owner_group_id (integer, optional): The group id of the owner of this item,
owner_user_id (integer, optional): The user id of the owner of this item,
parent_id (integer, optional): The object id of the item's parent,
reserved (boolean, optional): Whether or not this item has been reserved,
reserved_date (string, optional): The date on which the item was reserved,
reserved_user_id (integer, optional): The id of the user who has this item reserved,
type (integer, optional): The item's type (unique number),
type_name (string, optional): The item's type,
versions_control_advanced (boolean, optional): Whether or not newly added items to this
item are added as advanced versioning (major/minor versioning),
volume_id (integer, optional): The id of the volume to which this item belongs
}
V2Paging {
actual_count(integer, optional): Actual Count - rows returned after all filtering.
Equivalent to [LL_REPTAG_ACTUALROWS /] tag,
limit (integer, optional): Limit - number of items shown per page,
page (integer, optional): Page - current page number,
page_total (integer, optional): Page Total - total number of pages,
range_max (integer, optional): Maximum Range - number of last item on the current page,
range_min (integer, optional): Minimum Range - number of first item on the current page,
total_count (integer, optional): Total Count - rows returned from the data source taking
into account any name filtering. Equivalent to [LL_REPTAG_FILTEREDROWS /] tag,
total_row_count (integer, optional): Total Row Count - rows returned from the data
source before filtering but after data source pagination using dsstartrow and dsendrow.
Equivalent to [LL_REPTAG_TOTALROWS /] tag,
total_source_count (integer, optional): Total Source Count - rows returned from the data
source before data source pagination using dsstartrow and dsendrow. Equivalent to
[LL_REPTAG_TOTALSOURCEROWS /] tag,
}

ModelSchema

{
"results": [
{
"data": {
"properties": {
"container": "boolean",
"container_size": "integer",
"create_date": "string",
"create_user_id": "integer",
"description": "string",
"description_multilingual": "DescriptionMultilingual",
"favorite": "boolean",
"guid": "string",
"icon": "string",
"icon_large": "string",
"id": "integer",
"modify_date": "date",

154 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.14. Inserting JSON Data

"modify_user_id": "integer",
"name": "string",
"name_multilingual": "NameMultilingual",
"owner_group_id": "integer",
"owner_user_id": "integer",
"parent_id": "integer",
"reserved": "boolean",
"reserved_date": "string",
"reserved_user_id": "integer",
"type": "integer",
"type_name": "string",
"versions_control_advanced": "boolean",
"volume_id": "integer"
}
}
}
],
"paging": {
"actual_count": "integer",
"limit": "integer",
"page": "integer",
"page_total": "integer",
"range_max": "integer",
"range_min": "integer",
"total_count": "integer",
"total_row_count": "integer",
"total_source_count": "integer"
},
"source_id": "integer"
}

Error Status Codes:

HTTP Status Code: 401


Reason: Authentication Required

HTTP Status Code: 500


Reason: No output returned from WebReport.

@TABLEREPORT Response Structure Definition Example

Implementation Notes

Returns data compatible with the Table Report Smart UI components. Can also be used for
returning and processing a WebReports data source to be displayed in a tabular format.

Response Class

Model

TRResponseCollection {
columns (array[TRColumns], optional): TR Columns - a collection of table column
definitions for all columns in the table,
data (array[TRCollection], optional): Row data,
filters (array[TRFilters], optional): TR Filters - the filters that have been applied,
paging (object[V2Paging], optional): Paging,
source_id (integer, optional) : SourceID - the DataID of the WebReport data source.
}

TRColumns {
columns (object[TRColumn], optional): TR Columns
}

TRColumn {
column_key (string, optional): Column Key - lower case string ID for the column,
column_type_identifier (string, optional): Column Type Identifier - determines if the
client should prefer "column_key" or "type" when choosing a cell type. Valid values are
"type" or "key",
definitions_order (integer, optional): Definitions Order - the preferred order the

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 155


Chapter 4 WebReports Advanced Information

columns should appear relative to one another in the table,


id(integer, optional): ID - Unique identifier for the column. Dynamically generated
integer where the first column has ID 1000 and subsequent columns increment their IDs by
1,
name (string, optional): Name - name for the column,
name_formatted (string, optional): Formatted Name - display name for the column,
sort (boolean, optional): Sort - if the column should be enabled for sorting,
tag_format (string, optional): Tag Format - if the data source column value has been
modified on the server by a WebReports sub-tag this will be the sub-tag string used as
the modifier,
type (integer, optional) Data Type - data type of column value. Supported types are 12
(Integer) and 10 (String),
}

TRCollection {
data (object[TRRow], optional): Data
}

TRRow {
{{TRColumn name}}(string, optional): Column Row - the value for a particular data column
in a particular row,
{{TRColumn name}}_formatted (string, optional): Column Row Formatted - the formatted
value for a particular data column in a particular row,
}

TRFilters {
filters (object[TRFilter], optional): TR Filters
}

TRFilter {
column (string, optional) : Column - the column the filter is applied on,
operator (string, optional): Operator - the operator used for the filter condition.
Supported values are: "==","!","IN","NOTIN","<","<=",">",">=", "CONTAINS". See
WebReports logical operator documentation for full details,
value (array, optional): Values - an array of filter values to apply with the column and
operator
}

V2Paging {
actual_count(integer, optional): Actual Count - rows returned after all filtering.
Equivalent to [LL_REPTAG_ACTUALROWS /] tag,
limit (integer, optional): Limit - number of items shown per page,
page (integer, optional): Page - current page number,
page_total (integer, optional): Page Total - total number of pages,
range_max (integer, optional): Maximum Range - number of last item on the current page,
range_min (integer, optional): Minimum Range - number of first item on the current page,
total_count (integer, optional): Total Count - rows returned from the data source taking
into account any name filtering,
total_row_count (integer, optional): Total Row Count - rows returned from the data
source before filtering but after pagination,
total_source_count (integer, optional): Total Source Count - rows returned from the data
source,
}

ModelSchema

{
"columns":[
{
"active_column":"boolean",
"client_format":{
"type":"string"
},
"column_key":"string",
"count_column":"boolean",
"data_type":"integer",
"id":"integer",
"name":"string",
"tag_format":"string"
}
],

156 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.15. JavaScript Arrays

"data":[
{
"{{name}}":"string",
"{{name}}_formatted":"string",
}
],
"filters":[
{
"column":"string",
"operator":"string",
"value":[
"string"
]
}
],
"paging": {
"actual_count": "integer",
"limit": "integer",
"page": "integer",
"page_total": "integer",
"range_max": "integer",
"range_min": "integer",
"total_count": "integer",
"total_row_count": "integer",
"total_source_count": "integer"
},
"source_id": "integer"
}

Error Status Codes:

HTTP Status Code: 401


Reason: Authentication Required

HTTP Status Code: 500


Reason: No output returned from WebReport.

4.15 JavaScript Arrays


The INSERTJSARRAY content control tag allows you to automatically insert a
JavaScript array with all of the report data populated. This feature is useful for
applications where you want to use JavaScript in the client browser to manipulate
the report data. For more information about the INSERTJSARRAY content control tag,
see the Dynamic Tag Guide. For information about how to access the Dynamic Tag
Guide, see “To Access the Dynamic Tag Guide” on page 77.

Automatically Generating a JavaScript Array


The data in the report is converted to the array according to the following criteria:

• A JavaScript array is created by default with the name repData. Alternatively,


you can provide an array name using the ARRAYNAME: parameter.
• The array is indexed numerically from zero (0) to an index which is one less than
the length of the array.
• The columns are created as a second dimension of the row array, for example an
array of arrays. Columns are indexed numerically from zero (0) to an index
which is one less than the total number of columns.
• A series of constants that reference the column indices are also created. Each
constant is named according to the column to which it refers.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 157


Chapter 4 WebReports Advanced Information

• If the inserted JavaScript needs to be enclosed in opening and closing SCRIPT


tags then you should include the SCRIPT parameter.
• For data where several columns are repeated, and only one column is
consistently unique, you can use the MULTIVALUE: parameter. This parameter
creates a third array dimension for the unique column. For more information, see
“Example 1” on page 158 and “Example 2” on page 158.

Example 1

Consider the following data:

Id FirstName LastName
1111 James Black
2222 Johnny Green
3333 Frank Smith

Given a data source that returns the data from the table, the [LL_WEBREPORT_
INSERTJSARRAY /] [LL_WEBREPORT_INSERTJSARRAY ARRAYNAME:Optional Array
Name MULTIVALUE:Column Name /] tag would generate the following:
<SCRIPT LANGUAGE="Javascript">
var repData= new Array();
var ID = 0;
var FIRSTNAME = 1;
var LASTNAME = 2;
repData[0] = new Array("1111","James","Black");
repData[1] = new Array("2222","Johnny","Green");
repData[2] = new Array("3333","Frank","Smith");
</SCRIPT>

Example 2

Consider the following data:

Id FirstName LastName ChildName


1111 James Black Matthew
1111 James Black Jonathan
1111 James Black Emily
2222 Johnny Green George
2222 Johnny Green Mavis
3333 Frank Smith N/A

Given a data source that returns the data from the table, the [LL_WEBREPORT_
INSERTJSARRAY MULTIVALUE:CHILDNAME /] tag would generate the following:
<SCRIPT LANGUAGE="Javascript">
var repData= new Array();
var ID = 0;var FIRSTNAME = 1;
var LASTNAME = 2;
repData[0] = new Array("1111","James","Black",new Array("Matthew", "Jonathan",

158 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.16. LLURL:FORMEDIT

"Emily"));
repData[1] = new Array("2222","Johnny","Green",new Array("George", "Mavis"));
repData[2] = new Array("3333","Frank","Smith",new Array("N/A"));
</SCRIPT>

In this example, the MULTIVALUE option makes it possible to compensate for the
redundancy of the first three columns. By creating another level of JavaScript array,
you can reduce six possible rows to only three rows.

4.16 LLURL:FORMEDIT
Use LLURL:FORMEDIT with forms residing inside a Workflow as well as standalone
forms outside of Workflows. Any extra &editable=true parameters should be
removed.

Standalone Forms
An optional parameter VIEWID is supported to specify the nodeid of the form view
that should be used when displaying the form for editing. The viewids may be
found by using the template Functions menu and selecting Properties > Views.
Point to the links to the view and look for the &objid= parameter in the browser
status bar. If you do not specify VIEWID, the view selected on the form Specific tab is
used.

Usage Example: [LL_REPTAG=DATAID LLURL:FORMEDIT:VIEWID:1234 /]

Workflow Forms
When used with forms inside a Workflow LLURL:FORMEDIT supports the optional
parameters VIEWNAME and FORMID. FORMID specifies an integer that identifies (if there
is more than one form) which form in the Workflow should be edited. If you do not
provide a FORMID parameter, a value of 1 is used by default. To discover the value
required for FORMID you need to open the Forms tab of the Workflow and point to
the Edit link associated with the form that you require. Examine the URL for this
link, either in the browser status bar or by opening the form in a new window and
then inspecting the address bar. Look for the &FormID= parameter in the URL,
because this is the ID you need. VIEWNAME specifies the name (not the nodeid) of the
view to use when editing the form. The available view names may be found by
using the Template Functions menu and selecting Properties > Views. If VIEWNAME
is not specified, then no view is applied.

For more information, see the LLURL sub-tag and the LLURL:FORMEDIT, and
“LLURL:FORMEDIT” on page 159 parameters in the Dynamic Tag Guide. For
information about how to access the Dynamic Tag Guide, see “To Access the Dynamic
Tag Guide” on page 77.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 159


Chapter 4 WebReports Advanced Information

4.17 LLURL:SIDEBAR
The LLURL:SIDEBAR sub-tag inserts the output that is generated from the facet
panels to a sidebar container within the reportview or template. Due to the nature of
this feature, it relies heavily on a pre-determined HTML structure that involves a
series of Forms and nested Tables and DIVS. The Browse Table Report, browse.
txt, default reportview contains the elements necessary to get the SideBar
functionality working. Therefore, it is better to use this as an example or starting
point for creating customized reportviews that use the SideBar feature. See
Figure 4-6 for a diagram of the required HTML elements and the suggested layout
for a reportview/template.

What It Inserts
The LLURL:SIDEBAR sub-tag expects the DataID of a container object, and returns the
sidebar contents, which include facet panels and facet contents, for that container.
There are a number of additional form elements or javascript function calls in
Content Server 10 that need to be set to the same ID to maintain consistent behavior
for the sidebar. All of these are outlined and updated with the appropriate values in
the default reportview/template that includes the SideBar. The LLURL:SIDEBAR:RAW
code wraps the returned facet/sidebar data in a sidebar-wrapper table cell. For
example, <td valign="top" class="sidebar-wrapper">

In WebReports, the SBCONTAINER variable is set at the top of the reportview and is
used at the appropriate locations within the reportview. To use a different ID than
the parent folder of the WebReport, it is best to update this variable with the new ID,
because that variable is already in the correct position. For example, to change the
sidebar to load up facet data for a container with an ID of 12345, set the
SBCONTAINER variable with the following: [LL_REPTAG_'12345'
SETVAR:SBCONTAINER /].

Usage example in WebReports: [LL_REPTAG_%SBCONTAINER


LLURL:SIDEBAR /]

Usage example in ActiveView: [LL_REPTAG=OVERRIDEOBJID


LLURL:SIDEBAR /]

USERPREF Enhancements
There are two new options available in the USERPREF sub-tag that allows the sidebar
to behave according to each users' settings. These new settings in Content Server 10
are found by selecting Settings from the Tools menu. Next, click the General tab.
The new settings can be surfaced using the following sub-tags:

• USERPREF:GENERAL:SBLOCATION - returns right or left based on the “Sidebar


Location” setting
• USERPREF:GENERAL:SIDEBAR - returns 'true' or 'false' based on the “Show
Sidebar in Browse” setting

160 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.18. Logical Expressions

For more information about the USERPREF sub-tag , see the Dynamic Tag Guide. For
information about how to access the Dynamic Tag Guide, see “To Access the Dynamic
Tag Guide” on page 77.

Example
Use [LL_REPTAG_USERID USERPREF:GENERAL:SIDEBAR /] to determine whether or
not the user executing the WebReport wants the Sidebar showing in when they
Browse.

Required HTML structure: Figure 4-6 outlines the nested HTML elements required
for the SideBar elements to load properly

Figure 4-6: Nested HTML Elements

4.18 Logical Expressions


WebReports provides several conditional tags to allow selective filtering of the
output using logical expressions. Examples of the tags which support logical
expressions include:

• [LL_WEBREPORT_EXITIF (logical expression) /]


• [LL_WEBREPORT_INCLUDEIF (logical expression) /]
• [LL_WEBREPORT_IF (logical expression) /]

Logic expressions for these tags are made up of one or more logical clauses which
are separated by a logical Boolean operator. Examples of Boolean operators are:

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 161


Chapter 4 WebReports Advanced Information

• AND
• OR
• &&
• ||

For example: clause1 AND clause2 OR clause3

Each one of these clauses is made up of two operands which are compared using
one of the comparison operators. For information about supported operators, see
“Operators” on page 162. For example, each clause is in the form: “parmA” ==
“parmB”

In these clauses each operand can be either a constant value or one of the
WebReports report tags which is supported for use in a logic expression. Currently,
variables are not supported in IF/ENDIF expressions and the ACTUALROWS tag cannot
be used within a row section. For example: "[LL_REPTAG_TOTALROWS /]" >= "10"

Using these two concepts, a logical expression with multiple clauses could look like
this: [LL_WEBREPORT_IF "[LL_REPTAG_TOTALROWS /]" >= "10" AND "[LL_REPTAG_&
reptype /]" == "parmB"> /]...[LL_WEBREPORT_ENDIF /]

Operators
WebReports supports a variety of logical operators on integers (including reals/
floating point numbers) and strings that are described in the following table:

Operator Meaning Notes


== Equal to Performs a string compare.
!= or <> Not equal to Performs a string compare.
<= Less than or equal to Compares the operands in
the following manner:
• If both operands can be
treated as integers, an
integer compare is
performed;
• otherwise, if both
operands can be treated
as dates, a date compare
is performed;
• otherwise a string
compare is performed.

162 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.18. Logical Expressions

Operator Meaning Notes


>= Less than or equal to Compares the operands in
the following manner:
• If both operands can be
treated as integers, an
integer compare is
performed;
• otherwise, if both
operands can be treated
as dates, a date compare
is performed;
• otherwise a string
compare is performed.
< Less than Compares the operands in
the following manner:
• If both operands can be
treated as integers, an
integer compare is
performed;
• otherwise, if both
operands can be treated
as dates, a date compare
is performed;
• otherwise a string
compare is performed.
> Greater than Compares the operands in
the following manner:
• If both operands can be
treated as integers, an
integer compare is
performed;
• otherwise, if both
operands can be treated
as dates, a date compare
is performed;
• otherwise a string
compare is performed.
IN Second operand contains first Compares the operands as
operand strings returning TRUE if the
first operand is contained at
least once within the second
operand. The comparison is
case insensitive. If either
operand is an empty string,
IN returns TRUE.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 163


Chapter 4 WebReports Advanced Information

Operator Meaning Notes


NOTIN Second operand does not Compares the operands as
contain first operand strings returning FALSE if
the first operand is contained
at least once within the
second operand. The
comparison is case
insensitive. If either operand
is an empty string, NOTIN
returns FALSE.
STARTIN Second operand starts with Compares the operands as
first operand strings returning TRUE if the
first operand appears at the
start of the second operand.
The comparison is case
insensitive. If either operand
is an empty string, STARTIN
returns TRUE.
CHILDOF First operand is a child node Treats the operands as
of the second operand Content Server Nodes
returning TRUE if the first
node is contained directly or
indirectly by the second
node. If either operand is not
a valid Content Server object
ID, CHILDOF returns FALSE.
If either operand is an empty
string,CHILDOF returns
TRUE.
NOTCHILDOF First operand is a not child Treats the operands as
node of the second operand Content Server Nodes
returning FALSE if the first
node is contained directly or
indirectly by the second
node. If either operand is not
a valid Content Server object
ID, NOTCHILDOF returns
TRUE. If either operand is an
empty string, NOTCHILDOF
returns FALSE.

Treatment of Dates
For certain operators:

• <=
• >=
• <
• >

164 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.18. Logical Expressions

WebReports first attempts to convert the string operands into integers. If conversion
to integer is unsuccessful, WebReports attempts to convert the operands into dates.
In reality, operands cannot have a type because they are all raw strings. However,
strings conforming to a particular format can be interpreted as a type, such as
integer or date. If the strings match any of the date formats described in the
following table, they be converted into dates and compared as dates. The supported
formats match those used by common WebReports tags and data source dates.

WebReports treats the following examples as dates:

Tag Format Notes


[LL_REPTAG_DATE /] May 17 2008 Current date from Content
Server.
[LL_REPTAG_DATETIME /] Thu May 17 11:59:04 2007 Current date and time from
Content Server.
[LL_REPTAG=CreateDate Thu May 17 11:59:04 2007 Date and time from DTree
/] table. This is the same format
as from an SQL Server or an
Oracle database.
[LL_REPTAG=DataId Thu May 17 11:59:04 2007 Date and time from
NODEINFO:CreateDate /] NODEINFO sub-tag.
[LL_REPTAG_&dateParm / D/2007/5/17:8:13:0 This is a WebReports
] parameter defined as a date
in the parameters tab with
the time field enabled. The
time shown here is 8:13 AM.
The unusual format is an
internal system format used
by Content Server to
represent dates stored as
strings. Please note that a
WebReports parameter that
is not defined as a date in the
Parameters tab, will not be
converted to a date unless its
contents follow the format
shown. For example, a string
parameter containing
5/17/2007 will not be
converted to a date for
comparison.
[LL_REPTAG_& D/2007/5/17:0:0:0 Date input parameter defined
inputlabel1 /] in LiveReport, and not
defined in WebReports
Parameter tab. No time
element can be specified.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 165


Chapter 4 WebReports Advanced Information

Order of Evaluation
The WebReports logic clauses do not support any bracketing to force expressions to
be evaluated in a particular order. The order of evaluation of any logical expression
is that each clause is evaluated from left to right. The logical result of each clause,
TRUE or FALSE, is compared with the result of the next clause. The combined result
of these two operations is then passed to the next clause, and so on. Logical
operators are compared using traditional Boolean logic. For example:

Left Clause Result Clause Operator Right Clause Result Logical Result
FALSE AND FALSE FALSE
FALSE AND TRUE FALSE
TRUE AND TRUE TRUE
FALSE OR FALSE FALSE
FALSE OR TRUE TRUE
TRUE OR TRUE TRUE

To illustrate how multiple clauses are evaluated, consider the following example:

Clause 1 Clause 2 Clause 3 Clause 4


5 == 5 AND 10 != 5 OR 10 == 2 AND 5 == 10

This simplistic expression would be evaluated from left to right in the


following order:

1. Clause 1 evaluates to TRUE.

2. Clause 2 evaluates to TRUE.

3. Clause 1(TRUE) AND Clause 2(TRUE) results in TRUE.

4. Clause 3 evaluates to FALSE.

5. The previous result from Step 3 of TRUE OR Clause 3 (FALSE) results in TRUE.

6. Clause 4 evaluates to FALSE.

7. The previous result from Step 5 of TRUE AND Clause 4 (FALSE) results in FALSE.

Thus, the end result of this logical expression is FALSE. From this example it should
be evident that the last parameter has the highest precedence. For example, if the last
clause resolves to FALSE and the preceding logical operator is AND, then the result is
always FALSE regardless of any other parameters. Similarly, if the last clause
resolves to TRUE and the preceding logical operator is OR, then the result of the
expression is always TRUE.

If this logical expression was written out using brackets it would look like this:
(((("5" == "5") AND ("10" != "5")) OR ("10" == "2")) AND ("5" == "10"))

166 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.19. Page Function Reference

4.19 Page Function Reference


The page.js file packaged with WebReports includes a useful function getPage to
assist in the mechanics of pagination when you want to display a large set of results.
This function is called when the user clicks the First, Previous, Next, or Last buttons.
In addition, this function is available to use in any WebReport reporting application.
The page.js file is accessed using the a SCRIPT include like this: <SCRIPT SRC="/
<support dir>/webreports/library/page.js"></SCRIPT>

If you include this file in a WebReport, you can use the LIBPATH tag as follows:
<SCRIPT SRC="[LL_REPTAG_LIBPATH /]page.js"></SCRIPT>

getPage( baseURL, page, dataCount, pageSize, ip1, ip2,


startParm, endParm )
• A function that is invoked when the user clicks the First, Previous, Next, or Last
buttons. It builds and runs the URL for the next slice of data to display to the
user based on the button that is clicked.
• Takes the following arguments:

– baseURL: a required parameter. The base URL of the report we want to run.
This can be achieved using the WebReports tag [LL_REPTAG_MYID
LLURL:REPORT /] which would resolve to something like: ?func=ll&objId=
xyz&objAction=RunReport
– page: a required parameter. A String indicating which button is clicked. It
must be one of the following values: first, prev, next, or last.
– dataCount: a required parameter. A number representing the total number of
rows to paginate through.
– pageSize: a required parameter.
– ip1: a required parameter. The current start row number. Example: If 'ip1=1'
and 'ip2=20' is specified, it would result in the first 20 rows being displayed
when the user runs the WebReport.
– ip2: a required parameter. The current end row number. Example: If 'ip1=1'
and 'ip2=20' is specified, it would result in the first 20 rows being displayed
when the user runs the WebReport.
– startParm: an optional parameter. Represents the start parameter name. If
not specified, it defaults to 'inputLabel1'. Generally this is the name for the
parameter 'ip1'. This parameter is used in the URL of the next page to display
with its value set to the start row number.
– endParm: an optional parameter. Represents the end parameter name. If not
specified, it defaults to 'inputLabel2'. Generally this is the name for the
parameter 'ip2'. This parameter is used in the URL of the next page to display
with its value set to the end row number.
• For more information about a detailed example of Pagination using the getPage
function, see Example 4-1, “getURLParm( parm ) Example” on page 85.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 167


Chapter 4 WebReports Advanced Information

4.20 PDF Conversion


Several of the WebReports destinations support third party document conversion,
which you can use to create PDF formatted reports. The destinations include the
following:

• Email
• Content Server Node
• Content Server Version
• Server

In earlier versions of WebReports, PDF conversion was supported in a slightly


different form. The user had the option of selecting a PDF MIME type which, upon
its selection, caused the reportview to be converted into a PDF format. This had
limitations such that the reportview being converted to PDF can only be in HTML
format.

From WebReports 4.0, the MIME Type and conversion process have been
decoupled. This means the user can use WebReports to create a document of any
type, for example WordML or SpreadsheetML, and then perform the conversion
process on this document. This brings much more flexibility to the look of the
document being converted.

4.20.1 How to Convert a Document


To convert a document, check the Use External Conversion Engine on the
Destination tab of any WebReport and it will be converted into PDF format.

Notes

• PDF conversion is not instantaneous. The user may need to wait for several
minutes for a report to appear at the destination location.
• Before you can use PDF conversion, your Content Server administrator must
configure options in the Content Server admin pages:

If you are an administrator, see OpenText Content Server - WebReports Administration


Guide (LLESWEBR-AGD).

168 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.20. PDF Conversion

4.20.2 XML Job Tickets


XML Job Tickets can be a very useful tool for users using Adlib Express for file
conversion. A job ticket allows a user to specify many different aspects of how a
document will be converted by Adlib, such as page formatting for example. This
feature allows users to select a custom job ticket that they have created, and have it
applied to a WebReport when it is being converted by Adlib Express. Currently, this
feature only works with Adlib Express conversion software, because XML Job
Tickets are a feature of that software.

The following tables describe the tags recognized by WebReports. Not all tags are
supported in all sections of the reportview. The supported sections (header, row
template, footer) are indicated beneath each tag name.

To Create an XML Job Ticket


To create an XML job ticket:

1. XML job tickets must be valid to be used. The following rules must apply to
each job ticket to be valid:

• Must contain an XML header at the beginning. For example, <?xml


version="1.0" encoding="ISO-8859-1"?>
• The XML header must be followed by the Adlib header tag containing the
version to which the Adlib ticket conforms. For example, <?AdLibeXpress
applanguage="USA" appversion="2.7.0" dtdversion="1.8"?>
• Must contain a <JOBS> tag with optional attributes.
• Must contain only one <JOB> tag. Note that the <JOB> tag does not have
attributes. Although Adlib supports multiple jobs in one ticket, this is not
practical with WebReports conversion. Each converted document will have
its own job ticket.
• Must contain a <JOB:DOCINPUTS> tag with a <JOB:DOCINPUT ... /> tag
nested inside it. This contains information about where Adlib can find the
file to be converted.
• Must contain a <JOB:DOCOUTPUTS> tag with a <JOB:DOCOUTPUT ... /> tag
nested inside it. This contains information for Adlib regarding where to
place the converted file.
• Although many attributes can be added to the <JOB:DOCINPUT ... /> and
<JOB:DOCOUTPUT ... /> tags, they must each contain the FOLDER attribute to
be valid.

Example:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?AdLibeXpress applanguage="USA" appversion="2.7.0" dtdversion="1.8" ?>
<!DOCTYPE JOBS SYSTEM "C:\AdLib eXpress\DTD\AdLibeXpress.dtd">
<JOBS xmlns:JOBS="http://www.adlibsys.com" xmlns:JOB="http://
www.adlibsys.com">
<JOB>

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 169


Chapter 4 WebReports Advanced Information

<JOB:DOCINPUTS>
<JOB:DOCINPUT FILENAME="" FOLDER="$DEFAULT_PATH" />
</JOB:DOCINPUTS>
<JOB:DOCOUTPUTS>
<JOB:DOCOUTPUT FILENAME="" FOLDER="$DEFAULT_PATH" DOCTYPE="PDF" />
</JOB:DOCOUTPUTS>
</JOB>
</JOBS>

2. Any FILENAME attribute found in the <JOB:DOCINPUT ... /> and


<JOB:DOCOUTPUT ... /> tags will be replaced with a dynamically generated file
name, so that the FILENAME attribute, although optional, is not necessary and
has no effect on the processing of the file to be converted.

3. The FOLDER attribute needs to contain a valid file path in order for the files to be
processed and delivered properly. The exception to using a valid file path is
using the new $DEFAULT_PATH value. For more information about the
$DEFAULT_PATH value, see “The $DEFAULT_PATH” on page 170

4. Creating an XML job ticket also supports the use of WebReports tags within the
job ticket file. For more information about Job Ticket features, see the Adlib
Express documentation. Feature availability depends on version of Adlib
Express that you use.

The $DEFAULT_PATH
When used as part of a Job Ticket file in the FOLDER attribute, $DEFAULT_PATH will
dynamically insert the appropriate file path as specified in the Manage WebReports
Conversion administration page.

On the administration page, you can specify two sets of directories. If the set of
directories for use with XML Job Tickets has been specified, the $DEFAULT_PATH
value returns those file paths; otherwise, if not specified, it returns the first set of
conversion directories specified for conversion.

Because this is not a constant, you can use this value as part of the FOLDER attribute
in both DOCINPUT and DOCOUTPUT tags. Using the $DEFAULT_PATH value returns the
proper file path where used.

Example:
<JOB:DOCINPUT FILENAME="" FOLDER="$DEFAULT_PATH" />
<JOB:DOCOUTPUT FILENAME="" FOLDER="$DEFAULT_PATH" DOCTYPE="PDF" />

170 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.21. Requests as Data Sources

Selecting a Job Ticket


The interface for selecting a Job Ticket to be used when sending a file for conversion
is found alongside the Use External Conversion Engine check box in the
Destination tab for any WebReport. The interface only appears if the Use External
Conversion Engine check box is selected and XML Job Tickets have been enabled on
the administration pages.

• To select a Job Ticket to use during conversion, click Browse Content Server, and
browse for a job ticket file that a user has created and placed in Content Server.
• If you want to change the settings for a WebReport to ensure that it is still sent
for conversion, but not used as a job ticket anymore, click Clear and update the
page.
• If a job ticket has been selected and the destination page has been updated, there
is a Functions menu available to access the functions available to the job ticket
file selected.

4.21 Requests as Data Sources


This feature allows a WebReport to use information in the GET or POST request used
to invoke the WebReport as a data source. It allows data to be specified in either
separated value or HTML form, or any other supported type of parsing, that would
then be used by the WebReport. This allows the possibility of pushing data into a
WebReport to then be formatted and delivered to destinations.

The data is passed using a predefined parameter name and typically uses the
defaults for web documents to parse the data. Several other predefined parameters
have been made available to control the parsing options that would typically be set
in the data source interface. Currently, this feature has no visibility on the Source tab
because it is purely driven by the existence of these special parameters.

The following table lists the supported parameters:

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 171


Chapter 4 WebReports Advanced Information

Parameter Description Optional or Mandatory


DSrequestData This is the parameter that Mandatory
contains the data that will be
used by the datasource. For
any of the optional
parameters that have not
been specified, defaults are
used. The data in this
parameter would typically be
formatted in a way that can
be interpreted by the
WebReport, for example
Comma Separated Values
(CSV) or HTML table data. If
no optional parameters have
been specified, the data is
expected to be formatted as
CSV. Use the optional
parameters listed in this table
to specify any differences in
the parsing format. A
common variation would be
to use a symbol, such as a
pipe ( | ), as the row-
separation character.
DSFILETYPE Acceptable values are: Optional
separatedvalue, the
default, htmltable and
oscript. This parameter
specifies how the data has
been formatted and therefore
how it should be parsed. In
the case of OScript, the data
source can be a LIST of
ASSOC or a RECARRAY. The
tags ENTERPRISE,
PERSONAL, TOOLS, TABS,
llurlfuncraw,
LLURL:ADDITEM:ITEMMEN
U:RAW,, and CAT provide
data structures in OScript
format that can be used in
this parameter.

172 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.21. Requests as Data Sources

Parameter Description Optional or Mandatory


DSCONTENTTYPE Only appropriate for a Optional
filetype of
separatedvalue.
Acceptable values are:
somequotes, allquotes,
and noquotes. The default
is somequotes. These
settings refer to whether or
not some of the data cells
might be quoted to hide
characters that might
interfere with parsing. If
none of the cells are quoted, a
setting of noquotes
provides faster processing.
DSSTRICTSYNTAX Set to either true, the Optional
default, or false. True
specifies that the data has
been strictly formed with no
unexpected spaces or other
ambiguous white space.
DSCOLUMNSEP Specifies a character or Optional
characters that delimit or
separate columns of data.
The default “,” is a comma.
DSROWSEP Specifies a character or Optional
characters that delimit or
separate rows of data. The
default is a carriage return
followed by a line feed.
DSQUOTECHAR Specifies which character or Optional
characters have been used to
quote cells, if any. The
default is a single quote
character, ".
DSESCQUOTECHARS Specifies which character or Optional
characters are used to escape
any quotes in the cell data, if
any. The default is a double
quote, “”.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 173


Chapter 4 WebReports Advanced Information

Parameter Description Optional or Mandatory


DSHEADINGSINC Specifies true or false Optional
depending on whether the
first row of data includes
heading names for each
column. The default is true.
If set to false, columns are
automatically named as
column1, column2, and so
on.

Example 4-26: Calling as a Sub-WebReport

The following tags will call a sub-WebReport and pass the DSrequestData as
parameters to the sub-WebReport:
[LL_WEBREPORT_SUBWEBREPORT NODEID:[LL_REPTAG_$SWR /] PARM:DSREQUESTDATA:"444,555,666|
777,888,999" PARM:DSCOLUMNSEP:"," PARM:DSROWSEP:"|" PARM:DSHEADINGSINC:"FALSE" /]

Example 4-27: Calling from a URL

The DSrequestData parameters can also be set in a URL:


?func=ll&objId=48243&objAction=RunReport&DSREQUESTDATA=444,555,666|
777,888,999&DSCOLUMNSEP=,&DSROWSEP=|&DSHEADINGSINC=FALSE

Example 4-28: Using DSFILETYPE of value OSCRIPT

The output of tags, such as CAT:RAW, can be used similar to Example 4-27,
“Calling from a URL” on page 174 but with a form post:
<FORM NAME="getFuncs" METHOD="POST" ACTION="[LL_REPTAG_URLPREFIX /]">
<input type=hidden name="DSFILETYPE" value="oscript">
<input type=hidden name="DSrequestData" value="[LL_REPTAG_"23099" CAT:RAW /]">
[LL_REPTAG_$CLICK LLURL:REPORT URLTOPOST /]
<input type=submit value=submit>
</FORM>

In cases where Internet Explorer cannot copy with very long parameter values
and results from the RAW tag are large, you should consider a form post.

174 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.22. WebReports Run As Feature

4.22 WebReports Run As Feature


This feature enables a WebReport developer to specify which user the WebReport
should run as. Every time the report is run, it will run using the specified user
permissions and UserID.

As an example, any files that the Run As user does not have permissions to See will
not show up in the output, regardless of who runs the WebReport. Each WebReport
can have its own Run As setting, which can be set on the Specific tab of any
WebReport. For security reasons, this feature can only be enabled by a user with
admin privileges.

4.22.1 To Enable the Run As Feature


To Enable the Run As Feature:

1. On the WebReport Functions menu, select Properties > Specific.

2. On the Specific tab, in the Run As area, click the Choose User button .

3. In the User selection window, choose the user that will be used to run this
report.

4. Click Update to save your changes.

Note: The next time you run this report, it will be run as though the user
in the Run As box ran it. All permissions and any tags within the
WebReport run as though it was run by the Run As user. This includes
tags like USERID. No matter who runs the report, this tag always resolves
to the USERID of the Run As user for that WebReport.

4.23 Using a Search Query as a Data Source


A WebReport can use a saved search query as a data source. Saved queries are most
commonly created by saving an advanced search, thus creating a new object in
Content Server. The WebReports data source browser will recognize saved data
queries as a selectable object.

The search queries can either use standard Full Text specifications, for example All
Words, or complex Content Server Query Language queries.

When a data source is selected, the corresponding search specification will be run
whenever the WebReport is run.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 175


Chapter 4 WebReports Advanced Information

4.23.1 Column Names Returned


The columns returned by a saved search are described in the following chart:

Column Name Description


DataID The DataID for the object, as stored in the
Content Server DTREE database table.
ParentID The ID of the parent container for the object,
as stored in the Content Server DTREE
database table.
Name The name of the object, as stored in the
Content Server DTREE database table.
CreatedBy The date that the object was created, as
stored in the Content Server DTREE database
table.
ModifyDate The date the object was last modified, as
stored in the Content Server DTREE database
table.
Record A full record of all the fields for the object
that is stored in the Content Server DTREE
database table. These fields are stored in a
special, RECORD, structure that can be
accessed using the RECORD sub-tag. For
example: [LL_REPTAG=RECORD
RECORD:SUBTYPE /]
[Optional Fields] In addition to the previous fixed fields, any
other system attributes, or regions, that have
been enabled for search display can also be
referenced using a WebReports data tag.
Because these fields are system-dependent, it
is necessary to ask the administrator to
provide a list of these attributes or regions.

4.23.2 Using Variable Parameters in Search Queries


WebReports allows you to use user-defined parameters in the Full Text section of
the search query. This is designed to work in a similar way to the parameters used in
LiveReports. Parameters are specified in the format: %n where n is a number from 1
to 99. These parameters can be added to multiple Full Text boxes. When the
WebReport is run, parameters are passed by adding &inputlabeln to the URL.

Example 4-29: If the Full Text box contained “test %1”:

The parameter &inputlabel1=cat in the URL would result in the search query
looking for the words test and cat.

176 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.24. Server-Side Scripting

4.23.3 Using Livelink Query Language


If you want to go further than adding search terms to the Full Text field, you can use
Livelink Query Language (LQL) to build queries in the Full Text box. In the Full
Text Search, you can specify %n parameter values, which you can substitute into
from any WebReport, within the LQL clauses. For more information about LQL, see
OpenText Content Server - Search User Guide (LLESWBB-UGD).

4.24 Server-Side Scripting


Although WebReports provides a number of tags to control what is included and
excluded in a WebReport, there remain tasks that demand the power of a fully
fledged scripting language at the server, before the report reaches a client. In
WebReports version 4.0 onwards, the optional ability to embed a section of script
within a reportview was provided.

This feature offers tremendous power and flexibility for reporting or web
application developers. As with many powerful features, it follows that this
capability also has potential risks if used improperly. To reduce these to a minimum,
WebReports scripting has been carefully secured and constrained in a configurable
way that allows each Content Server instance to choose precisely which script
features should be enabled and which not.

Presently the only script language supported is OScript. OScript has the advantage
of running natively on the Content Server platform and hence offers excellent
performance. Although technically it is not required for creating WebReports with
OScript, developers with access to the Content Server SDK will benefit from the
Content Server Builder debugging facilities. In practice, for anything but relatively
simple scripts, access to the Content Server Builder debugger will be essential to
allow developers to step through their code and debug it.

This help explains how to implement a script within a WebReport, but does not
cover how to write OScript or provide a reference for OScript syntax. For more
information about OScript, see the Content Server SDK documentation, such as the
Content Server Builder help, or contact OpenText for details about Content Server
SDK training.

4.24.1 Security
There are a number of layered security measures to ensure that WebReports
scripting is as safe as possible:

1. If not required, the entire feature can be turned off globally by the Content
Server Administrator. Users may want to check with their administrator that the
feature is active before attempting to use it.
2. Even if the feature is on globally, it must be enabled for each individual
WebReport that uses it, every time a new reportview version is added to the
WebReport. Any user who can create a WebReport can include the tags to define
and call scripts but the tags will remain disabled until a System Administrator

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 177


Chapter 4 WebReports Advanced Information

reviews and enables scripting for the report. Disabled reports will run but will
ignore and not run scripts.
3. The functions available within OScript are heavily restricted by default. For
example, you may not access Global variables or many of the Builder built-in
packages, such as CAPI, DAPI, and File, among others. The Content Server
Administrator can configure what is available.

4.24.2 Enabling Scripting for a WebReport


Only users with the System Administration Rights privilege have the ability to
enable scripting for a particular WebReport. There are three different ways of doing
this:

• Add the new reportview version. When a System Administrator adds a


reportview containing scripting it is automatically enabled.
• On the WebReport Functions menu, select Properties > Specific. On the Specific
tab, select the Oscript Scripting Enabled check box, which will appear if
scripting is present in the reportview.
• Use the WebReports Administration > Manage WebReports Scripting page to
review all WebReports that contain scripting. Then enable or disable them by
selecting or clearing the check box.

Users without the System Administration Rights privilege may find developing a
WebReport that contains scripting a tedious process because each new version of
their WebReport must be enabled by someone who does have that privilege. This is
one reason why it makes sense to develop scripted WebReports on a non-production
instance where the developer may be granted the System Administration Rights
privilege. For more information, see “Recommendations for Developing Scripted
Reportviews” on page 180.

The exception is that any user may create a WebReport from a default reportview
that contains OScript and it will be enabled automatically without the need for a
System Administrator to enable it. If the reportview for the WebReport is later
edited or a new version added, then its OScript will be disabled unless re-enabled by
a System Administrator. Because default reportviews are pre-enabled, it is essential
that you test and approve all reportviews containing OScript that you want to make
default reportviews. You make a reportview the default reportview by placing it in
the default reportview folder. For more information, see “Default Reportviews”
on page 27 and OpenText Content Server - WebReports Administration Guide
(LLESWEBR-AGD).

178 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.24. Server-Side Scripting

4.24.3 OScript Restrictions


WebReports uses a scheme of the following restrictions to make OScript in the
reportview more secure:

• No access to global variables using the dollar ($) symbol.


• No ability to declare Object, ObjRef or Frame variables.
• No ability to use parentheses like this “.()” to evaluate the contents of a variable.
For example, the following code is not permitted because “.(s)” is not allowed:
Assoc myAssoc
String s = 'item1'
myAssoc.item1 = 'first item'
echo ( myAssoc.(s) )

• All Builder Packages are restricted except for those listed following.
• Some functions within certain restricted Builder Packages are permitted. For
more information, see “Default Builder Packages Permitted” on page 179.

Default Builder Packages Permitted


The following Builder Packages are permitted by default. However the Content
Server administrator can chose to add anything to or remove anything from the
permitted list of Packages or Package functions.

• Assoc
• Boolean
• Bytes
• Date
• Integer
• List
• Math
• Pattern
• Real
• RecArray
• Record
• Str
• String
• Undefined
• Void

Permitted functions within otherwise restricted packages:

• Scheduler.debugbreak
• Web.CRLF
• Web.DecodeForURL
• Web.EncodeForURL
• Web.Escape
• Web.EscapeHTML
• Web.EscapeXML

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 179


Chapter 4 WebReports Advanced Information

• Web.Format
• Web.Unescape

4.24.4 Recommendations for Developing Scripted Reportviews


WebReports with server-side scripting should be developed on a non-production
Content Server instance. Preferably this instance would be running the Content
Server Builder to aid in debugging and the developer would have the System
Administration Rights privilege. After the WebReports have been developed and
tested to ensure they are fit for use in production, they can be moved to the
production instance using XMLExport and XMLImport. You can also use download
reportview to move them one by one.

Once in place on the production instance, a System Administrator should use the
WebReports Administration > Manage WebReports Scripting page to review all
the reports and enable them if they are satisfied that the reports and in particular the
scripting aspects are safe. Check for the following kinds of pitfalls:

• Possible infinite loops which could tie up threads on Content Server.


• Possible consumption of too much memory through unrestrained data creation
or iterations.
• Lack of checks for undefined data or passed parameters. For example, the script
must check for and handle undefined parameters.
• Presence of the scheduler.debugbreak() statement which is useful during
development but not desirable for production.

Important
The first two pitfalls listed represent the risks with the greatest potential to
impact Content Server.

4.24.5 Defining and Calling a Script


Scripts are both defined and called within a single reportview. The definition of a
script may appear anywhere in the reportview and calls to a script can occur before
its definition. This is because script definitions are parsed, compiled and cached
before a WebReport runs, in most cases at the time the new reportview version is
added. However, to make reportviews easier to understand, it makes sense to locate
the script definitions in the header section.

To define a script, use the following:


[LL_WEBREPORT_STARTSCRIPT NAME:myFunc /]
function String anyName(Dynamic c)
String s = 'Testing'
return s
end
[LL_WEBREPORT_ENDSCRIPT /]

When called, this simple script returns the string “Testing” to the reportview. The
string will be inserted into the resulting report output where the call to the script
was made. To call the script use: [LL_WEBREPORT_CALL NAME:myFunc /]

180 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.24. Server-Side Scripting

This tag causes the script named myFunc to run and any result returned by it to be
inserted into the report output in place of the tag. Scripts can be called from
anywhere in the reportview.

4.24.6 Passing Data to a Script


There are a number of ways to pass data to a script; by using the Context Assoc, by
passing explicit parameters, and by calling WebReports static data tags within the
script section. The last of these three methods will be discussed separately in section
“Calling Static Data Tags” on page 183.

The Context Assoc


Data that is passed to the WebReport from the data source may be accessed from
within the script. The first parameter passed to the first OScript function declared in
the script is always an Assoc, called the Context. If there is a data source for the
WebReport, the Context Assoc will contain a key, called data, holding a RecArray, a
two-dimensional array that will represent all the data passed to the WebReport by
the data source.
[LL_WEBREPORT_STARTSCRIPT NAME:myFunc /]
function String anyName(Dynamic context)
String cell = ""
if isDefined (context.data) // check there is a data source
cell = context.data[1][1] // return the first cell of data
end
return cell
end
[LL_WEBREPORT_ENDSCRIPT /]

Note the check that context.data is defined. If there had been no data returned by the
data source, or no data source at all, context.data would be undefined and failing to
check for it would result in the entire WebReport failing to continue processing. The
script is always responsible for checking that the data it expects has in fact been
passed.

As well as reading from this RecArray, the script may also write to it. This means a
script that is called in the header section can alter the data from the data source
before it is output in the WebReport row section.

Passing Parameters
When calling a script you may explicitly pass any number of parameters. For
example the following passes three parameters: [LL_WEBREPORT_CALL NAME:myFunc
PARM:1234:"a string with spaces":more_data /]

Parameters containing spaces can be delimited with double or single quotes. The
parameters are passed to the first function declared in the myFunc script. They
appear as an OScript List of values in the second parameter, after the Context Assoc.
For example:

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 181


Chapter 4 WebReports Advanced Information

Example 4-30: The following will return 1234-a string with spaces-more_
data to the reportview:
[LL_WEBREPORT_STARTSCRIPT NAME:myFunc /]
function String anyName(Dynamic context, List args)
String s
s = args[1] + "-" + args[2] + "-" + args[3]
return s
end
[LL_WEBREPORT_ENDSCRIPT /]

Example 4-31: The following example reportview illustrates how to access


the data in the Context Assoc and also how to explicitly pass a parameter
to a script

This report displays all the data from a data source regardless of how many
columns that data source might return.
[LL_WEBREPORT_STARTSCRIPT NAME:doRow /]
Function String doRow (Dynamic c, List args)
Integer row, col
String s =''
row = Str.StringToInteger(args[1])
if isDefined(row)
for col=1 to length(c.data[1])
s+= Str.Format( '<TD>%1</TD>', c.data[row][col])
end
end
return s
end
[LL_WEBREPORT_ENDSCRIPT /]

[LL_WEBREPORT_STARTSCRIPT NAME:doRowHeader /]
Function String doRowHeader (Dynamic c, List args)
String field
String s =''
List fields
if isDefined(c.data) // check there is data
fields = RecArray.FieldNames(c.data)
for field in fields
s+= Str.Format( '<TD>%1</TD>', field)
end
end
return s
end
[LL_WEBREPORT_ENDSCRIPT /]

<TABLE>
<TR>
[LL_WEBREPORT_CALL NAME:doRowHeader /]
</TR>

[LL_WEBREPORT_STARTROW /]
<TR CLASS="[LL_REPTAG_ROWNUM ODDEVEN:Browserow1:Browserow2 /]" VALIGN="CENTER" NOWRAP
ALIGN="LEFT">
[LL_WEBREPORT_CALL NAME:doRow PARM:[LL_REPTAG_ROWNUM /] /]
</TR>
[LL_WEBREPORT_ENDROW /]

</TABLE>

182 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.24. Server-Side Scripting

4.24.7 Calling Static Data Tags


It is sometimes useful to obtain the value returned by a WebReport static data tag
inside a section of OScript. Note that static data tags do not include tags, such as
[LL_REPTAG=<column> /] or [LL_REPTAG_%<var name> /].

For example, you may need to know the value of a WebReport constant or
parameter. Although you could arrange to pass these items as parameters at the
time the script is called, you can also access them directly using the built-in dot
function ._repTag which has the following syntax: String ._repTag( String tag
)

Function Parameters Returns


String ._repTag( String tag: a string value A String value containing the
tag ) representing the tag plus final value of the specified
optional sub-tags. tag and sub-tags.

Example 4-32: Here are two examples that return the value of a
WebReport constant called report:

• String value1 = ._repTag('$report')


• String value2 = ._repTag('[LL_REPTAG_$report /]')

Note that you may specify either the full tag name or a shortened version
which omits the opening [LL_REPTAG_ and closing /].

Example 4-33: Here are two further examples:

• String value3 = ._repTag('&myNode NODEINFO:NAME')


• String value4 = ._repTag('USERID USERINFO:MAILADDRESS')

Note that not all sub-tags are supported when used within ._repTag. Generally sub-
tags that cause some other action besides returning formatted data do not work.

The following sub-tags are not supported: ADDVAR, CONCATVAR, NEXT, PREV, SETFORM,
SETVAR, SETWFATTR, SETWFFORM.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 183


Chapter 4 WebReports Advanced Information

4.24.8 Calling Sub-tags


Use sub-tags without also invoking a static data tag by using the following dot
function:

Function Parameters Returns


String ._subTag(String data: a String value to be A String value containing the
data, String subtags) operated on by the sub-tags. result of the data
transformed by the sub-tags.
subtags: a String containing
the sub-tags to use on the
data.

Example: String s = ._subTag('3','DECODE:1:Beginning:2:Middle:


3:End:Other UPPER')

In this case the string “s” is set to END.

Note that not all sub-tags are supported when called by ._subTag. Generally sub-
tags that cause some other action besides returning formatted data do not work. The
following sub-tags are not supported: ADDVAR, CONCATVAR, NEXT, PREV, SETFORM,
SETVAR, SETWFATTR, SETWFFORM.

4.24.9 Calling Sub-WebReports


A script can directly call another WebReport using the following dot function:

184 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.24. Server-Side Scripting

Function Parameters Returns


Assoc nodeid: a String or Integer In all cases an Assoc is
._subWebReport(Dynamic value specifying the nodeid returned with a key ok
nodeid, [String of the report to run. holding a Boolean value that
<parms>], [String is TRUE if the call was
<option>]) <parms>: an optional String successful. If unsuccessful
containing the parameters to there is a further key err
pass to the sub-WebReport . containing an error String. If
The required format is: successful, the additional
'PARM:myParm1:myVal1 keys are as follows:
PARM:myParm2:myVal2'
• If <option> = output,
<option>: an optional or if <option> is not
String value of either specified, an Assoc
output, data or all with a key output is
selecting the required form of returned. The value for
the results (as shown the output key is a
following); defaults to String containing the
output. formatted output of the
sub-WebReport .
• If <option> = data an
Assoc with a key data is
returned. The value for
the key data is a
RecArray containing the
original data from the
sub-WebReport data
source.
• If <option> = all an
Assoc with both the keys
output and data are
returned.

Example: The following is an example which takes a NodeID (DataID) from the data source
and uses it as a parameter when calling a sub-WebReport. The script checks the sub-
WebReport call was successful and either outputs the result or an error message:
[LL_WEBREPORT_STARTSCRIPT NAME:callSWR /]
Function string callSWR(Dynamic c)
Assoc result
String parm = Str.Format('PARM:inputlabel1:%1', c.data[1].DataID)

result = ._subWebReport(._repTag('$report'), parm, 'output')

if result.ok
return result.output
else
return result.err
end
end
[LL_WEBREPORT_ENDSCRIPT /]

[LL_WEBREPORT_CALL NAME:callSWR /]

In this example ._repTag returns the value of a constant that points to the sub-WebReport
required.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 185


Chapter 4 WebReports Advanced Information

4.24.10 Script Scope and Calling a Script From Within a Script


WebReports supports defining multiple scripts within the same reportview as long
as each script has a unique name within the reportview. A script can call another
script from the same reportview, but not a script defined in another reportview.
Therefore script names do not need to be unique across all reportviews in Content
Server.

Note that multiple oscript functions may also be declared within a single script
block. For example, between [LL_WEBREPORT_STARTSCRIPT /] and [LL_
WEBREPORT_ENDSCRIPT /]. Functions within the same script block may call each
other. However, only the first function declared in any script block can be called
from another script block, or from the reportview using [LL_WEBREPORT_CALL /].
One can think of a script block as a discrete oscript feature within the Content Server
builder which behaves the same way in this respect. Readers familiar with
JavaScript should note that the rules described here are quite different from those
that apply to JavaScript.

To call another script in the reportview, preface the name of the script block with a
“.” dot.

Example: This is illustrated in the following, somewhat contrived, example that performs an
HTML escape on every item of data in the Name column and concatenates them together
separated by semi colons:
[LL_WEBREPORT_STARTSCRIPT NAME:escape /]
function String escape(String input = '')
return Web.EscapeHTML(input)
end
[LL_WEBREPORT_ENDSCRIPT /]

[LL_WEBREPORT_STARTSCRIPT NAME:Main /]
function String anyName(Dynamic context)
String s
Integer i
if isDefined (context.data) // check there is a data source
for i = 1 to length (context.data)
s += .escape(context.data[i].Name) + '; '
end
end
return s
end
[LL_WEBREPORT_ENDSCRIPT /]

[LL_WEBREPORT_CALL NAME:Main /]

186 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.25. Sorting WebReports Results

4.25 Sorting WebReports Results


The WebReport content control tag [LL_WEBREPORT_SORT "<Sort Keys>":ASC/DESC
<More Sort Keys> <Global Direction> /] makes it possible to sort data using one
or more columns from the data source specified as sort keys.

Note: For more information about the SORT content control tag , see the
Dynamic Tag Guide. For information about how to access the Dynamic Tag
Guide, see “To Access the Dynamic Tag Guide” on page 77.

Each sort key contains a quoted column reference, <Sort Keys>, followed by an
optional colon : and direction parameter, ASC or DESC. There is also the option to
specify a <Global Direction>, that specifies if values should be sorted in ascending or
descending order.

Examples include the following:

• [LL_WEBREPORT_SORT "dataid":DESC /]
• [LL_WEBREPORT_SORT "dataid" "1" DESC /]

There are three different ways to specify the column reference for each sort key:

• Specify a column number from the data source. A numeric value representing
the column number from left to right in the data source can be used. For
example, [LL_WEBREPORT_SORT "1" /].
• Specify a column name from the data source. A text value representing the name
of one of the columns used in the data source can be used. For example, [LL_
WEBREPORT_SORT "dataid" /].

• Specify a WebReports tag and sub-tags to be used as a sort key. This function
allows the sort to be based on different criteria than the usual data returned by
the column. For example: [LL_WEBREPORT_SORT "[LL_REPTAG=DATAID
NODEINFO:NAME /]" /]. In this example, rather than sorting on the DataId
column, the sort will be based on the name of the DTree object which is returned
by NODEINFO:NAME.

Multiple sort columns can be specified, allowing the user to sort within a sort and so
on. As an example, we could sort by the first column, and within this we could sort
on the second column, and within this, the third column. Here is how the syntax
might look followed by an example of the output.

[LL_WEBREPORT_SORT "1" "2" "3" /]

column 1 column 2 column 3


a 27 zucchini
b 1 apple
b 8 carrot

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 187


Chapter 4 WebReports Advanced Information

column 1 column 2 column 3


b 8 zucchini
d 1 potato

The previous methods can be combined to provide sorting on multiple key values as
shown in the following examples:

1. [LL_WEBREPORT_SORT "1":ASC "name" "[LL_REPTAG_3 DECODE:1:Active:


2:Inactive /]":ASC /]

This sorts by:


a. the first column explicitly in the ascending direction,
b. then the name column, also in the ascending direction by default,
c. then, depending on the value in column 3, it is either sorted on the column
Active or Inactive, also ascending.

2. [LL_WEBREPORT_SORT "1" "name":DESC "[LL_REPTAG_3DECODE:1:Active:


2:Inactive/]" /]

This sorts by:


a. the first column ascending, by default,
b. then the name column descending,
c. then sorted on the third column, having first converted any values of 1 to
Active and any values of 2 to Inactive.

In addition to the direction parameter that can be optionally specified for each sort
key, the SORT function also supports a global direction parameter to specify the sort
direction, ascending or descending, to be used for all sort keys that do not have a
direction specified.

DESC or ASC should be used without the colon. Some older syntaxes are still
supported. If this parameter is not specified, the direction defaults to ascending, ASC.
For example:

[LL_WEBREPORT_SORT "1" "2" DESC /]

In this example, the data set will be sorted in descending order of column 1 followed
by descending order of column 2.

Advanced Notes
This tag is always placed within a row section, for example after the [LL_
WEBREPORT_STARTROW /] and before [LL_WEBREPORT_ENDROW /]. You can have
multiple SORT tags in a row section, although this is typically unnecessary because
each SORT tag supports multiple keys.

When using a WebReports tag and sub-tags as the sort parameter, any results that
are numeric or in a valid date form as defined in the Content Server system, will be
sorted as integer and date types respectively.

188 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.25. Sorting WebReports Results

When using the SORT tag, you can use parameter or constant tags as part of the tag
syntax. This is useful to allow content to be sorted according to a value that has been
passed as a parameter or a constant. For example:

[LL_WEBREPORT_SORT"[LL_REPTAG=DATAID NODEINFO:[LL_REPTAG_&nodefield/
]/]":[LL_REPTAG_&direction/]/]

In this example, a URL parameter could be passed to specify which NODEINFO:


should be used. A direction could also be passed in this example.

Note: For the &nodefield parameter, the tag would not work correctly if no
value had been passed as nodefield. The Parameter Default feature should be
used to provide a default parameter in situations like this.

4.25.1 Pre-defined Sort Parameters


This feature allows complex sort keys to be associated with simple references that
can be passed in the URL. This feature is particularly useful when setting up reports
that are sorting using WebReports tags and sub-tags. When the user selects a column
for sorting, it can be difficult to pass the necessary tag syntax in the URL in order for
the SORT tag to run. To solve this problem, this feature allows you to specify:

• The name of one or more parameters that should be checked in the URL.
• A series of reference words and their associated tag syntax.

When this is set up correctly, each specified parameter is checked to see if one of the
predefined reference words has been found. If a specified reference word is found in
the URL parm then the corresponding syntax for this word is inserted into the SORT
tag.

To provide this functionality, two “directives” are provided that can be included
within the SORT tag. The concept of a “directive” exists in other content control tags,
such as the INSERTJSON tag. It refers to a syntax command preceded by an @
symbol. Each directive may have one or more additional pieces of information. The
two directives supported by SORT are @PARMNAMES and @PREDEFKEY. These directives
are explained in depth in the following content.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 189


Chapter 4 WebReports Advanced Information

Directive Description
@PARMNAMES One or more of these directives can
optionally be specified. If none of these
SORTCOL:<sortcolname> directives are specified, and a predefined
key, such as @PREDEFKEY, in the next row, is
DIRCOL:<directioncolname> specified, then it is assumed that the
parameters &sort and &direction will be
used to pass any sort or directional
references. For each @PARMNAME directive
that is supplied, an alternative URL
parameter name can be specified for either
the sort column or the sort direction. The
ability to specify more than one @PARMNAME
directive allows multiple sort columns to be
specified. These parameters are used in the
order of the @PARMNAME directives specified
in the SORT tag. For example, given the
following set of directives:

@PARMNAMES SORTCOL:sortcol1
DIRCOL:coldir1

@PARMNAMES SORTCOL:sortcol2
DIRCOL:coldir2

@PARMNAMES SORTCOL:sortcol3
DIRCOL:coldir3

If the URL contained:

&sortcol3=parentid&sortcol1=Name&
sortcol2=dataid

the SORT would run based on: Name, DataID


and then ParentID, in that sequence.

Note: Normally, the value of each of


these parameters will specify one of
the predefined keys as set up by the
following PREDEFKEY directive.

190 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.26. Using Sub-WebReports

Directive Description
@PREDEFKEY This directive sets up a simple identifier that
you can use to reference a complex tag/sub-
REF:<reference key> tag type sort key. This allows the client
application to specify a simple key as a sort
PARM:<tag/sub-tag syntax> parameter rather than a large chunk of
WebReports tag and sub-tag information. For
example, if a particular column contains the
following syntax: [LL_REPTAG=DATAID
CAT:somecat:attr1:DISPLAY /] and we
want to sort using this data, we could set up
a key as follows:

@PREDEFKEY REF:col3 PARM:"[LL_


REPTAG=DATAID
CAT:somecat:attr1:DISPLAY /]"

With this definition in place, &sort=col3 in


the URL, or POST request, would tell the
SORT tag to use [LL_REPTAG=DATAID
CAT:somecat:attr1:DISPLAY /] as a
SORT key. Several such predefined keys can
be created, one for each column that could be
sorted. Usually this feature is only used
where the sort key is complex, such as in the
example.

4.26 Using Sub-WebReports


A WebReport can call another WebReport (a “sub-WebReport”) whose results will
be returned and inserted into the parent report at the point where the tag is placed.
Sub-WebReports can be thought of as “sub-routines” that form part of the overall
report results. This tag is particularly useful where you want to collect the results
from several different queries (e.g. LiveReport SQL queries) and present them in a
single report. For example, it is often simpler to use two or more simple SQL queries
in place of one complex one or you may want to combine results from a SQL query
with results from a search query.

A WebReport can call a sub-WebReport by using the RUNSWR sub-tag, for example
[LL_REPTAG_'<Sub-WebReport ID>' RUNSWR /]. For more information about the
RUNSWR sub-tag, see the Dynamic Tag Guide. For more information about how to
access the Dynamic Tag Guide, see “To Access the Dynamic Tag Guide” on page 77.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 191


Chapter 4 WebReports Advanced Information

4.26.1 Parameters
You can pass parameters to a sub-WebReport: [LL_REPTAG_'<Sub-WebReport ID>'
RUNSWR:<Parameter name>:<Integer value>:<Parameter name>:"<String
value>" /]. For example, [LL_REPTAG_'123456'
RUNSWR:InputLabel1:299:myStatus:"awaiting review" /].

4.26.2 Inheritance
A sub-WebReport will inherit parameter and constant values from a calling
WebReport implicitly. For example, if the calling WebReport has a parameter
defined called nodeID, this value can be read by the sub-WebReport using [LL_
REPTAG_&nodeID /] regardless of whether or not the nodeID is passed to the sub-
WebReport as an argument in the [LL_REPTAG_'<Sub-WebReport ID>' RUNSWR /]
call.

If a parameter or constant is defined in both the calling WebReport and the sub-
WebReport, then the value defined in the sub-WebReport will be used by the sub-
WebReport.

If a parameter value is defined in the sub-WebReport, then if it is passed as an


argument in the [LL_REPTAG_'<Sub-WebReport ID>' RUNSWR /] call then the
passed value will be used by the sub-WebReport.

The following table illustrates how parameter inheritance works, where the first
WebReport is calling the second WebReport as a sub-WebReport.

Main WebReport Sub-WebReport Comment


(&fruit) (&fruit) Result of (&fruit) (&fruit) Result of
Default Request [LL_ Default Passed [LL_
Value Value REPTAG_& Value Parameter REPTAG_&
fruit /] Value fruit /]
Pear Pear <not passed> Pear Inherited
from main
WebReport
.
Apple Apple <not passed> Apple Inherited
from main
WebReport
.
Apple Pear Pear <not passed> Pear Inherited
from main
WebReport
.

192 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.26. Using Sub-WebReports

Main WebReport Sub-WebReport Comment


Apple Apple Orange <not passed> Orange Not
passed,
uses sub-
WebReport
default
value.
Pear Pear Orange <not passed> Orange Not
passed,
uses sub-
WebReport
default
value.
Apple Pear Pear Orange <not passed> Orange Not
passed,
uses sub-
WebReport
default
value.
Apple Pear Pear Orange Grape Grape Passed
parameter
value used
instead of
sub-
WebReport
default
value.

4.26.3 Returning a nodeID to the calling WebReport if the sub-


WebReport has a destination of Content Server
If the destination of the sub-WebReport is a Content Server Node, then the nodeID
can be returned to the calling WebReport by adding the SHOWNODEID argument to
the call. For example, if using RUNSWR, add to the end of the arguments list: [LL_
REPTAG_'123456' RUNSWR:InputLabel1:299:myStatus:"awaiting
review":SHOWNODEID /]

For more information about the RUNSWR sub-tag , see the Dynamic Tag Guide. For
information about how to access the Dynamic Tag Guide, see “To Access the Dynamic
Tag Guide” on page 77.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 193


Chapter 4 WebReports Advanced Information

4.27 Using Variables


Various components in WebReports support the concept of variables. Variables
provide the ability to store and accumulate results from other tags for output into
the reportview. Variables are supported by the following tag and sub-tags:

• The LL_REPTAG_%variablename tag returns whatever is stored in a variable


represented by <variablename>. The <variablename> is a set of valid characters, for
example with no spaces or special characters. The <variablename> should match
with a variable previously created by one of the sub-tags which support variable
setting.
• The SETVAR sub-tag that allows any tag result to be stored in a named variable.
• The ADDVAR sub-tag that allows any numeric tag result to be added to the
numeric value in a named variable.
• The CONCATVAR sub-tag that allows any text/string based result to be
concatenated to the text in a named variable.
• The CURRENTVAL sub-tag that returns the current value of a variable or the result
of a variable action sub-tag.

For more information about these sub-tags, see the Dynamic Tag Guide. For
information about how to access the Dynamic Tag Guide, see “To Access the Dynamic
Tag Guide” on page 77.

Note: When you use the SETVAR, ADDVAR, and CONCATVAR sub-tags, they
usually do not return the result to the output unless you also use the SHOW sub-
tag, as in: [LL_REPTAG_@SUM ADDVAR:subtotal SHOW /].

For more information about these sub-tags, see the Dynamic Tag Guide. For
information about how to access the Dynamic Tag Guide, see “To Access the
Dynamic Tag Guide” on page 77.

Use variables within row sections to accumulate numbers or strings from multiple
rows. This is most useful for concatenating string values into a single string, which
you can use anywhere that you can use the variable tag, including export fields such
as the E-Mail To: list.

Example: [LL_REPTAG=USERID USERINFO:EMAIL CONCATVAR:tolist:"," /]

If this tag was used in a row section, between the STARTROW and ENDROW tags, it would build
a string of email addresses with a comma separating each email address.

Example: [LL_REPTAG=cost ADDVAR:subtotal /]

If this tag was used in a row section, between the STARTROW and ENDROW tags, it would add
the value of the column “cost” for each row to the variable called subtotal. For more
information, see the STARTROW and ENDROW content control tags in the Dynamic Tag Guide.
For information about how to access the Dynamic Tag Guide, see “To Access the Dynamic Tag
Guide” on page 77.

194 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.28. WR Services

Use variables as operands for [LL_WEBREPORT_IF (expression) [:USECASE] /]


[LL_WEBREPORT_ELSEIF (expression) [:USECASE] /] (optional)
[LL_WEBREPORT_ELSE /] (optional) [LL_WEBREPORT_ENDIF /], [LL_
WEBREPORT_INCLUDEIF expression /], or [LL_WEBREPORT_EXITIF /] or
[LL_WEBREPORT_EXITIF (expression) [:USECASE] /] conditional tags.

4.28 WR Services
The WR services feature provides a way of retrieving information from the
WebReports engine. One of the most useful examples of this is a service that allows
tags and sub-tags to be specified in a request that returns the resulting data without
the need to create a WebReport or ActiveView object. This capability provides a way
to leverage the vast number of useful functions that are available through the
WebReport engine sub-tags and static tags. Use a single call to the WR service
feature to bring back the result of a tag, or literal data, processed through a virtually
unlimited list of sub-tags. For example, a service call could be made to return
category or attribute information using the CAT sub-tag. The result of a service call
can be returned as text directly to the client that invoked the feature, or you can
specify formats as XML or JSON. If you use XML or JSON to return data from a
service call, the content is accompanied by an error field that allows any client
application to programmatically check for errors. This feature is particularly suited
to being invoked using AJAX calls, especially if the JSON response type is used. The
ActiveView or WebReports software includes a pre-defined JavaScript function that
provides an easy way to invoke these services using AJAX.

This is an example of invoking a tag/sub-tag lookup service using a simple GET type
URL:

<prefix>?func=webreports.runservice&servicetype=gettagdata&
tagdata=<TAGDATA>&statictag=<STATIC TAG name>&subtags=<SUBTAGLIST>

All service requests include the parameter: ?func=webreports.runservice as a


starting point, followed by the &servicetype= parameter that selects one of the
supported services. For more information about valid values for &servicetype=, see
“Available Service Types” on page 196. Depending on which service is selected,
there may be additional parameters required as specified in the following table. Use
these parameters in GET or POST requests, using AJAX or traditional form fields to
submit the request.

Note: When using AJAX, ?func= is replaced with &func= for POST type
requests.

In some cases, you must include a percent sign (%) in the request sent to WR
Services. To avoid this percent sign being interpreted as URL escaping, you
must use a URL code to specify a percent sign. Specifically, wherever the “%”
character is required, you must use %25 because this code resolves to a percent
sign.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 195


Chapter 4 WebReports Advanced Information

Available Service Types


Valid Values for ?func=webreports.runservice&servicetype=

&servicetype= Description
gettagdata This service allows the running of static tags
and or sub-tags from the WebReports engine
to be invoked directly. This capability
provides a way to leverage the vast number
of useful functions that are available through
the engine, particularly with the ability to
access the 60+ sub-tags and several static
tags. Many of the sub-tags provide the ability
to access some useful Content Server
functions, such as looking up categories and
attributes, testing group membership and
even performing Content Server actions,
subject to normal permissions controls.

This service can use the following


supplementary parameters: TAGDATA,
STATICTAG, SUBTAGS, and RESPONSETYPE.
For more information about these
supplementary parameters, see “gettagdata
and getstatictags Supplementary
Parameters” on page 197.
getsecuretoken This service returns a valid
“securerequesttoken” that should be added
to any requests that contain secure sub-tags
using the syntax: &
securerequesttoken=<nnnnnnnnn>,
where <nnnnnnnnn> is the token returned by
the getsecuretoken service. The token
returned in the response is URL escaped and
in most cases will need to be unescaped
using the decodeURIComponent()
function in JavaScript.

This feature prevents Cross Site Request


Forgery and is used for any sub-tags defined
as “secure” using a setting in the system
preferences for [WebReports] in the
opentext.ini file called
SecureServicesSubtags.

For more information about the opentext.


ini file, see “INI Preferences” on page 133.

196 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.28. WR Services

&servicetype= Description
getstatictags This service returns all appropriate static
values from the WebReports engine in a data
structure according to the ??? on page 199
parameter; however, only the ???
on page 200 responsetype is currently
supported. Static tags are all of the tags in the
WebReports tag guide that come under the
heading of data tags and which have fixed
names, such as [LL_REPTAG_DATETIME /].

This service can use the following


supplementary parameter: RESPONSETYPE.
For more information about this
supplementary parameter, see ???
on page 199.
liststatictags This service provides a simple list of all the
static tags that are available for usage in the
gettagdata and getstatictags services.
It is primarily used for the convenience of
developers.

gettagdata and getstatictags Supplementary Parameters

Parameter Name Mandatory Description


TAGDATA Yes, if no STATIC tag is Use this parameter to specify
specified or if the data to be operated on by any
STATICTAG returns an specified sub-tags. If you
empty string. have also specified a
statictag, the tagdata
will be ignored unless the
static tag returns a blank
string. This allows you to use
the tagdata as a default
value for situations where
the static tag does not return
a useful value.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 197


Chapter 4 WebReports Advanced Information

Parameter Name Mandatory Description


STATICTAG Yes, if TAGDATA is not Use this parameter to specify
specified. one of a selection of
WebReports static tags that
can be invoked. If the
specified tag returns a blank
string, then the value of
tagdata, if any, will be used
instead, otherwise, the
output from the statictag is
used by any sub-tags that
have been specified. The
static tag parameter does not
require the full WebReports
syntax; only the static tag
name is used. For example,
the [LL_REPTAG_USERID /
] tag would be invoked
using: &statictag=
USERID

Note: WebReports
services only supports
a small subset of the
available static tags. In
general, any static tags
that return information
about an executing
WebReport will not be
valid because there is
no WebReports object
associated with a
service call. To find out
which static tags are
available, you can use
the special
liststatictags
option as follows:
<prefix>?func=
webreports.
runservice&
servicetype=
liststatictags

198 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.28. WR Services

Parameter Name Mandatory Description


SUBTAGS Yes Specifies a list of sub-tags
and their fields, just as they
would be used in a
WebReports tag syntax. For
example, &subtags=
NODEINFO:NAME UPPER

As with WebReports usage,


these sub-tags are processed
from first to last with the
output from the static tag, or
the tag data, being passed to
the earliest sub-tag.
RESPONSETYPE No. The default is “string”. Allows different formats to
be specified for the data to be
returned by a service request.
Valid values are string,
json or xml.

For more information about


the valid values, see “Valid
Values for the
RESPONSETYPE
Supplementary Parameter”
on page 199.

Assuming that a service has


run successfully, there are no
errors, and the service has
returned the string: This is
a test, the following table
shows what each of the
different formats would
return.

Valid Values for the RESPONSETYPE Supplementary Parameter

Format Example MimeType Text Escaping


string This is a test text/html No unescaping
required

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 199


Chapter 4 WebReports Advanced Information

Format Example MimeType Text Escaping


json {“error”:false, text/json If the content is text
“content”:“This is a based, in other words
test”} non-numeric and
enclosed in quotes,
conventional string
escaping is used. For
example, back
slashes, \, are used
before any special
characters. For more
information, see the
JSON standard (RFC
4627) for more details
on string/text
escaping.
xml <?xml text/xml Content is HTML
version="1.0" escaped. One
encoding="ISO-88 example is & = &
59-1" ?
><response><erro
r>false</
error><content>T
his is a test</
content></
response>

4.28.1 Using the Predefined Functions


The ajax.js file packaged with WebReports includes a function designed to aid in
the use of WebReports services in conjunction with AJAX technology. AJAX
technology is Asynchronous JavaScript and XML. The ajax.js file is accessed using
a SCRIPT include like this: <SCRIPT SRC="/<support dir>/webreports/library/
ajax.js"></SCRIPT>

If you include this file in a WebReport or ActiveView, you can use the LIBPATH tag
as follows: <SCRIPT SRC="[LL_REPTAG_LIBPATH /]ajax.js"></SCRIPT>

The following table describes the executeWRService( serviceType, responseTarget,


parmList, responseType, getPost) function and its parameters:

Parameter Mandatory / Optional Description


servicetype Mandatory This parameter expects a
string with one of the
supported servicetypes for
running a WR service, as
specified in “Valid Values
for ?
func=webreports.runservice
&servicetype=” on page 196.

200 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.28. WR Services

Parameter Mandatory / Optional Description


responseTarget Mandatory This parameter expects either
a JavaScript function that has
been created by the
developer, or a string
representing the ID of an
HTML object where the
returned data should be
inserted. If a JavaScript
function is created, and
passed to this parameter, it
should be written to accept
the http_request as a
parameter. For example:
function myHandlerFunction(httpRequest) {
alert('the response was: '+ httpRequest.resp
}
executeWRService( 'gettagdata', myHandlerFun
&subtags=USERINFO:GROUPID", 'json')

parmList Optional This parameter specifies a


string containing additional
parameters to be added to
the URL as required by each
servicetype. For example, the
gettagdata service type
uses a combination of &
tagdata, &statictag or &
subtags according to the
syntax in “gettagdata and
getstatictags Supplementary
Parameters” on page 197. The
parameters should be
specified in the &name=
value type format. For
example, "&tagdata=
12345&subtags=
CAT:myCategory:attr1:
display"
responseType Optional This parameter expects a
string with one of the
supported response types for
WR services, string, json,
xml, as specified in “Valid
Values for the
RESPONSETYPE
Supplementary Parameter”
on page 199. If it is not
specified, it defaults to json.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 201


Chapter 4 WebReports Advanced Information

Parameter Mandatory / Optional Description


getPost Optional Use this parameter to specify
whether the AJAX request
should be GET or POST. If
omitted, the POST method is
used.
secure Optional Use this boolean (TRUE/
FALSE) parameter to specify
whether a secure token
should automatically be
added to the request. This is
only required when sub-tags
are included in the request
that are defined as requiring
security, for example an
admin setting. Usually these
will be action type sub-tags,
such as NODEACTION or
USERACTION.

Note: The INI file


defines whether a tag is
secure as described for
the getsecuretoken
in the “Valid Values
for ?
func=webreports.runse
rvice&servicetype=”
on page 196 table.

For more information about these sub-tags, see the Dynamic Tag Guide. For
information about how to access the Dynamic Tag Guide, see “To Access the Dynamic
Tag Guide” on page 77.

Examples
Example 4-34: executeWRService( serviceType, responseTarget,
parmList, responseType, getPost )

This example shows two different ways to call the gettagdata service using
the predefined function: executeWRService. In one instance, we have written a
special function called handleServiceJSON which is designed to “eval” the
JSON data, in other words convert the JSON data to Javascript objects, and use
the resulting JavaScript structures to display the result of the request.

In this request we are using &tagdata= with a data ID and then using the
NODEINFO:NAME sub-tag variation to look up the name of an item. Note that
because we requested a responseType of “json”, the resulting data structure
includes a field called “error”, which indicates whether we have valid data or
not.

202 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.28. WR Services

In the handleServiceJSON function, we use this field to determine whether to


alert an error or to display the content. In the second instance with the Get URL
button, we pass the name of an HTML object on the page. When the request
returns from Content Server, it automatically inserts the resulting text into the
specified HTML component. Because we want text dumped into the page and
we do not plan on analyzing the response for errors or handling it
programmatically, the reponseType of “string” was selected in this example.

<SCRIPT SRC="[LL_REPTAG_LIBPATH /]ajax.js"></SCRIPT>


<script>

function handleServiceJSON(request) {
var rt = request.responseText;
var jsvar = eval('(' + rt + ')')
var error = jsvar.error;
var content = jsvar.content;
if (error == 'true') {
alert('error text is: ' + content);
} else {
alert('Object name is:' + content);
}
}

function getName(did){
did = document.getElementById('dataid').value;
getNameParms = '&tagdata=' + did + '&subtags=nodeinfo:name';
executeWRService( 'gettagdata', handleServiceJSON,getNameParms,'json');
}

function showURL(did){
did = document.getElementById('dataid').value;
getURLparms = '&tagdata=' + did + '&subtags=LLURL:OPEN';
executeWRService('gettagdata', 'displayname', getURLparms,'string');
}
</script>

<input type=text value="[LL_REPTAG_MYID /]" ID=dataid>&nbsp;&nbsp;URL:&nbsp;<SPAN


ID=displayname></SPAN><br>
<input type=button value="Get Item Name" onclick=getName()>&nbsp;<input type=button
value="Get URL" onclick=showURL()>

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 203


Chapter 4 WebReports Advanced Information

Example 4-35: executeWRService( serviceType, responseTarget,


parmList, responseType, getPost )

This example shows how to use the getstatictags service. The service is
invoked using the executeWRService function in ajax.js. Besides using the
identifier “getstatictags” to select the correct service, a function called
handleStaticTags, specifically written for this sample application, is passed
to the executeWRService function which in turn, sets up a request to Content
Server. The request is set up so that when the request returns from Content
Server, the handleStaticTags function is called. In this example, we've
written code in handleStaticTags to take the JSON structure from the
request.responseText, convert it to a JavaScript structure and then traverse
this structure to show all the static tag values that were returned from Content
Server.
<SCRIPT SRC="[LL_REPTAG_LIBPATH /]ajax.js"></SCRIPT>
<script>

function handleStaticTags(request) {

var rt = request.responseText;
var jsvar = eval('(' + rt + ')')
var error = jsvar.error;
var content = jsvar.content; // This should be an array of tags

if (error) {
alert('error text is: ' + content);
} else {
tempStr = '';
for (tag in content) {
tempStr += tag + ' = ' + content[tag] + '<br>';
}
document.getElementById('display').innerHTML = tempStr;

}
}

function getStaticTags(){
executeWRService( 'getstatictags', handleStaticTags,'json');
}

</script>
<input type=button value="Get Static Tags" onclick=getStaticTags()>
<hr>
<DIV ID="display">

</DIV>

204 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.29. WR Trigger

4.29 WR Trigger
The WR Trigger feature allows WebReports to be initiated by specific events in
Content Server. For node types that have been enabled with the WR Trigger feature,
the WebReports developer can choose to initiate a WebReport for a number of
Content Server events. By default, the WR Trigger feature is off and can be enabled
for each node type in the administration pages under WR Trigger Administration.
The Content Server events for which you can initiate a WebReport are:

• Add Version
• Category Update
• Copy Destination
• Copy Source
• Create

Important
Content Server modules can have their own trigger event types. For
example, for a Business Workspace node type, you must use the Create
Workspace event instead of the Create trigger event.
• Create Workspace

Note: This trigger event type appears when the Connected Workspaces
module is enabled. You must use this trigger event for a Business
Workspace node type, instead of the Create trigger event.
• Delete
• Finalize Record

Note: The Records Manager may assign additional permissions for Finalize
Record.
• Move Destination
• Move Source
• Records Management Accession Search
• Records Management Disposition Search
• Rename
• Reserve
• Unreserve
• Update

By default, the WR Trigger tab will be accessible by any user that has Modify
permission against a node for which WR Trigger is enabled. Administrators can
restrict access to selected users and groups by using the Administer Object and
Usage Privileges page in the System Administration section of the administration
area. The Usage Privileges section contains an entry for WR Trigger Tab which sets
the restrictions.

Show WebReports
For each WR Trigger event that you add, you can also enable the Show WebReport
feature. After the trigger initiates the WebReport and after all the callbacks are

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 205


Chapter 4 WebReports Advanced Information

finished, if Show WebReport is enabled, the WebReport will also show its output in
the browser

Note: Show WebReport only takes effect in Classic View, not Smart View.

4.29.1 Adding or Deleting a WR Trigger


To add or delete a WR Trigger:

1. For a node subtype for which WR Trigger is enabled, such as Document, Folder,
or WebReport, on the Functions menu, click Properties, then choose WR
Trigger.

2. On the WR Trigger tab, do one of the following:

• To add a WR Trigger event, go to Step 3.


• To delete a WR Trigger event, go to Step 4.

3. Click the Click here to Add new WR Trigger button .

a. In the Trigger Event list, select the trigger event.


b. In the Inheritance list, select the inheritance behavior that you want.
c. In the WebReports Action box, click Browse Content Server and browse to
the WebReports action.
d. Optional Select the Show WebReport check box. For more information, see
“Show WebReports” on page 205.
e. Continue to Step 5.

4. On the row for the WR Trigger that you want to delete, click the Delete Row
button .

5. Click Update.

4.29.2 General Usage


The WR Trigger feature is accessed using a new WR Trigger option in the properties
section of the Functions menu, which brings up a new tab. The menu and
subsequent tab can only be accessed for subtypes that have the WR Trigger feature
enabled. Triggers can be set on individual objects or they can be set on containers
and cascaded down a hierarchy, which provides a convenient way to set triggers on
a large volume of items.

Important
Since Content Server 16, the new Recycle Bin mechanism changes how WR
Trigger behaves when used with the Delete trigger event. In versions of
Content Server before Content Server 16, sending a node to the Recycle Bin on
deletion would trigger a Move event rather than a Delete event. The
mechanism implemented for Content Server 16 and later releases always sends

206 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.29. WR Trigger

nodes to Recycle Bin and always triggers a Delete event rather than a Move
event. This is an important change if you are upgrading from a system that had
the Recycle Bin optional module installed. Any customers who upgrade to
Content Server 16 and who previously used a Move trigger to capture a delete
that sends an item to the Recycle Bin will need to update their triggers to use
the Delete trigger event in Content Server 16.

When a root node, a container with other items in it, is copied, moved, or deleted,
the trigger occurs on the root node only. No WebReport will be initiated for
individual sub items. If a WebReport needs to be initiated for each specific item, it
can be achieved using a query that takes the node that initiated the trigger to find all
the children, then use a sub-WebReport to implement the specific behavior, for
example to trigger a Workflow.

All triggers are initiated after the event has occurred with the exception of Delete.
For example, if using [LL_REPTAG_TRIGGERID NODEINFO:PARENTID /] in a
WebReport that has been initiated by a Move trigger event, the objectid of the new
parent will be returned. For more information about accessing the original, see the
TRIGGERDESTPARENTID content control tag in the Dynamic Tag Guide. For
information about how to access the Dynamic Tag Guide, see “To Access the Dynamic
Tag Guide” on page 77.

With the delete trigger, the event is fired just before the delete so that we have the
maximum metadata available. After a node is truly deleted, it no longer exists and
has no valid metadata. The Show WebReport feature redirects the user browser
session to a WebReport after the delete callback completes. To ensure that the delete
trigger has metadata available, you must clear the Show WebReport check box, or
select data pertaining to the node indirectly through a LiveReport or other means.

When a document is added to Content Server, both the Create trigger and the Add
Version trigger are fired. This is because Content Server sees this as two actions.
First a node creation occurs and once the node is created a new version, in this case
version 1, is added to that node. If a folder were added, only the Create trigger
would fire.

Notes

• You can use the Just this node setting for actions such as Category Update
and Update. However, it is not valid for the Create Trigger action To apply WR
trigger inheritance to both the node and its direct descendants, you can use
the This Node and All Children option and add a RUNIF statement to the
report to check whether the parent folder is correct. For example:
[LL_WEBREPORT_RUNIF "[LL_REPTAG_TRIGGERID NODEINFO:PARENTID /]" == "[LL_REPTAG_
$FOLDER /]" /]

• Be careful with WR Trigger and inheritance to avoid creating an endless


loop. For example, if you use WR Trigger for the Create event on a Folder to
initiate a WebReport to create a Folder and set it to inherit to children, then
you’ve created an infinite loop. Always consider what your WebReport is
doing and whether it could initiate another WR Trigger.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 207


Chapter 4 WebReports Advanced Information

• [LL_REPTAG_$FOLDER /] is a constant that points to the root trigger folder.


• For more information about constants, see “WebReports Constants”
on page 65.

4.29.3 User or Group Triggers


The WR Trigger feature also supports triggering based on User- or Group-related
events. This can be configured in the administration pages under User/Group WR
Trigger Administration. The WebReports developer can choose to initiate a
WebReport based on the following User/Group events:

• Add User to Group


• Create User/Group
• Delete User/Group
• Update User/Group
• User Login

When the Global check box is selected, any time one of the selected trigger events
triggers within Content Server, regardless of who ran it, the specified WebReport
runs. Otherwise, if a User or Group is specified, the Global check box is cleared, the
WebReport runs if the trigger event happens within the group or to the user. For
example, if creation, deletion or addition, among others, happen in the group, and
not explicitly on the group itself, then the WebReport will initiate. For a user, the
trigger event needs to happen on the user. This means that not all trigger events are
relevant to users and are, therefore, ignored.

4.29.4 WR Trigger Tags


WR Trigger supports the following feature specific data tags which are detailed in
the Dynamic Tag Guide. For information about how to access the Dynamic Tag Guide,
see “To Access the Dynamic Tag Guide” on page 77.

• [LL_REPTAG_TRIGGER /]
• [LL_REPTAG_TRIGGERDESTPARENTID /]
• [LL_REPTAG_TRIGGERID /]
• [LL_REPTAG_TRIGGERNEWID /]
• [LL_REPTAG_TRIGGERNEWNAME /]
• [LL_REPTAG_TRIGGEROLDNAME /]
• [LL_REPTAG_TRIGGERSNAPSHOTDATE /]
• [LL_REPTAG_TRIGGERSOURCEPARENTID /]
• [LL_REPTAG_TRIGGERADDEDCATEGORIES /]
• [LL_REPTAG_TRIGGERCATEGORYVALUECHANGES /]
• [LL_REPTAG_TRIGGERDELETEDCATEGORIES /]

Example:

To Initiate a Workflow and attach a document to it when a new item is created:


1. Set the WebReport destination to the Workflow you want to initiate by clicking the
WebReport Functions icon, then selecting Properties > Destination.

208 WebReports User Guide LLESWEBR230300-UGD-EN-01


4.30. Preventing XSS-vulnerable Syntax in a Parameter Tag in a Reportview

2. On a folder a level higher, where the item will be created, click the Functions menu, then
select Properties > WR Trigger. On the folder WR Trigger tab, select the WebReport to
run and select the Create event as the trigger.
3. In the WebReport, set the item that initiates the event to be attached to the Workflow. Do
this by editing the reportview and using:
[LL_REPTAG_TRIGGERID SETWFATTACH:COPY:INHERITATTRS:MERGED /]
TRIGGERID is the id of the object that initiated the event and
SETWFATTACH:COPY:INHERITATTRS:MERGED copies this node to the attachments
folder merging the categories of the node with those of the attachments folder. For more
information, see the SETWFATTACH sub-tag , see the Dynamic Tag Guide. For information
about how to access the Dynamic Tag Guide, see “To Access the Dynamic Tag Guide”
on page 77.

Notes
• Rather than initiating a Workflow, the WebReports destination tab could be set to
send an email. To attach the item that fired the event to the email destination use
[LL_REPTAG_TRIGGERID /]. Note that you can use SETWFATTACH and
SETEMAILATTACH multiple times to attach several items to the destination. For
more information, see the SETEMAILATTACH sub-tag , see the Dynamic Tag Guide.
For information about how to access the Dynamic Tag Guide, see “To Access the
Dynamic Tag Guide” on page 77.
• The Show WebReport option in the WR Trigger tab should only be selected if the
event is triggered manually by a Content Server user. If the event is caused by a
WebReport, for example NODEACTION, this option should be left cleared because
Show WebReport is not applicable. For information about the NODEACTION sub-
tag, see the Dynamic Tag Guide. For information about how to access the Dynamic
Tag Guide, see “To Access the Dynamic Tag Guide” on page 77.
• Avoid creating a Folder trigger with the Add Version trigger event selected, and
the initiating WebReport outputting a new Content Server document, Output
Destination=Content Server, to the same folder. This causes the trigger on the
folder to be recursively fired and results in a Content Server error.
• When applying a WR Trigger to a container to trigger a WebReport based on an
object being moved, created, or copied into that container, ensure both the
container subtype, and the subtype of the object to be placed in the container, are
selected on the Manage WR Triggers page.

4.30 Preventing XSS-vulnerable Syntax in a


Parameter Tag in a Reportview
WebReports reportviews and ActiveView templates are built using a tag-based
syntax. These tags can be chained together to retrieve information or perform
various actions in the system. The Parameter data tag, [LL_REPTAG_&<parmName>/],
provides access to a parameter value in the request. For example: the [LL_REPTAG_&
sortDirection /] tag resolves to the value of the sortDirection parameter in the
request. This syntax is usually used to surface data from the request, either to pass to
additional WebReports (example: passing data to a Sub-WebReport) or to change
aspects of the current ActiveView override (example: changing the current page
size). The parameter values are resolved at runtime without any additional
validation occurring behind the scenes.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 209


Chapter 4 WebReports Advanced Information

If left unvalidated, the Parameter tag can create Cross-Site Scriping (XSS)
vulnerabilities in a WebReports reportview or in an ActiveView template. For
example: if you place a Parameter tag inside an HTML input field or in a JavaScript
block, but the parameter is unvalidated, the resulting syntax could be vulnerable to
XSS. To illustrate, consider the following code:
<input type="hidden" name="count" value="[LL_REPTAG_&count /]">

In this case, the [LL_REPTAG_&count /] tag is replaced with the value of the count
parameter from the request. This syntax is vulnerable to XSS because the count
value is not validated. The count parameter value could contain HTML syntax to
terminate the HTML input field early and inject additional HTML tags, including a
<script> block.

As with any other web development, the users developing WebReports reportviews
and ActiveView templates are responsible for validating their Parameter tags
because they understand the context of how the parameter is used. The following
list includes several sub-tags that are available to help validate the passed values:

• CHECKURL – checks a URL for potential XSS vulnerable syntax.


Example: [LL_REPTAG_&nextURL CHECKURL:"" /]
• ESCAPEFORJS – converts a string using the same encoding as the specified
JavaScript escape function.
Example: [LL_REPTAG_&userName ESCAPEFORJS:HEX /]
• INT – attempts to cast the data to an Integer. This is useful if the parameter value
is expected to be an Integer.
Example: [LL_REPTAG_&count INT /]
• TODATE – attempts to cast the data to a Date.
Example: [LL_REPTAG_&startdate TODATE /] Supports custom date formats as
well.

The Tag Guide, available from the ActiveView Online Editor, provides a full listing
of the available sub-tags as well as full details for each sub-tag.

210 WebReports User Guide LLESWEBR230300-UGD-EN-01


Chapter 5

Detailed WebReports Examples

The following sections detail some WebReports examples.

5.1 AJAX Examples


AJAX (Asynchronous JavaScript and XML) is a method of interchanging
information between web-based applications. Some of its benefits include the ability
to bring information to the browser in small pieces, as the user requests it, without
redrawing the entire page. If you're familiar with WebReports and simple web-
based development, you can probably see some of the benefits this can bring to an
individual report or an entire WebReports application. The following two examples
show where AJAX might be used.

5.1.1 Case 1 - Updating a Custom View with a WebReport


It has always been possible to use an IFRAME to run a WebReport within a Custom
View. Do this by using the following in a Custom View: <IFRAME SRC="?func=ll&
objId=xyz&objAction=RunReport"></IFRAME>.

When xyz is the object ID of the WebReport you want to run in the IFRAME. This
method has limitations but is very simple and can be useful.

A more flexible approach is to use the Ajax functions bundled with WebReports. The
functions allow you to call a WebReport from a Custom View or another WebReport
and use the returned data to dynamically update the current page. The following
simple example shows what might be used in a Custom View to dynamically update
it with information from a WebReport:
<SCRIPT SRC="/<your support dir>/webreports/library/ajax.js"></SCRIPT>
<SCRIPT>
updatePage( 1234, 'customView' );
</SCRIPT>

This simple piece of code consists of the following:

• An HTML DIV element with an ID of “customView”, not shown in this code.


This element is inserted by Content Server and wraps the entire Custom View.
This code uses Ajax to update the contents of this DIV. If you want to observe the
DIV, you need to perform a view source in your web browser and search on
“customView”.

Note: A DIV is unnecessary. You can use any HTML element where the
attribute innerHTML is writable.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 211


Chapter 5 Detailed WebReports Examples

• A JavaScript include file reference that contains the code to make and return the
Ajax request. Note that the tag [LL_REPTAG_LIBPATH /] returns the path to a
folder on the server that hosts Content Server, which contains the library file
ajax.js. However, because we are referencing the include file from a Custom
View we need to use a qualified path. In a WebReport we would only need the
tag and file name.
• The next element is a call to the library function: updatePage(). This function
takes two parameters. The first is the object id of the WebReport we are using to
retrieve the additional data. We could use a WebReports constant which resolves
to an object id if we are making the call from another WebReport. The second
parameter is the id of the HTML element that we want to update. In this case, we
are updating a Custom View and we know all Custom Views are wrapped by a
DIV with id, “customView”. This is what we update, noting the lowercase “c”
and uppercase “V” because JavaScript is case sensitive.

At this point we have a folder and we're updating its Custom View with data from a
WebReport. Although the information provided in the Custom View is dynamic, it
is not context sensitive. We could take this example a step further and make the
information displayed in the Custom View relevant to the current folder. By doing
this, we can use one centrally managed WebReport to provide dynamic information
which is specific to each folder. An example of this could involve displaying each
folders category information in its own Custom View. To do this we need to pass an
extra parameter to the WebReport so that we can retrieve the category information
relevant to this folder. Consider this example of what the updated call to
updatePage() might look like:
<SCRIPT>
updatePage( 1234, 'customView', '&folderid=' + getURLParm( 'objId' ) );
</SCRIPT>

The difference between this and the previous example is a third optional parameter,
folderid, which can be used by the Ajax report to retrieve information specific to
the folder we're in. The function getURLParm() accepts a parameter name and
returns the value that is associated with that parameter in the current URL. In this
example, we would end up with something looking like updatePage( 1234,
'customView', '&folderid=5678' ).

212 WebReports User Guide LLESWEBR230300-UGD-EN-01


5.1. AJAX Examples

Notes

• If you run the Ajax WebReport on its own, everything you see in the browser
will be returned to the main report. For this reason, remember to use [LL_
WEBREPORT_EXCLUDEHTML /] to turn off the standard Content Server
headers, footers and include files.
• Although we have called this an Ajax example, it is not true Ajax because
there is no XML component and we have not changed the destination MIME
type.
• While the functions mentioned earlier have been included to help the
average person achieve results as quickly as possible, more advanced users
could develop their own custom functions to achieve the same thing.

5.1.2 Case 2 - Dynamically Counting Filter Hits as the User


Types
This example demonstrates a filter field that will be used to automatically update a
HTML element, as the user types, showing how many results to expect when the
query runs. This type of functionality is particularly useful when dealing with large
result sets so that the user knows how many results to expect before issuing the
query. It can also be a great time saver when network latency is impacting
performance.

Create a very simple LiveReport that counts the number of matches for a given
string. Something like: select count(*) hits from dtree where name like '%1%'

Define the parameter, %1, as type insertString. The LiveReport should prompt for
user input and count all items that start with the letters provided.

Next, add a new WebReport that uses this LiveReport as its data source. Edit this
WebReport and create a very simple XML schema so that you have something that
looks like:

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 213


Chapter 5 Detailed WebReports Examples

<?xml version="1.0" encoding="ISO-8859-1" ?>


[LL_WEBREPORT_STARTROW /]
<[LL_REPTAG_COLNAME1 /]>[LL_REPTAG=HITS /]</[LL_REPTAG_COLNAME1 /]>
[LL_WEBREPORT_ENDROW /]

Set the destination MIME type to text/plain. Now run the report and verify that the
browser returns an expected integer with no errors.

At this point we have finished the WebReport that returns the count information.
Now we need to call this from where the user will run their query.

Create a second LiveReport that returns a list of dtree items based on the first part of
their name. Like the first LiveReport, this requires an insertString parameter type.
As an example: select * from dtree where name like '%1%'

You will note that this is very similar to the previous query; the only difference
being that we're bringing back the data set rather than a count.

Finally, create a second WebReport and use the new LiveReport as the data source.
Edit the reportview so that you have something like this:
<SCRIPT>
function updateHits( myFilter ) {

var URL = '[LL_REPTAG_$AJAXWR LLURL:REPORT /]&inputLabel1=' + myFilter +


'&prompting=done';

$.ajax({
url: URL,
method: 'GET'
}).success(function(response){
$("#hitsText").html(`Matches: ${response}`)
})
}

</SCRIPT>

[LL_REPTAG_MYID NODEINFO:NAME /]
[LL_REPTAG_MYID LLURL:FUNCTIONMENU /]
[LL_REPTAG_MYID LLURL:UPALEVEL /]
<BR>

<INPUT TYPE=TEXT ID="MYFILTER" ONKEYUP="updateHits(this.value);">


<INPUT TYPE=BUTTON VALUE="Run" ONCLICK="document.location='[LL_REPTAG_MYID
LLURL:REPORT /]&inputLabel1=' + document.getElementById('MYFILTER').value">

<DIV ID="hitsText">Updates when you type</DIV>


<TABLE>
<TR>
<TD>[LL_REPTAG_COLNAME1 /]</TD>
<TD>[LL_REPTAG_COLNAME++ /]</TD>
<TD>[LL_REPTAG_COLNAME++ /]</TD>
<TD>[LL_REPTAG_COLNAME++ /]</TD>
<TD>[LL_REPTAG_COLNAME++ /]</TD>
</TR>

[LL_WEBREPORT_STARTROW /]

<TR>
<TD> [LL_REPTAG_1 /]</TD>
<TD> [LL_REPTAG_2 /]</TD>
<TD> [LL_REPTAG_3 /]</TD>
<TD> [LL_REPTAG_4 /]</TD>
<TD> [LL_REPTAG_5 /]</TD>

214 WebReports User Guide LLESWEBR230300-UGD-EN-01


5.2. Categories and Attributes

</TR>

[LL_WEBREPORT_ENDROW /]

</TABLE>

The following image shows the interaction between the two WebReports.

Notes

• This report uses a constant, AJAXWR, which needs to be defined on the


Constants tab by setting the object type to Content Server and browsing for
the Ajax report.
• This second WebReport also expects a parameter which, unless the report
developer states otherwise, triggers a prompt when the report runs. The
developer could enter the parameter name, inputLabel1 in this case, along
with an empty default value and the prompt field set to no. Initially, this will
cause all the results to be returned.

This code has been cut down to a minimum to demonstrate principles and
techniques. It takes no account of error paths, browsers other than Microsoft Internet
Explorer, or Content Server permissions. These things can all be added by the
developer.

5.2 Categories and Attributes


Writing reports on Content Server Categories and Attributes can be complex and
time-consuming. In the following text we demonstrate how you can use a
combination of SQL and WebReports-based techniques to improve development
time and performance in this area. We demonstrate the CAT sub-tag, a SQL based
approach and a combination of SQL and sub-tags. For more information about the
CAT sub-tag , see the Dynamic Tag Guide. For information about how to access the
Dynamic Tag Guide, see “To Access the Dynamic Tag Guide” on page 77.

Examples will be based on the following category:

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 215


Chapter 5 Detailed WebReports Examples

Note that this Category only contains simple attributes. You can have multi-value
attributes, sets, and multi-value sets. Each of these present specific reporting
challenges. However, unless you are very familiar with SQL, the CAT approach
followed by caching is likely to yield the most satisfactory results within a short
development period.

5.2.1 CAT - Method 1


The CAT sub-tag could be considered a WebReports macro. It operates on a Content
Server object ID and can retrieve any piece of Category and Attribute data stored
against that object. This may be subsequently used as output or as the basis for
filtering or sorting although here we are only interested in displaying the data. With
CAT we still need a data source. In this case we will use a LiveReport.
select LLAttrData.ID DATAID
from
LLAttrData, DTree
where
LLAttrData.DEFID = 338223 and
LLAttrData.ATTRID = 1 and
LLAttrData.VERNUM = DTree.VERSIONNUM and
LLAttrData.ID = DTree.DATAID

This simple query returns a single column of Content Server dataids that have the
Category, 338223, applied to their latest version. While you can use any filter
criteria, the important thing is that we have retreived the category information that
we want for the list of dataids. Given this, we can create a WebReport to extract
category information:
<TABLE CELLSPACING="1" STYLE="font-size:11px" BORDER="0">
<TR STYLE="background-color:#999999;color:white;bold;">
<TD> Trial Name </TD>
<TD> Number of Failures </TD>
<TD> Assignee </TD>
<TD> Start Date </TD>
<TD> End Date </TD>
<TD> Complete </TD>

216 WebReports User Guide LLESWEBR230300-UGD-EN-01


5.2. Categories and Attributes

</TR>
[LL_WEBREPORT_STARTROW /]
<TR BGCOLOR="ffffff">
<TD> [LL_REPTAG=DATAID CAT:"Test Category":"Trial Name":DISPLAY /]</TD>
<TD> [LL_REPTAG=DATAID CAT:"Test Category":"Number of Failures":DISPLAY /]</TD>
<TD> [LL_REPTAG=DATAID CAT:"Test Category":"Assignee":DISPLAY /]</TD>
<TD> [LL_REPTAG=DATAID CAT:"Test Category":"Start Date":DISPLAY /]</TD>
<TD> [LL_REPTAG=DATAID CAT:"Test Category":"End Date":DISPLAY /]</TD>
<TD> [LL_REPTAG=DATAID CAT:"Test Category":"Complete":DISPLAY /]</TD>
</TR>
[LL_WEBREPORT_ENDROW /]
</TABLE>

This reportview is designed to be as simple as possible. It takes the DATAID column


returned by the data source and uses this to extract each of the attributes we want
for the category Test Category. The results are inserted into a HTML table that looks
similar to a LiveReport output although we could use any type of formatting.

Trial Name Number of Assignee Start Date End Date Complete


Failures
JRS62-99 18 10657 Sun Jun 25 Thu Apr 01 TRUE
00:00:00 2006 00:00:00 1999

Note that the value returned for Complete is TRUE because this is how the user sees
the value in the Category. This differs from the results you see for the SQL method
because the database stores the values as 0 or 1 and Content Server converts this to
TRUE or FALSE for display in the check box attribute type.

Depending on the size of the Content Server system and its actual usage these steps
maybe sufficient to deliver a finished report. If, however, performance needs
improving, see “Caching Results with WebReports” on page 221.

For more information about the CAT sub-tag, see the Dynamic Tag Guide. For
information about how to access the Dynamic Tag Guide, see “To Access the Dynamic
Tag Guide” on page 77.

5.2.2 SQL - Method 2


This involves some understanding of how Content Server Categories and Attributes
are stored in the database. There are two key tables, LLAttrData and
LLAttrBlobData, each of which present their own set of reporting challenges.
LLAttrData often runs into tens of millions of rows, while LLAttrBlobData
contains data structures internal to Content Server, such as Assocs and RecArrays.

The following table shows the data from the LLAttrData table showing the entries
for a category applied to the Content Server node with ID 338112.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 217


Chapter 5 Detailed WebReports Examples

ID VER DEF DEF ATT ATT CU ENT PA KEY VAL VAL VAL VAL VAL
NU ID VER RID RTY STO RY RE ID INT RE DAT STR LO
M N PE MID NU NTK AL E NG
M EYI
D
3381 0 3382 4 1 -18 0 1 -1 1 ? ? ? Text ?
12 23 Cate
gory
3381 0 3382 4 2 -1 0 1 1 ? ? ? ? JRS6 ?
12 23 2-99
3381 0 3382 4 3 2 0 1 1 ? 18 ? ? ? ?
12 23
3381 0 3382 4 4 14 0 1 1 ? 1065 ? ? ? ?
12 23 7
3381 0 3382 4 5 -7 0 1 1 ? ? ? 06/2 ? ?
12 23 5/20
06
12:0
0
AM
3381 0 3382 4 6 -7 0 1 1 ? ? ? 04/0 ? ?
12 23 1/19
99
12:0
0
AM
3381 0 3382 4 7 5 0 1 1 ? 1 ? ? ? ?
12 23

Some important LLAttrData columns


ID The DATAID of the item to which this Category is applied.
VERNUMD The version of the item to which the Category is applied.
DEFID The DATAID of the Category that is applied to the item.
DEFVERN The version of the Category that is applied.
ATTRID The ID of the attribute.
ATTRTYPE The data type of this attribute.
VALINT Type specific data for Integers, Users and Booleans.
VALREAL Type specific data for Reals.
VALDATE Type specific data for Dates.
VALSTR Type specific data for Strings.

By forming an SQL statement as follows, you can effectively flatten the LLAttrData
table:

218 WebReports User Guide LLESWEBR230300-UGD-EN-01


5.2. Categories and Attributes

select LLAttrData.ID dataid,

max(case when LLAttrData.ATTRID = 2 then LLAttrData.VALSTR end) Trial_Name,


max(case when LLAttrData.ATTRID = 3 then LLAttrData.VALINT end) Number_of_Failures,
max(case when LLAttrData.ATTRID = 4 then LLAttrData.VALINT end) Assignee,
max(case when LLAttrData.ATTRID = 5 then LLAttrData.VALDATE end) Start_Date,
max(case when LLAttrData.ATTRID = 6 then LLAttrData.VALDATE end) End_Date,
max(case when LLAttrData.ATTRID = 7 then LLAttrData.VALINT end) Complete

from LLAttrData, DTree where


LLAttrData.DEFID = 338223 and
LLAttrData.VERNUM = DTree.VERSIONNUM and
LLAttrData.ID = DTree.DATAID

group by LLAttrData.ID

The output from this statement should look as follows:

DATAID TRIAL_NA NUMBER_ ASSIGNEE START_D END_DAT COMPLET


ME OF_FAILU ATE E E
RES
338112 JRS62-99 18 10657 06/25/2006 04/01/1999 1
12:00 AM 12:00 AM

Assuming a relatively lightly loaded database and powerful machine it maybe


possible to finish with the SQL at this point because the result is much easier to read
than what we started with in LLAttrData. For more information about improving
the performance, see “Caching Results with WebReports” on page 221.

5.2.3 LLAttrBlobData - Method 3


This approach is half way between the previous two methods. It uses a SQL query to
return a Content Server data structure from the table LLAttrBlobData which can
then be indexed using a series of sub-tags. We still need a data source for this
method, however, rather than returning a column of data ids as we did in “CAT -
Method 1” on page 216, we return a column of Content Server data structures. The
SQL query might look like:
select LLAttrBlobData.SegmentBlob from LLAttrBlobData, DTree
where
LLAttrBlobData.ID = DTree.DATAID and
LLAttrBlobData.VERNUM = DTree.VERSIONNUM and
&my other criteria

This query should produce output like:

SegmentBlob:
A<1,?,{338223,5}=A<1,?,'CustomID'=0,'ID'=1,'Values'={A<1,?,
2=A<1,?,'ID'=2,'Values'={'JRS62-99'}>,3=A<1,?,'ID'=3,'Values'={18}>,
4=A<1,?,'ID'=4,'Values'={10657}>,5=A<1,?,'ID'=5,'Values'={D/2006/6/25:0:0:0}>,
6=A<1,?,'ID'=6
,'Values'={D/1999/4/1:0:0:0}>,7=A<1,?,'ID'=7,'Values'={true}>>}>>

This data looks complex although once a few simple concepts are understood it is
relatively easy to understand. First of all, this whole data structure consists of only

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 219


Chapter 5 Detailed WebReports Examples

two data types, LISTs and ASSOCs. A LIST is like a conventional array and is
contained within curly brackets when flattened into a string for storage in the
Content Server database. In the results, {338223,5} is a LIST that contains 2
elements. We could access each of the elements with LIST:1 or LIST:2 depending
on which we want. An ASSOC is similar to a LIST but rather than having a numeric
index it has a key, which indexes the structure. In this data, there are many nested
ASSOCs, one of which is A<1,?,'ID'=2,'Values'={'JRS62-99'}>. This ASSOC has 2
keys, ID and Values which we can access with either ASSOC:ID or ASSOC:Values.
Keeping these data structures in mind we can create a reportview to access the
individual attribute values we are interested in.
<TABLE CELLSPACING="1" STYLE="font-size:11px" BORDER="0">
<TR STYLE="background-color:#999999;color:white;bold;">
<TD>Trial Name</TD>
<TD>Number of Failures</TD>
<TD>Assignee</TD>
<TD>Start Date</TD>
<TD>End Date</TD>
<TD>Complete</TD>
</TR>
[LL_WEBREPORT_STARTROW /]
<TR>
<TD>[LL_REPTAG=SEGMENTBLOB ASSOC:"{338223,5}" LIST:1 ASSOC:'Values' LIST:1 ASSOC:2
ASSOC:'Values' LIST:1 /]</TD>
<TD>[LL_REPTAG=SEGMENTBLOB ASSOC:"{338223,5}" LIST:1 ASSOC:'Values' LIST:1 ASSOC:3
ASSOC:'Values' LIST:1 /]</TD>
<TD>[LL_REPTAG=SEGMENTBLOB ASSOC:"{338223,5}" LIST:1 ASSOC:'Values' LIST:1 ASSOC:4
ASSOC:'Values' LIST:1 /]</TD>
<TD>[LL_REPTAG=SEGMENTBLOB ASSOC:"{338223,5}" LIST:1 ASSOC:'Values' LIST:1 ASSOC:5
ASSOC:'Values' LIST:1 /]</TD>
<TD>[LL_REPTAG=SEGMENTBLOB ASSOC:"{338223,5}" LIST:1 ASSOC:'Values' LIST:1 ASSOC:6
ASSOC:'Values' LIST:1 /]</TD>
<TD>[LL_REPTAG=SEGMENTBLOB ASSOC:"{338223,5}" LIST:1 ASSOC:'Values' LIST:1 ASSOC:7
ASSOC:'Values' LIST:1 /]</TD>
</TR>
[LL_WEBREPORT_ENDROW /]
</TABLE>

For more information about the LIST sub-tag , see the Dynamic Tag Guide. For
information about how to access the Dynamic Tag Guide, see “To Access the Dynamic
Tag Guide” on page 77.

In the reportview you will notice all the columns start the same way: [LL_REPTAG=
SEGMENTBLOB ASSOC:"{338223,5}" LIST:1 ASSOC:'Values' LIST:1

In this case, if you are only looking at regular Attributes rather than multi-value
attributes, sets, or multi-value sets, then you can use the same syntax. You can access
all these Attribute types using a slightly different syntax. The output from this
reportview should look as follows:

Trial Name Number of Assignee Start Date End Date Complete


Failures
JRS62-99 18 10657 Sun Jun 25 Thu Apr 01 true
00:00:00 2006 00:00:00 1999

Note that in this example an ASSOC key of {338223,5} is a slightly more complex
concept than that of a normal LIST/ASSOC. The reason is because the whole LIST
becomes the key into the first ASSOC in the SEGMENTBLOB column. Because the values

220 WebReports User Guide LLESWEBR230300-UGD-EN-01


5.2. Categories and Attributes

in the list (dataid and version number respectively) are not static and because this
always index into the first element of the ASSOC regardless of the key name, it is
often easier to use ASSOC:1 in place of ASSOC:"{338223,5}". If you use this method,
you need to ensure that your field is always at the same numeric index.

For more information about the operators used, see the LIST sub-tag and the ASSOC
sub-tag in the Dynamic Tag Guide. For information about how to access the Dynamic
Tag Guide, see “To Access the Dynamic Tag Guide” on page 77.

5.2.4 LQL - Method 4


A further option for Category and Attribute reporting is using the search index. This
is a useful option on systems where the database is heavily utilized. Perform an
Advanced Search and construct an LQL query of the form Attr_338223_
2:"JRS62-99", which returns all documents that have the Category 338223 (Test
Category) applied with Attribute 2 (Trial Name) equal to "JRS62-99". If the search
is now saved, it can be used as a WebReport data source in the same way as a
LiveReport. The search data source returns a list of predetermined columns, one of
which is DATAID. We can use the CAT sub-tag to display the data in the same way
as the reportview in “CAT - Method 1” on page 216.

For more information about search data sources, see “Using a Search Query as a
Data Source” on page 175.

5.2.5 Caching Results with WebReports


Even with the most appropriate of the earlier methods, it is possible that
performance will still be an issue. In the case of a performance issue, we can look at
caching the raw data into a new table. WebReports can write the results of any query
into a dedicated SQL table by using the WebForm export destination. If we do this
for the super-set of results then we have a much smaller data set to work with and
therefore improved performance.

Create a new Form Template and give it fields that you want to display in the final
WebReport output. In our case, these relate directly to our Category so that we
create a Template with six fields, each of which reflect the types that we have in the
Category itself. We are going to use SQL table storage for the form, so remember to
give the fields names that will be valid database columns, for example, no spaces.
After you complete the template, create and name an SQL table, and then create a
Form from the template. At this point, the cache is complete, you only need to write
into it.

Note: If you want to permission-check the final results or provide hyperlinks


back to the original data, you will need to cache the dataid as well as the
category fields that you are interested in.

Take the WebReport created in any of the previous methods and modify it so that it
uses the SETWFFORM sub-tag to map data from the source tag to the destination field.
If you take the example from the CAT reportview, you should end up with
something like this in the row section:

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 221


Chapter 5 Detailed WebReports Examples

[LL_REPTAG=DATAID CAT:"Test Category":"Trial Name":DISPLAY SETFORM:TRIAL /]


[LL_REPTAG=DATAID CAT:"Test Category":"Number of Failures":DISPLAY SETFORM:FAILURES /]
[LL_REPTAG=DATAID CAT:"Test Category":"Assignee":DISPLAY SETFORM:ASSIGN /]
[LL_REPTAG=DATAID CAT:"Test Category":"Start Date":DISPLAY SETFORM:STDT /]
[LL_REPTAG=DATAID CAT:"Test Category":"End Date":DISPLAY SETFORM:EDDT /]
[LL_REPTAG=DATAID CAT:"Test Category":"Complete":DISPLAY SETFORM:STATUS /]

For more information about the SETWFFORM sub-tag , see the Dynamic Tag Guide. For
information about how to access the Dynamic Tag Guide, see “To Access the Dynamic
Tag Guide” on page 77.

Now set the destination tab of the WebReport to export to Form and browse for the
Form we have just created. Set the Append Results field to “Overwrite Existing
Data”. Next, set a schedule appropriate to your user needs and processing
availability. As an example, you might set this to run at the end of each month for
payroll processing because the data is not required at any other time. In some cases
it might need to run hourly, the specific need will need to be determined by the
WebReport developer and the end user.

The final step is to create a LiveReport/WebReport to report on the data in the new
table containing the cached data. If at this point performance is an issue the
WebReport developer should consider paginating the data before delivery to the
browser.

5.3 Pagination in WebReports


Pagination can be delivered in several ways with WebReports. The particular
method used by your organization will depend on several factors:

• Database performance versus Content Server performance versus Client


performance.
• Database in use (SQL Server or Oracle).
• Size of result set (maximum, minimum and likely).
• Developer skills, typically SQL, WebReports, and HTML/JavaScript, and
available development time.
• Where, if at all, the result set is being filtered.

It is not possible to make definitive statements regarding the best approach without
a detailed understanding of the destination system. This document will describe
some general approaches but the best method will vary from system to system.

222 WebReports User Guide LLESWEBR230300-UGD-EN-01


5.3. Pagination in WebReports

5.3.1 SQL Approach


Although there are exceptions, it is best to work as much as possible at the database.
This way, the results list is as small as possible before travelling across the network
to Content Server. The more results, the longer this will take to transit the network.
Assuming an Oracle database, and no filtering in the WebReport or client, we can
use WebReports to pass a start and end row number that Oracle uses to return a
“slice” of data.

Imagine the following simplified LiveReport.


select * from (
select dt1.*, rownum rnum from (
select * from DTree
) dt1
where rownum <= %2)
where rnum >= %1

In this case, we have an inline view that returns the DTree table plus the pseudo-
column RowNum as an alias rnum. An outer statement then performs a select from
the inline view, using a combination of the rnum alias and the new RowNum
pseudo-column to extract a slice of data. %1 and %2 represent LiveReport
parameters of type Number and equate to the start and end row numbers
respectively. When running the LiveReport, these can be seen in the URL as
inputLabel1 and inputLabel2. The same technique can be applied to different
queries by replacing the innermost select statement, select * from DTree, with
your own.

The report can be run by clicking the link and filling in the start and end prompts, or
by manually issuing a URL. The following example URL shows where the start row
parameter is “20” and the end row parameter is “30”.
?func=ll&objId=xyz&objAction=runReport&inputLabel1=20&inputLabel2=30

At this point it should be apparent that all we need is an interface to control these
two parameter values. Here we can use WebReports to provide First, Previous,
Next, and Last buttons. The following code shows one possible implementation that
shows a bare bones reportview with minimal formatting.
<SCRIPT SRC="[LL_REPTAG_LIBPATH /]page.js"></SCRIPT>
<SCRIPT>
var wrurl = "[LL_REPTAG_MYID LLURL:REPORT /]";
var myCnt = [LL_WEBREPORT_SUBWEBREPORT NODEID:[LL_REPTAG_$GETCOUNT /] /];
var pageSize = [LL_REPTAG_$PAGESIZE /];
var p1 = [LL_REPTAG_&inputLabel1 /];
var p2 = [LL_REPTAG_&inputLabel2 /];
</SCRIPT>

<TABLE>
<TR>
<TD>[LL_REPTAG_COLNAME1 /]</TD>
<TD>[LL_REPTAG_COLNAME++ /]</TD>
<TD>[LL_REPTAG_COLNAME++ /]</TD>
<TD>[LL_REPTAG_COLNAME++ /]</TD>
<TD>[LL_REPTAG_COLNAME++ /]</TD>
</TR>
[LL_WEBREPORT_STARTROW /]
<TR>

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 223


Chapter 5 Detailed WebReports Examples

<TD>[LL_REPTAG_1 /]</TD>
<TD>[LL_REPTAG_2 /]</TD>
<TD>[LL_REPTAG_3 /]</TD>
<TD>[LL_REPTAG_4 /]</TD>
<TD>[LL_REPTAG_5 /]</TD>
</TR>
[LL_WEBREPORT_ENDROW /]
</TABLE>

<INPUT TYPE=BUTTON ID=FIRST VALUE=<< ONCLICK="getPage(wrurl, 'first', myCnt, pageSize,


p1, p2 );">
<INPUT TYPE=BUTTON ID=PREVIOUS VALUE=< ONCLICK="getPage(wrurl, 'prev', myCnt,
pageSize, p1, p2 );">
<INPUT TYPE=BUTTON ID=NEXT VALUE=> ONCLICK="getPage(wrurl, 'next', myCnt, pageSize,
p1, p2 );">
<INPUT TYPE=BUTTON ID=LAST VALUE=>> ONCLICK="getPage(wrurl, 'last', myCnt, pageSize,
p1, p2 );">

The header section contains several JavaScript declarations plus the HTML column
headings which can be broken down as follows. A JavaScript library file, page.js,
that provides the function, getPage(), to assist with the mechanics of pagination.
We can use this function when the user clicks any of the First, Previous, Next, or
Last buttons. Use this function in any WebReport or you can develop your own
function and include it inline.
<SCRIPT SRC="[LL_REPTAG_LIBPATH /]page.js"></SCRIPT>

The base URL of the report we want to run. The following code should result in ?
func=ll&objId=xyz&objAction=RunReport being stored in the variable wrurl. It
would be possible to hard code this though a more flexible solution is being used
where MYID is the data ID of the current WebReport that is passed to the LLURL sub-
tag to create a report URL based on this id. The benefit of this is that we can copy
and paste the code between reportviews and Content Server instances without
making changes.
var wrurl = "[LL_REPTAG_MYID LLURL:REPORT /]";

For more information about the LLURL sub-tag , see the Dynamic Tag Guide. For
information about how to access the Dynamic Tag Guide, see “To Access the Dynamic
Tag Guide” on page 77.

The JavaScript variable, myCnt is set using a sub-WebReport. The sub-WebReport


finds the total number of rows that we can paginate through. In our case we have a
separate, and very simple, LiveReport which counts the number of rows in DTree:
select count(*) from DTree

The sub-WebReport uses this as its data source. The sub-WebReport itself contains
one tag, [LL_REPTAG_1 /], in the row section. All other characters, including spaces
and carriage returns, must be removed from the reportview. This ensures that we
only have a number in the JavaScript variable. If you run the sub-WebReport on its
own you should see a number and nothing else other than the Content Server
headers. Remember that if you have a where clause or permission filtering in the
main report, you must also have this in the count report otherwise the count will not
be accurate. We use a constant, [LL_REPTAG_$GETCOUNT /], to point to the sub-
WebReport. Remember to go to the Constants tab and define it. To read information
about why it is a good idea to use a constant, see “WebReports Constants”
on page 65.

224 WebReports User Guide LLESWEBR230300-UGD-EN-01


5.3. Pagination in WebReports

var myCnt = [LL_WEBREPORT_SUBWEBREPORT NODEID:[LL_REPTAG_$GETCOUNT /] /];

Next we set another JavaScript variable with an integer representing the number of
rows we want to show on each page. Remember to define this constant on the
Constants page.
var pageSize = [LL_REPTAG_$PAGESIZE /];

In the final piece of JavaScript we set two variables representing the current start
and end row numbers. To have the report run straight away, rather than prompting
you for these values, you must use the WebReports Parameters page to define a
default value for each of them. Default values of 1 and 20 would result in the first 20
rows being displayed when the user runs the report.
var p1 = [LL_REPTAG_&inputLabel1 /];
var p2 = [LL_REPTAG_&inputLabel2 /];

The rest of the header and the entire row section are standard HTML and
WebReports tags which display the column headings and the row data. The only
remaining complexity is the First, Previous, Next, and Last buttons in the footer
section. As mentioned previously, these buttons use the function getPage() to build
the URL for the next slice of data. This function is invoked when the user clicks any
of the buttons. It accepts 7 parameters, 5 of which are mandatory. Hopefully the first
five of these are clear from the prior description. The remaining two default to
inputLabel1 and inputLabel2 respectively. Because we are using the first two
LiveReport parameters to perform the pagination, we do not need to provide these.
If, instead, we wanted to use the third and fourth parameters for filtering, we would
need to pass the values inputLabel3 and inputLabel4.
<INPUT TYPE=BUTTON ID=FIRST VALUE=<< ONCLICK="getPage(wrurl, 'first', myCnt, pageSize,
p1, p2 );">
<INPUT TYPE=BUTTON ID=PREVIOUS VALUE=< ONCLICK="getPage(wrurl, 'prev', myCnt,
pageSize, p1, p2 );">
<INPUT TYPE=BUTTON ID=NEXT VALUE=> ONCLICK="getPage(wrurl, 'next', myCnt, pageSize,
p1, p2 );">
<INPUT TYPE=BUTTON ID=LAST VALUE=>> ONCLICK="getPage(wrurl, 'last', myCnt, pageSize,
p1, p2 );">

5.3.2 WebReports DSstartrow and DSendrow


When dealing with moderately sized result sets or non-LiveReport data sources, the
data source parameters DSstartrow, DSendrow, and DSmaxrows provide a relatively
simple way to implement a paging mechanism (meaning network performance
could be a factor in overall response time). When using this method the entire result
set will be passed from the database to Content Server. WebReports then uses the
DSstartrow and DSendrow parameter to take a slice of the result set before
delivering it to the client.

When using this method we do not need to worry about the mechanics of pagination
in the actual SQL query. This means that if we were working with the same result
set as the first example, we only need the innermost query select * from DTree. This
makes the method well suited to SQL Server databases which do not support
rownum.

LLESWEBR230300-UGD-EN-01 OpenText™ Content Server 225


Chapter 5 Detailed WebReports Examples

If using the previous reportview, the parameters need to be changed. Remember,


default values need to be set on the WebReports parameters tab for when the report
first runs:
var p1 = [LL_REPTAG_&DSstartrow /];
var p2 = [LL_REPTAG_&DSendrow /];

The buttons also need to change so that the getPage() function is passed two new
parameters representing the names of the pagination control parameters:
<INPUT TYPE=BUTTON ID=FIRST VALUE=<< ONCLICK="getPage(wrurl, 'first', myCnt, pageSize,
p1, p2, 'DSstartrow', 'DSendrow');">
<INPUT TYPE=BUTTON ID=PREVIOUS VALUE=< ONCLICK="getPage(wrurl, 'prev', myCnt,
pageSize, p1, p2, 'DSstartrow', 'DSendrow' );">
<INPUT TYPE=BUTTON ID=NEXT VALUE=> ONCLICK="getPage(wrurl, 'next', myCnt, pageSize,
p1, p2, 'DSstartrow', 'DSendrow' );">
<INPUT TYPE=BUTTON ID=LAST VALUE=>> ONCLICK="getPage(wrurl, 'last', myCnt, pageSize,
p1, p2, 'DSstartrow', 'DSendrow' );">

If we were “Using a Search Query as a Data Source” on page 175 with DSstartrow
and DSendrow we need to use a slightly different method to find the total number of
results. Using the search data source specific tag, INDEXTOTALHITS, we can achieve
the same thing as the sub-WebReport that performs the count operation: var myCnt
= [LL_REPTAG_INDEXTOTALHITS /];

If, in these examples, we look at any given page with 20 rows of content it will be
about 60KB including all the Content Server header and footer information. If we
then split out the content, which is the only piece that changes from page-to-page,
we see that this is less than 3KB and only 5% of the overall page size.

226 WebReports User Guide LLESWEBR230300-UGD-EN-01

You might also like