Blog

What's happening? What's new? What can I do? Find answers to these questions in the blog.

Archive Results

Blog

IBM #Cognos Analytics 11 JavaScript: What is the difference between a Custom Control and a Page Module?

A scriptable interface is available in IBM Cognos Analytics 11 for many objects in the report output. Reports can be scripted using two types of RequireJS AMD modules: A module that implements the CustomControl Module Interface A module that implements the Page Module Interface When to use a Custom Control To provide your own user interface for: a prompt-like control that reads and sets parameters page navigation buttons (Next, Finish, etc.) authored data such as a list or visualization When to use a Page Module To set the initial state of prompt controls To set prompt control custom validation functions To read current selections from a prompt control (possibly to store) before going to the next page Code (using HTML Item) from a previous release that was executed globally on the page will likely move into the "load" method When to use an HTML Item To insert static HTML into the output To insert static CSS into the output For more information, please view the online documentation. Custom Control Example In the sample named App Bar, we demonstrate how to use a Custom Control: Page Module Example In the sample named Validate Type-In Product Line Code, we demonstrate how to use a Page Module: The instructions for installing and configuring the JavaScript samples can be found at the bottom of this Blog post. Related posts: Scriptable Reports JavaScript Online Documentation Video: Cognos 10 JavaScript Prompt API samples in IBM Cognos Analytics 11 Blog: Cognos 10 JavaScript Prompt API samples in IBM Cognos Analytics 11 JavaScript support in the Interactive Viewer Video: Overview: Scriptable reports (11.0.4+) How to use a custom control with JavaScript to hide and show a filter panel in IBM #Cognos Analytics 11.0.7+ IBM Knowledge Center: Prompt API for IBM Cognos BI IBM Knowledge Center: Adding JavaScript to a report Library of How-To Videos for IBM Cognos Analytics Samples Landing Page Guide to IBM Cognos Analytics sample data sets Please visit our IBM Cognos Analytics channel on YouTube.

Blog

Cognos 10 JavaScript Prompt API samples in IBM #Cognos Analytics 11

In Cognos Business Intelligence 10.2.2, the JavaScript Prompt API provided report authors with a method of customizing prompt interactions in the reports they authored. Fifteen samples were created to demonstrate how to use the Prompt API. After you install the Extended Samples, you will find the Prompt API samples in the Samples_Prompt_API folder. In Cognos Analytics 11.0.4, embedded JavaScript support changed and improved. Consequently, the 10.2.2 Prompt API samples have been re-written for 11.0.11, using this new approach. What has changed? Cognos Business Intelligence 10.2.2 used HTML Items, JavaScript, and the Prompt API. The report is rendered in the Classic Viewer only. IBM Cognos Analytics 11.0.4+ uses Custom Controls (instead of HTML items) and JavaScript modules. The report is rendered in the Interactive Viewer. Here is a list of the original Prompt API samples that have been updated in 11.0.11: Clear prompt selections Date prompt presets Display all prompt values ignoring user selections Display user selected prompt values Filter country by letter (now called HTML select and HTML slider) Limit numeric prompt selection by database value Limit time between two dates Limit user selection to two items Personal default prompt selections - set selections Personal default prompt selections - use selections Validate prompt values when button pushed Validate type-in postal code values Validate type-in product line code Coming soon: Date time prompt presets Limit date prompt selection by database value Deprecated: Pass parameter via hidden prompt Note: You can also successfully open and use all the version 10.2.2 samples in their original form in Cognos Analytics 11. They will be rendered in the Classic Viewer only. How to install the 11.0.11 JavaScript Samples The setup instructions and JavaScript sample files are installed (but not configured or imported) with the product in an Easy installation, and if the Samples option is selected in a Custom installation. After product installation, you can find the files here: <Cognos Analytics installation location>\samples\JavaScript\ Please open the file JavaScript_setup_instructions.pdf and follow the steps. All the JavaScript samples now use a data module as their data source, making them much easier to import. Related posts: Scriptable Reports JavaScript Documentation Video: Cognos 10 JavaScript Prompt API samples in IBM Cognos Analytics 11 JavaScript support in the Interactive Viewer Video: Overview: Scriptable reports (11.0.4+) How to use a custom control with JavaScript to hide and show a filter panel in IBM #Cognos Analytics 11.0.7+ IBM Knowledge Center: Prompt API for IBM Cognos BI IBM Knowledge Center: Adding JavaScript to a report Library of How-To Videos for IBM Cognos Analytics Samples Landing Page Please visit our IBM Cognos Analytics channel on YouTube.

