Convert Comma Seprated Profile Attribute to list in Jasper Reports

Convert Comma Separated Profile Attribute to list in Jasper Reports


As we know, we can add profile attribute to jasper server but which accepts only string type parameter. So this blog will help you to convert string profile attribute to list.

We know that the built in parameter LoggedInUserAttribute_<Attribute Name> is used to access value of that particular profile attribute by replacing <Attribute Name> to corresponding profile attribute name. But this will return the data in string format. So to convert this string data into list do the following.

  • Create subreport or new dataset
  • Create a parameter (say StateList) into new dataset or subreport with data type as List
  • Now at the time assigning value to parameter(StateList) do this

statelist=Arrays.asList($P{LoggedInUserAttribute_<Attribute Name>}.split(","))

  • Now you can use this parameter as a list in your SQL query either in subreport or new dataset.

Note: Your profile attribute should be in comma separated format.

Must watch talks from React Europe

Must watch talks from React Europe

If you are an react developer, you must have heard about react-europe. It’s a conference where developers from different parts of the world come together and share their experiences and knowledge while using `React.js`. This year, it was held in Paris and talks were given by likes of Ryan Florence, Chistoper Chedeau to name a few.

This is my view. Yours may defer. This is in no ways intended to promote or demote someone

Below are few of the talks (in no particular order), which I believe are a must watch for a react developer:

Ryan Florence – Don’t Rewrite, React!

In this video Ryan Florence talks about migrating your existing app to react and also shows a live demo of converting a backbone todo list to react.

Dan Abramov – Live React: Hot Reloading with Time Travel

In this video, Dan Abramov talks about “hot reloading” react components without losing the state and also demos the ability to move between states a.k.a time-travel. He also demos his new library called “Redux”.

Cheng Lou – The State of Animation in React

In this video, Cheng Lou demonstrates how he has solved the problem of animating components in react.

Evan Morikawa & Ben Gotow – How React & Flux Turn Apps Into Extensible Platforms

In this video, the speakers show a way to make a react app more extensible by making use of plugins.

Michael Jackson – React Router

In this video, Michael Jackson (no not the king of pop), talks about the problems faced while developing the react-router.

Expanding Tables (DataTables)

Table Expansion

Table Expansion refers to the ability of a table to open up an extra block and display additional data about the selected row.

For example, a table might be showing the details of the different departments in a company and when a department is selected, a new row “opens up” or “expands” to show another table containing the names of the employees in that department.

ScreenShot 1:



Here you can see that the list of departments is given in a tabular form along with its department id.

ScreenShot 2:


Here when the user clicks on the department name (“HQ General Management”), a new row opens up and gives another table containing the details of the people working in that department.


How is it Done?

There are 3 components created to make this type of table possible

  1. Outer Table (tabularChart)
  2. Inner Table (innerTabularChart)
  3. Custom Script (runScript)

The first two components are alotted <div> tags in the .html file while the script is needed to display the Inner Table inside the outer table at the desired location.

The Outer Chart is created by calling “chart 1” from the tabular.efwvf file. For the creation of the initial table we have used a hard coded SQL query in dataConn.efwd file since this is a test example.

We add a “on click()” function to the “$(document).ready(function () {  /*script*/});

This “on click”function recognises where the click is occuring, i.e- on which department name. This deparment name is then passed onto the “chart 2” creation script where the new table (Inner Table) is dynamically created by fetching the data from the database, based on the “department name”.

Here, the “opened row” is also alloted a new id and class name, making it identifiable for later references.

Now this second table is placed at the <div> tag with the id “innerTabularChart”, but it is not made visible.

Here is the tricky section, the code doesnt display the Inner Table on the screen but it is present in the memory awaiting command that will display it on the screen.

At this point, the Custom Script is executed. The job of this script is to “Clone” (using .clone()) the data held in the <div> tag called “innerTabularChart” and display it in the “opened up” row.

Once the inner table is displayed inside the opened/expanded row, it is VERY important to empty the initial <div> tag of the .html file so that the new table doen not get displayed as a drill-down chart.

After the “innerTabluarChart” wiped clean, all the components are updated. Now we finally get the result of expanding tables as seen in the above screenshots.

Important :

If user wishes to add more than one table in the “expanded” row, It can be done by splitting the <div id=”innerTabularChart”>  tag and writing the appropriate custom script for displaying the second table.

html code:

<div class=”row”>
<div class=”container”>
<div class=”col-sm-11″ style=”padding-left:30px;”>
<h2 id=”heading”>Table Expansion Example</h2>
<div class=”container”>
<div class=”row”>
<div class=”col-sm-12″ id= “tabularChart”></div>
<div class=”col-sm-12″ id=”innerTabularChart” style=”display: none;” ></div>


//Custom script


Cacti Installation in Windows

Cacti Installation in Windows


Cacti is a complete network graphing solution which is frontend tool to RRDTool.
Cacti frontend is completely PHP driven.
It maintains the graphs as well as handles the data gathering.

Install and configure Cacti :

  1. Install cacti from the zip distribution and install in the web root or your choice. May choose to install into a “Cacti” sub folder.
  2. RRDTool – Install from the Cacti website. Install it into the c:\cacti directory.
  3. PHP 5.x – Install into the c:\php folder. If you choose to install into c:\Program Files\php, you will have to use 8.3 filenames to reference it’s binaries in Cacti.
  4. Install the MySQL.


  • Configure PHP


