Crow Canyon Software Support Crow Canyon Software Support

  • Support Homepage
  • Community Forum
  • Submit a Support Ticket
  • CrowCanyon.com Website
  • Version Release Notes
Home / NITRO Studio- Reports / How to customize NITRO Reports using Script

How to customize NITRO Reports using Script

1241 views 1 min , 5 sec read 0

Applies To

SharePoint Online and SharePoint On-Premises

Description

This article describes the process of configuring NITRO Reports data using JavaScript in the configuration. Below are some use cases that require script in NITRO Reports

Use Case 1: How to put currency symbol in Report for currency column values in Table report.

Go to NITRO Report configured for the list –> Advanced settings –> Customize Report –> Add/Edit Script –> set the below script.


Script used below:

var scriptManager = {};
//Modify the chart properties. This is applicable for updating Charts like bar, column etc.
scriptManager.PreRenderCharts = function(objKendoChart, functionCallback){
               //Modify objKendoChart properties.
               functionCallback(objKendoChart);
};

//Render table report values. Val is the actual cell value in the below script. We need to configure JavaScript to set updated value depending on the requirement. In this case, we are setting the currency symbol $ before the cell value.

scriptManager.tableValueRender = function(val){
               return "$"+val;
};

//Render table report Total X-axis values
scriptManager.tableTotalXRender = function(val){
               return "$"+val;
};

//Render table report Total Y-axis values
scriptManager.tableTotalYRender = function(val){
               return "$"+val;
};

return scriptManager;

Sample Report:

Use Case 2: How to scale the actual values in Millions or hundreds to avoid getting zeroes in Report

Script below is referring to reduce the actual value divided by 100 in this use case.

scriptManager.tableValueRender = function(val){
if(val === 0 || (val &&  !isNaN(val))){
               return "$" + ((Number(val))/100);
    }
               return "$"+val;
};

NITRO Studio- Reports

About supportTeam

View all posts by supportTeam →

Related Articles

  • NITRO Studio Workshop: Deep Dive into NITRO Reports
  • NITRO Studio Workshop: Build a Dashboard with Tiles & Dials, and Reports
  • Introduction to Report Manager in NITRO Studio
  • Show time taken to close the Ticket (from time it is created to closed) in Crow Canyon applications
© 2021 Crow Canyon Systems, Inc. All Rights Reserved
  • Terms of Service
  • Privacy Policy
  • www.crowcanyon.com