Blog

Video: Cognos 10 JavaScript Prompt API samples in IBM #Cognos Analytics 11

Welcome to our video about how the Cognos 10 JavaScript Prompt API samples have evolved in the IBM Cognos Analytics 11 environment. In this video we will show the 10.2.2 Prompt API samples, the equivalent 11.0.11 samples, and demonstrate what has changed. Related posts: Cognos 10 JavaScript Prompt API samples in IBM Cognos Analytics 11 Library of How-To Videos for IBM Cognos Analytics Samples Landing Page Guide to IBM Cognos Analytics sample data sets Please visit our IBM Cognos Analytics channel on YouTube.

Blog

New Base Samples for IBM #Cognos Analytics 11.0.10

There are two types of samples that have been created exclusively for IBM Cognos Analytics. The Extended Samples require the use of a database and database connections to host the sample Great Outdoors data. They must be installed and configured. Here are the instructions for installing the Extended samples. We have also created a set of Base Samples in a deployment that can be easily imported in one step. These samples exclusively use Data Modules as their underlying data sources (no cubes, databases, or packages). Here is a video that explains how to find and import the Samples_for_Install_11_0_10.zip deployment file. After you import the deployment, you will see the following new Base Samples: Team content > Samples > Dashboards California website visits This sample showcases the new latitude/longitude mapping functionality in dashboarding. Multiple maps use regions, points, and latitude/longitude to display California website visits data for the fictional Samples Outdoors Company website. Policy analysis This sample dashboard has been updated to include a drill-through definition to the "Customer lifetime value analysis" report. Team content > Samples > Data NYPD motor vehicle collisions This sample data provides a breakdown of every collision in NYC from 2015 to 2017 by location and injury. Each record represents a collision in NYC by city, borough, precinct and cross street. Source: Police Department (NYPD), NYC OpenData Sales staff This sample data contains sales staff information for the fictional Sample Outdoors Company. Source: IBM. Note: This uploaded file is now included in the Sample data module. Audit Samples We have added one new sample audit report in 11.0.10: Deleted user account report This sample audit report lists user accounts that have been deleted during a specified time period. It provides information about the deleted user ID, the time deleted, the account type, and the status of the request. To learn more about the audit samples and how to install them, please visit this Blog post. JavaScript Samples All of the JavaScript samples now use data modules as their data source, rather than the Sample Outdoors Company database. Please visit this Blog post for more details. Related posts: New Audit samples for IBM #Cognos Analytics 11.0.7+ Updated JavaScript samples for IBM #Cognos Analytics 11.0.10 Samples landing page Supplementary (Legacy) IBM Cognos Analytics 11 samples Guide to IBM Cognos Analytics sample data sets Please visit our IBM Business Analytics Support channel on YouTube.

Blog

Updated JavaScript samples for IBM #Cognos Analytics 11.0.10