– Add the following directory to the existing Windows System PATH environment variable: c:\php. The Windows path can be accessed via the Control Panel at: System | Advanced | Environment Variables | System Variables.
– Add the following directory to a new Windows System environment variable called PHPRC: c:\php.
– Add a new Windows System environment variable called MIBDIRS set it to c:\php\extras\mibs
– Rename the file c:\php\php.ini.dist to php.ini, and make the following changes to it:

Uncomment the following lines.

extension_dir = c:\php\ext
cgi.force_redirect = 0


  • Configure the Webserver (Apache)

– Make sure you have stopped any IIS web servers before you proceed with Apache installation, or make sure Apache is configured on an alternate port.
– If using Apache 2.x and PHP 5, then add the following lines.

LoadModule php5_module c:\php\php5apache2.dll
AddType application/x-httpd-php .php
DirectoryIndex index.html index.htm index.php


  • Follow the Next Steps :
  1. Create the MySQL database:

shell> mysqladmin –user=root create cacti

2. Import the default cacti database:

shell> mysql cacti < cacti.sql

For Ex.

mysql.exe -u root -p cacti<C:\Apache2\htdocs\cacti\cacti.sql

3. Create a MySQL username and password for Cacti.

shell> mysql –user=root mysql
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY ‘somepassword’;

For Ex.

mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY ‘cactipw’;

mysql> flush privileges;


  • Configure Cacti

1. Edit (cacti/include/config.php) and specify the database type, name, host, user and password,database port for your Cacti configuration.

$database_type = “mysql”;
$database_default = “cacti”;
$database_hostname = “localhost”;
$database_username = “cactiuser”;
$database_password = “cactipw”;
$database_port = “3306”;

2. Point your web browser to:


3. Open cacti in browser : “localhost/cacti” which will ask you to Install cacti as

4.Click on Next, it will check all dependant path you can set if any path is different in your case.

5.Click on Finish ,after that it will gives you a login windows.
6.Login using the username and password of admin/admin.
7.Next it will be required to change this password immediately so set the New password.

Now You can use the cacti to create the graphs.

Sayali Mahale.

SQL Event Scheduling

SQL Event Scheduling


Event is responsible for making sure that a specified routine (section of query code) is executed at regular intervals that is specified by the user.

An example of use of an Event would be as follows :
A retail store owner wants to see his remaining stocks in his store, in the morning before he opens the store. At such a time, an Event can be created to run at 8:00am, everyday, that will update his database based on the available material.
Under this condition, an Event will be specified which will empty (TRUNCATE) the “Final_Stocks” table and refill it with data from all other tables in the database which are holding the information of remaining stock of goods.

Syntax :
EVENT [IF NOT EXISTS] event_name
ON SCHEDULE schedule
[COMMENT ‘comment’]
DO event_body;

  • event_name : This is the name of the Event that is being created.
  • schedule : The schedule section deals with the starting, ending, and time intervals of repeating the Event.


The schedule section has the following parts :

AT timestamp [+ INTERVAL interval] …
| EVERY interval [STARTS timestamp [+ INTERVAL interval] …]
[ENDS timestamp [+ INTERVAL interval] …]

  • Interval : The interval section specifies the time interval after the previous execution the event needs to wait before being triggered again. The interval should have the following syntax :

Where quantity specifies the duration of unit time (specified in the next section), eg: 3 HOUR.

  • Timestamp : The timestamp uses the current date – time timestamp to specify one of the parameters while scheduling the Event.
  • event_body : This is where the main body of the Event is specified. This section holds the working of the event, what all it should do.


1. Creating an Event :


2. Setting the time :


3. Original Table :


4. Table after Event :


Connection Time Out in AWS EC2

Connection Time Out in AWS EC2


Possible reasons for timeout when trying to access EC2 instance

  • The most likely one is that the Security Group is not configured properly to provide SSH access on port 22 to your i.p.
  • The local firewall configuration does not allow SSH access to the server.
  • The server is not started properly
  • Net connectivity
  • Wrong pem file / Host Name
  • Spelling mistake


When it times out or fails, check the following:

Security Group:

Make sure to have an inbound rule for tcp port 22 and either all ips or your ip. You can find the security group through the ec2 menu, in the instance options.

Routing Table:

For a new subnet in a vpc, you need to change to a routing table that points to internet gateway target. When you create the subnet in your vpc, by default it assigns the default routing table, which probably does not accept incoming traffic from the internet. You can edit the routing table options in the vpc menu and then subnets.

Add Route to Routing Table
Target: <Internet Gateway from earlier>

Elastic IP:

For an instance in a vpc, you need to assign a public elastic ip address, and associate it with the instance. The private ip address can’t be accessed from the outside. You can get an elastic ip in the ec2 menu (not instance menu).


Make sure you’re using the correct username. It should be one of ec2-user or root or ubuntu. Try them all if necessary.

Private Key:

Make sure you’re using the correct private key (the one you download or choose when launching the instance). Seems obvious, but copy paste got me twice.

Alternatively, Building everything back. This included:

  1. Create VPC
  2. Create Internet Gateway
  3. Attach Internet Gateway to VPC
  4. Create Routing Table
  5. Add Route to Routing Table
  6. Create Subnet