WebReports User Guide
WebReports User Guide
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.
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
One or more patents may cover this product. For more information, please visit https://www.opentext.com/patents.
Disclaimer
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
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.
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.
• The option to run reports in the background without holding up the user's
browser.
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.
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.
The following sections detail the factors related to the running of WebReports to
display data or to export data for end users of WebReports.
• 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.
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.
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
Notes
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
• 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.
8. Click Add.
You can access the online editor from one of the following nodes:
Depending on the settings, the online editor will open in one of the following
formats:
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.
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.
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.
– CSS
– Handlebars
– HTML
– Javascript
– JSON
– Markdown
– WebReports
– XML
• Auto-completion and auto-suggestions
• Diff mode
• Mode validation
• Line numbers
• Code folding
– 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.
• 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.
• 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.
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.
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.
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
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:
• 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
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.
• 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.
• 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.
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.
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.
• 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.
• 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.
• 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.
• 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.
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
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.
<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">
<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>
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:
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.
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.
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
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
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.
• 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.
• 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 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.
• 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.
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 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.
• Server Path: the fully formed file path (can include URL parameters) to
access the application.
• Server Port: the port used to access the server.
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.
Notes
Note: For information about how to set an output destination without affecting
the default destination, see “Exporting the WebReport Output” on page 52.
• “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.
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
• 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 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.
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.
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.
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.
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.
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.
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
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
• 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.
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.
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.
• 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.
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
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:
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.
• 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.
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.
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).
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
– 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.
Default = icon-subwebreport
• 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.
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.
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.
3. Click Update.
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 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.
d. In the Every area, select the interval for which the WebReport will run.
7. Click Update.
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.
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 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.
• 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.
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).
Notes
• You can also use URL parameters to export the WebReport Output. For
information, see “Export Using URLs” on page 122.
• 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.
• “To run a WebReport and export the output to a new Content Server node:“
on page 53
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.
3. In the Export Type area, select the Content Server Node option.
Notes
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.
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.
1. In the workspace, from the WebReport Functions menu, click Run & Export.
Tip: Alternatively, you can click Run & Export from the quick links.
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.
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.
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.
1. In the workspace, from the WebReport Functions menu, click Run & Export.
Tip: Alternatively, you can click Run & Export from the quick links.
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.
Tip: For information about how to use URL parameters to export to email, see
“Exporting to Email - Parameters and Example” on page 125.
1. In the workspace, from the WebReport Functions menu, click Run & Export.
Tip: Alternatively, you can click Run & Export from the quick links.
3. In the Email Address area, specify one or more emails 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.
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
Note: The total email address list must not exceed 10,000 characters,
roughly 500 email addresses.
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.
• 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.
Tips
1. In the workspace, from the WebReport Functions menu, click Run & Export.
Tip: Alternatively, you can click Run & Export from the quick links.
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.
• 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.
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.
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.
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
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.
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.
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.
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.
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: 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.
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.
1. To remove a schedule, from the WebReport Functions menu, select Properties >
Destination.
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).
The following table indicates the most common roles for WebReports users and
what the recommended permissions should be:
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 /]
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.
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 (*).
• “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.
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.
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.
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.
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.
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.
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 .
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.
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.
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.
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 (~)
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
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.
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.
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>
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.
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.
• 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.
• Click the Extract Parameters from Content button to add all the
parameters that are used in the reportview or LiveReport data source.
3. Click Update.
– 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
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.
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.
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.
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.
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.
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.
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
/]
[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 /]
The following sections detail the additional information of the functions, required
and optional parameters, and some detailed examples using the functions in ajax.
js.
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>
getURLParm( parm )
• Returns the value that is associated with the parameter name in the current URL.
• Takes the following arguments:
<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>
</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
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.
[LL_WEBREPORT_STARTROW /]
hits = '[LL_REPTAG=hits /]';
[LL_WEBREPORT_ENDROW /]
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>
[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 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
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.
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%'
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,
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>
<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');
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:
Main WebReport Output: list of objects in DTree that start with Livelink -
using the AJAX sendRequest function.
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');
}
function showURL(did){
did = document.getElementById('dataid').value;
getURLparms = '&tagdata=' + did + '&subtags=LLURL:OPEN';
executeWRService('gettagdata', 'displayname', getURLparms,'string');
}
</script>
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(){
</script>
<input type=button value="Get Static Tags" onclick=getStaticTags()>
<hr>
<DIV ID="display">
</DIV>
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>
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.
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>
– 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.
– 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.
...
[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 /]
...
– 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',
'zipemail');
multiButton('multifile/print', 'Print', 'multifile.printmulti', 'print');
</SCRIPT>
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.
<script>
/* Call to catData constructor function to instantiate a object. */
var cat_data = new catData();
"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>
<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';
}
return true;
}
// function that will populate the note with all category data associated with the node
function showCatData(nodeId) {
// Iterate thru the data strucutre to display all category fields and data
for (catid in thisNode) {
// 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>";
// 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 ){
} else {
// 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>';
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>
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
Parameters
Parameters
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
Returns null if an error is encountered or if the fieldId/value pairs are not found.
Parameters
The function will determine whether a name or id is passed in, and take the
appropriate action.
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>
// 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>
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).
// 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'
if ( IsDefined( value3 ) )
.fData += value3
end
else
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.
Notes
Call the new custom sub-tag from any WebReport reportview as follows:
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.
• 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.
• 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).
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.
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.
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.
Pagination
One useful application of data source parameters is pagination. This is discussed in
full detail in “WebReports DSstartrow and DSendrow” on page 225.
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.
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.
?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.
You can only use DSuseResultsDisplayStyle with the Search Query Launch
data source type, so you cannot use this for a URL invocation.
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 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.
“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.
1. On the Search box, click the Open Search Panel button and then click the
Advanced Search link.
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" )
After you define and save the search query, you can use it as the data source for
your WebReport.
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
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.
6. From the workspace, on the row for the WebReport, click the Edit Reportview
link.
<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>
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.
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.
</TABLE>
</TD>
[LL_WEBREPORT_ENDIF /]
• 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.
?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.
?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.
?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.
?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=...
For information about exporting to email, see “Running a WebReport and Exporting
the Output to Email” on page 55.
?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.
?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.
?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=...
• 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.
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.
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.
• 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.
• From the form template Functions menu, select Export as HTML, then save the
file to your desktop.
• 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.
The Initiate WebReport mechanism requires two configuration options, which are
set on the Specific tab of the form:
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.
• You can only reference items contained under the [WebReports] section of the
opentext.ini file.
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:
For more information about how to use the constant tag syntax, see “Procedures
Defining How to Use Constants” on page 67.
To support this technology, WebReports allows much of the data typically retrieved
using individual WebReports tags, to be delivered as a JSON structure.
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).
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.
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.
@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
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.
@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.
@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.
@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.
@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>"
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.
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"}]
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 /]"
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 /]"
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
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"
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"
– A JSON example:
INCLUDECOLUMNS:'["Reviewer","DocType"]'
– A JSON example:
EXCLUDECOLUMNS:'["DataID","ParentID"]'
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".
Related For more information about the definition of the JSON structure of the response, see
Information “@FILTEREDCOUNT Response Structure Definition Example” on page 151.
@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.
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
@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>"
– A JSON example:
INCLUDECOLUMNS:'["Reviewer","DocType"]'
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"]'
– 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.
– A JSON example:
SORTABLECOLUMNS:'["Reviewer","DocType"]'
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> /]”
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 /]:'' /]"
Related For more information about the definition of the JSON structure of the response, see
Information “@TABLEREPORT Response Structure Definition Example” on page 155.
• 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.
[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}]
}
• 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.
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.
}
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
{
"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"
}
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
}
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",
"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"
}
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
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"
}
],
"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"
}
Example 1
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
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",
"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.
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.
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 /].
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:
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
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:
• AND
• OR
• &&
• ||
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:
Treatment of Dates
For certain operators:
• <=
• >=
• <
• >
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.
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:
5. The previous result from Step 3 of TRUE OR Clause 3 (FALSE) results in TRUE.
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"))
If you include this file in a WebReport, you can use the LIBPATH tag as follows:
<SCRIPT SRC="[LL_REPTAG_LIBPATH /]page.js"></SCRIPT>
– 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.
• Email
• Content Server Node
• Content Server Version
• Server
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.
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:
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.
1. XML job tickets must be valid to be used. The following rules must apply to
each job ticket 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>
<JOB:DOCINPUTS>
<JOB:DOCINPUT FILENAME="" FOLDER="$DEFAULT_PATH" />
</JOB:DOCINPUTS>
<JOB:DOCOUTPUTS>
<JOB:DOCOUTPUT FILENAME="" FOLDER="$DEFAULT_PATH" DOCTYPE="PDF" />
</JOB:DOCOUTPUTS>
</JOB>
</JOBS>
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" />
• 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.
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 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" /]
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.
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.
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.
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.
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.
The parameter &inputlabel1=cat in the URL would result in the search query
looking for the words test and cat.
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
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.
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).
• 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.
• Assoc
• Boolean
• Bytes
• Date
• Integer
• List
• Math
• Pattern
• Real
• RecArray
• Record
• Str
• String
• Undefined
• Void
• Scheduler.debugbreak
• Web.CRLF
• Web.DecodeForURL
• Web.EncodeForURL
• Web.Escape
• Web.EscapeHTML
• Web.EscapeXML
• Web.Format
• Web.Unescape
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:
Important
The first two pitfalls listed represent the risks with the greatest potential to
impact Content Server.
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 /]
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.
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:
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 /]
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>
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
)
Example 4-32: Here are two examples that return the value of a
WebReport constant called report:
Note that you may specify either the full tag name or a shortened version
which omits the opening [LL_REPTAG_ and closing /].
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.
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.
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)
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.
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 /]
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.
• [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.
The previous methods can be combined to provide sorting on multiple key values as
shown in the following examples:
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:
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.
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/]/]
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.
• 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.
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
&sortcol3=parentid&sortcol1=Name&
sortcol2=dataid
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:
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.
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.
The following table illustrates how parameter inheritance works, where the first
WebReport is calling the second WebReport as a sub-WebReport.
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.
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.
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.
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.
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>
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.
&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.
&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 /].
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
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>
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.
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>
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>
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
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.
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.
4. On the row for the WR Trigger that you want to delete, click the Delete Row
button .
5. Click Update.
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
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 /]" /]
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.
• [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:
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.
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:
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.
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>
Note: A DIV is unnecessary. You can use any HTML element where the
attribute innerHTML is writable.
• 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' ).
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.
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:
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 ) {
$.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>
[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>
The following image shows the interaction between the two WebReports.
Notes
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.
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.
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>
</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>
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.
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.
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
By forming an SQL statement as follows, you can effectively flatten the LLAttrData
table:
group by LLAttrData.ID
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
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:
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
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.
For more information about search data sources, see “Using a Search Query as a
Data Source” on page 175.
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.
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:
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.
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.
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>
<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>
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 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.
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 );">
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.
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.