The JavaScript samples have been updated to use data modules rather than the Sample Outdoors Company database, making them easier for you to set up. You no longer need to install the full Extended Samples in order to use the JavaScript samples. The setup instructions and JavaScript sample files are installed (but not configured or imported) with the product in an Easy installation, and if the Samples option is selected in a Custom installation. After product installation, you can find them here: <Cognos Analytics installation location>\samples\JavaScript\ List of JavaScript Samples App bar: This sample report uses JavaScript to create an application bar to switch between a list, charts, and a crosstab. App bar data: This sample report uses JavaScript to create a data-driven application bar. App bar static labels: This sample report uses JavaScript to create an application bar with static labels. Basic control: This sample shows how to include a basic JavaScript control. Bootstrap button bar: This sample report uses JavaScript to create a bootstrap button bar to switch between order methods. Bootstrap tabs: This sample report uses JavaScript to create both data-driven tabs and static tabs. Collapse regions: This sample report uses JavaScript to show or hide prompts. D3 bar chart: This sample report uses JavaScript to generate a D3 bar chart. Data store viewer: This sample report uses JavaScript to access the data store and display rows of data. Displayable regions: This sample report uses JavaScript to show or hide the prompts, and to show or hide individual prompts within that region. Events: This sample shows how to use JavaScript to respond to events. Full screen: This sample report uses JavaScript to show a pie chart, a list, or a crosstab in full screen mode. Google bar chart: This sample report uses JavaScript to generate a Google bar chart. Google organization chart: This sample report uses JavaScript to generate a Google organization chart. HTML select: This sample report uses JavaScript to create an HTML drop-down list. HTML slider: This sample report uses JavaScript to create an HTML slider to set a minimum value. List column display: This sample report uses JavaScript to allow the user to select which list columns to display. Loading text: This sample demonstrates loading text with JavaScript. Page module: This example shows how to author a page module and access a control in the page module. (This is the base template for a page module.) Prompt API buttons: This sample report uses JavaScript to show the results of various method calls. Prompt validation: This sample demonstrates using JavaScript to validate the content of prompt values entered by the user. Save csv: This sample report uses JavaScript to allow the user to render a report as a CSV file. Related posts: IBM Knowledge Center: Adding JavaScript to a report Technote: Adding JavaScript to reports JavaScript support in the Interactive Viewer Video: Overview: Scriptable reports (11.0.4+) How to use a custom control with JavaScript to hide and show a filter panel in IBM #Cognos Analytics 11.0.7+ Samples landing page Guide to IBM Cognos Analytics sample data sets Please visit our IBM Business Analytics Support channel on YouTube.

Blog

How to use a custom control with JavaScript to hide and show a filter panel in IBM #Cognos Analytics 11.0.7+

Filters (prompts) tend to take up a lot of valuable space on a report. It is often useful to provide users with the ability to hide and show these filters in a panel. There is a new sample in IBM Cognos Analytics 11.0.7 titled Global sales that demonstrates how to use a Block, a Custom Control, and JavaScript to hide and show a panel of filters (Year and Product Line) at the top of the report: Here is a document that explains step-by-step how we created the sample report. Samples There is a set of samples for Scriptable Reports. These sample files are installed (but not configured or imported) with the product in an Easy installation, and are an option in a Custom installation. You can find them here: <Cognos installation directory>\samples\JavaScript\ For your convenience, you can also obtain the samples here. Download the following three files: 1. Follow these setup instructions. If you are using a Gateway, please read Step 6 carefully! 2. Unzip and place these javascript files. 3. Import this report deployment. Related posts: JavaScript support in Interactive Viewer Video: Overview: Scriptable reports (11.0.4+) New Base Samples for IBM Cognos Analytics 11.0.7 Please visit our IBM Business Analytics Support channel on YouTube.

Blog

New Base Samples for IBM #Cognos Analytics 11.0.7

There are two types of samples that have been created exclusively for IBM Cognos Analytics. The Extended Samples require the use of a database and database connections to host the sample Great Outdoors data. They must be installed and configured. Here are the instructions for installing the Extended samples. We have also created a set of Base Samples in a deployment that can be easily imported in one step. These samples exclusively use Data Modules as their underlying data sources (no cubes, databases, or packages). Here is a video that explains how to find and import the Samples_for_Install.zip deployment file. After you import the deployment, you will see the following new Base Samples: Team content > Samples > Reports Global sales This sample report uses a Block, a Custom Control, and JavaScript to hide and show a panel of filters. For more information, please visit this Blog post. Corporate website visits This sample report demonstrates the new client-side mapping functionality in reporting. Three maps display 2016 website visit data for the fictional Sample Outdoors Company website by Zip Code in California. Team content > Samples > Data Sample data module We added State/Province, City and Zip/Postal Code to facilitate mapping. This sample data module is intended to help beginners start authoring reports and dashboards. The Sample Outdoors Company is a fictitious business operation with data for products, retailers, order methods, and year. Source: IBM California website visits We created data at the Zip Code and City level for the new client-side mapping functionality in reporting. This sample data module contains 2016 website visit data for the fictional Sample Outdoors Company website by Zip Code and city in California. Source: IBM Extension Samples There are two new sample Extensions for IBM Cognos Analytics 11.0.7. Please visit this Blog post to learn more. Audit Samples The Audit samples have been updated for IBM Cognos Analytics 11.0.7. We have improved the look and feel, increased the overall usability of the reports, and switched all the reports to Dynamic Query Mode. Please visit this Blog post to learn more. OLAP Samples To demonstrate typical OLAP features in IBM Cognos Analytics 11.0.7, we have created a sample dashboard, report, and the underlying OLAP cube. Please visit this Blog post to learn more. Package based drill-through Samples To demonstrate package based drill-through in IBM Cognos Analytics 11.0.7, we have provided sample source and target reports that use the sample GO data warehouse (query) package and a drill-through definition. Please visit this Blog post to learn more. Related posts: Supplementary (Legacy) IBM Cognos Analytics 11 Samples Samples landing page Please visit our IBM Business Analytics Support channel on YouTube.

Blog

Video: Overview: Scriptable reports (11.0.4+)

Using four examples, this is an overview of how to add JavaScript to your reports in IBM Cognos Analytics 11.0.4 and above. There is a new API that supports and expands the existing Prompt API and more. JavaScript is stored in a file and can be shared across reports. You can download detailed technical documentation that describes the new APIs. Samples There is a new set of samples for Scriptable Reports for 11.0.5. These samples are installed by default in an Easy installation, and are an option in a Custom installation. You can find them here: <Cognos installation directory>\samples\JavaScript\ For your convenience, you can also obtain the samples here. Download the following three files: 1. Follow these setup instructions. If you are using a Gateway, please read Step 6 carefully! 2. Unzip and place these javascript files. 3. Import this report deployment. Related posts: JavaScript support in the Interactive Viewer How to use a custom control with JavaScript to hide and show a filter panel in IBM Cognos Analytics 11.0.7 Please visit our IBM Business Analytics Support channel on YouTube.

Blog

Video: What’s new in Reporting for IBM #Cognos #Analytics 11.0.4?

Welcome to our video about what’s new in reporting, where we’ll show you some of the latest features in IBM Cognos Analytics 11.0.4, including drill through in the interactive viewer, data list styling, and scriptable reports (JavaScript support). Related post: Reporting Enhancements in Cognos Analytics 11.0.4 Please visit our IBM Cognos Analytics channel on YouTube.

Blog

JavaScript support in the Interactive Viewer

The interactive report viewer can render reports with JavaScript embedded starting Cognos Analytics 11 R4. We’ve taken a different approach with the interactive viewer JavaScript support - the JavaScript that you want to add to a report must exist in a separate file that your web browser can access. This allows the same JavaScript to be shared and reused among many reports. For example, if you have a custom prompt control, you can code it once and reference it anywhere in any report by using a new object called Custom control. How does it work? JavaScript can be added to reports by using the following two types of Asynchronous Module Definition (AMD) modules. A module that implements the CustomControl Module interface. A module that implements the Page Module interface. Examples for when you will want to use a Custom Control To provide your own user interface for a prompt-like control that reads and sets parameters. To provide your own user interface for page navigation buttons (Next, Finish,...). Any type of custom interface or behavior for a supported report object. To use a Custom Control, drag the ‘Custom control’ icon from the toolbox to the report. Under ‘properties’ of custom control, specify the location of the file that contains the JavaScript you want to use as ‘Module path’. You can also use the ‘Configuration’ property to pass different parameters to the JavaScript functions accepting them. The UI type property defines how custom control interacts with the report. If you do not want to render an interface, set the property to None. If you do not want events, such as mouse up, to propagate from the control to the report, set the property to UI without event propagation. If you want events to propagate to the report, set the property to UI with event propagation. Examples for when you will want to use a Page Module To set the initial state of prompt controls To set prompt control custom validation functions To read current selections from a prompt control (possibly to store) before going to the next page Code (using HTML Item) from a previous release that was executed globally on the page will likely move into the "load" method Page module can be used on page objects such as report page or prompt page. ‘Module path’ property is available for page objects when selected. Examples for when you will want to use an HTML Item To insert static HTML into the output To insert static CSS into the output Where to store JavaScript files? JavaScript files can be stored anywhere a browser has access to. For example, you can host JavaScript files on your webserver, or you can include JavaScript files under Cognos install, under webcontent/bi directory. We use RequireJS to load JavaScript files. RequireJS assumes by default that all dependencies are scripts, so .js extension is not required as part of the module path. Example module path (../samples/expandJavaScript). However, there may be times when you do want to reference a script directly. If the path starts with a "/", or if the path contains an URL protocol, like "http:" or "https:", .js should be added to the path. Example module path (http://servername/cognos/samples/expandJavaScript.js) Report objects supported Existing Prompt API (Value prompt, Select & search prompt, Date prompt, Date & time prompt, Time prompt, Interval prompt, Tree prompt and Text box prompt) Custom control Block Crosstab Field set Hyperlink Image Repeater table Table Text item List Visualization (3-D combination chart, 3-D scatter chart, Bubble Chart, Bullet chart, Combination chart, Gauge chart, Marimekko chart, Metrics range chart, Pareto chart, Pie chart, Polar chart, Progressive chart, Radar chart, Scatter chart, Win-loss chart) Why should I use the new JavaScript API? It uses the industry standard module loader RequireJS. Script files can be dynamically downloaded and cached by both the viewer and the browser's cache. With modules, it's possible to reuse script such as a common control in multiple reports instead of copying and pasting HTML items. The script is more reusable through parameterization using the Configuration property and passing in data using Data Stores. It uses a supported method of accessing IBM data using Data Stores instead of being forced to scrape the HTML output. Script files can be edited in your favorite dev tools instead of the HTML Item textbox. No global variables No name collisions Multiple instances can exist on a page without using "_THIS_" Code does not accumulate and use more and more memory It allows you to bring in 3rd party libraries. It’s easier to debug You can debug just your file without the viewer's implementation getting in the way The script author can report an error by throwing a scriptableReportError and the viewer will display the message. Scripts written against the supported interfaces will continue to work between releases. The API will expand from release to release exposing more capabilities. We welcome customer feedback through RFE community voting. Events/notifications are provided for proper synchronization. It expands the original Prompt API and exposes most controls for scripting Many extensions points provided to seamlessly implement an alternative prompt control All controls can be accessed by name in addition to prompt controls. Simpler to implement collapsible regions What happens to existing reports with JavaScript embedded via HTML item Inline JavaScript and referencing external script using HTML items will continue to work when report is rendered in classic viewer (with Full Interactivity set to No). This does not include JavaScript written specifically for rendering in quirks mode, or JavaScript relies on our DOM (Document Object Model) structure. Detailed technical documentation describes the new APIs can be found here. Samples There is a new set of samples for Scriptable Reports for 11.0.5. These samples are installed by default in an Easy installation, and are an option in a Custom installation. You can find them here: <Cognos installation directory>\samples\JavaScript\ For your convenience, you can also obtain the samples here. Download the following three files: 1. Follow these setup instructions. If you are using a Gateway, please read Step 6 carefully! 2. Unzip and place these javascript files. 3. Import this report deployment. Related posts: Video: Overview: Scriptable reports (11.0.4+) How to use a custom control with JavaScript to hide and show a filter panel in IBM #Cognos Analytics 11.0.7