Translate

Tuesday, 8 September 2015

How to add System Variable/Environment Variable in Mac OS

Following are the steps to set up the variable.

1. Open terminal.
2. Type the command ->  touch ~/.bash_profile -  The touch utility sets the modification and access times of files.  If any file does not exist, it is  created with default permissions
3. Type the command ->  open ~/.bash_profile - This will open the file.
4. Then you will see a file, it could be blank or you can see some variables already there. Now there are two things:
    a. You want to create a new variable all together  the format will be
         export VariableName=Path/Value to be set   (Please mind the spaces)

    b. You want to append the path, like in case of JAVA Path.the format will be.
         export existingVariableName=$existingVariableName:new value to be appended
     
         For instance export PATH=$PATH:/usr/bin/java

5. Now You save the document by pressing Command + S
6. Now type the command - source ./.bash_profile - This will save your changes.
7. To check the value of your system variable simply  write - echo $YourVariableName


Hope that this helps!!

Thanks!!

Tuesday, 18 August 2015

How to resolve can't add a cell error - While Exporting to excel in Jasperserver

This is an error which you get while exporting the data from the Jasperserver in the Excel Format.

Something of this sort






For resolving this you should check some of these errors:

1. Number to string cast exception:
This means that a number is wrongly appended to a string in which wrongly cast number into string.
In order to fix this, you will have to use the command as

new DecimalFormat("##,#0.00").format(number).toString()
This will cast your number into two decimal places with the thousand separator.


2. Another error that can be checked is of any other cast errors, or formatting of the data in the report.


Cheers!!


Wednesday, 11 February 2015

Setting mail account for Subscription of scheduled Jobs in JasperServer.


I wanted to document the process from a long time but due to crunch of time I could not, but now I will like to explain the process in simple easy to follow steps.

First of all I would like to give an idea to problem addressed in the blog, basically when a report runs as a daily status or daily count one need not run it manually it could be scheduled, but when the report is scheduled the export in desired form is exported on jasper server.

But wait a minute do we really login and see what the results came as in the PDF, Excel etc. export, no we need not the problem is handled by mail subscription attached to the scheduler, which will automatically send the Exports to the subscribers on their email accounts and send a confirmation to the administrator.

So lets cut the explanation and lets jump directly into how to do.

Prerequisites -

1. You should have working copy of JasperServer community/pro
2. You should have uploaded a report to the server
3. Choose you favourite text editor  (Windows(default) - Notepad/MacOS(default) - TextEdit)
4. Shut down the jasper server so that no sort of errors come in case of Editing/Saving documents.

after following the above prerequisites now we head on to edit two files as follows.
Both these files will be found at the location
<directory of Jasperserver on Disk>/apache-tomcat/webapps/jasperserver/WEB-INF/

1. js.quartz.properties
   - Edit the file with the Text Editor
 
Change the portion of the document as (Please select your own server details I have used a gmail account )

report.scheduler.mail.sender.host=smtp.gmail.com
report.scheduler.mail.sender.username=testpanda@gmail.com
report.scheduler.mail.sender.password=password
report.scheduler.mail.sender.from= testpand@gmail.com
report.scheduler.mail.sender.protocol= smtp
report.scheduler.mail.sender.port= 587
  - Make the changes and save the file.

2.   applicationContext-report-scheduling.xml

  -  Locate the bean reportSchedulerMailSender
  -  Locate the property javaMailProperties
  -  Do the changes as below - This will enable java to interact the smtp/startls authentication.      

         <props>
                <prop key="mail.smtp.auth">true</prop>
<prop key="mail.smtp.starttls.enable">true</prop>
            </props>
  - Now save the document.

Now the report subscription is ready for run, just start the Jasper Server and you are good to go.

Cheers!!

Tuesday, 20 January 2015

How to export and import a Jasper Server Repository on a remote system

In this blog I have explained the steps to import and export the JasperServer Repository (In the steps below I have used a Remote Linux Machines accessed via windows machine)

Before following the steps there would be requirement of following softwares-
1. WinSCP - To browse the files in Linux machine
2. PuTTy - To run the commands for export/import in the Linux shell



Steps Export reports in Jasper Reports

1. Open PuTTy - and key in the IP address 
2. Enter the username and password.
3. Navigate to the folder /opt/jasperreport-server-5.0/buildomatic
4. Run the command  ./js-export.sh --uris <Path of the Report>  --output-dir <Name of the folder to be exported>
5. Open the WinSCP, and key in the  IP Address as well as the credentials and set the Protocol as SFTP .
6. Navigate to the folder /opt/jasperreport-server-5.0/buildomatic
7. Drag and drop the folder created earlier to the local machine.



Steps Import reports in Jasper Reports

1. Open the WinSCP, and key in the  IP Address as well as the credentials and set the Protocol as SFTP .
2. Navigate to the folder /opt/jasperreport-server-5.0/buildomatic
3. Drag and drop the folder downloaded with the report.
4. Now Open PuTTy - and key in the IP address 
5. Enter the username and password.
6. Navigate to the folder /opt/jasperreport-server-5.0/buildomatic
7. Run the command  ./js-import.sh --input-dir <name of the folder copied earlier>

Monday, 12 January 2015

Fresh setup of Jasper Reports from scratch - For beginners

I have been thinking to compile  a document which outlines the complete process of installation and setup of the connection because generally when one starts they do not find much of material and they tend to get stuck on a trivial issue.

So the post will have two portions, namely Installation and Setup.


Installation 

This document will apprise you with the basic installation software, which would act as a prerequisite to run Jasper Report.
  1. Java
    As Jasper Reports is built on Java platform, so a proper installation of Java Development kit (jdk) is required. For official steps to install java one can refer to the link
    https://www.java.com/en/download/help/windows_manual_download.xml
  2. iReport Designer
    This is a third party Jasper Report designing software. iReport is the most popular visual designer tool for JasperReports Library and JasperReports Server (Business Intelligence).
    The software can be downloaded in an exe run able format for windows machine, or other types of files as per the platform demands.
    http://community.jaspersoft.com/project/ireport-designer/releases


  3. Jasper Server
    This is the software which acts as the interface which provides web touch to the reports rather makes it interactive in terms of external links and the drill downs
    Below is the link from where the file could be downloaded.
    http://community.jaspersoft.com/project/jasperreports-server/releases

  4. Database  Server -
    The database server or the datasource which serves the purpose of feeding data to the report, in this projects case the setup was in the SQL Server 2008, which could vary from project to project .
     
  5. Netbeans(Optional)

Netbeans is the development environment where in you could create sciptlets for customization purposes in the Jasper Reports. You could even go on to make customizations on the charts, where in you could use the
https://netbeans.org/downloads/ (Download the SE version)



Setup and Connection

Below are the steps for the setup, which would act as a prerequisite to run Jasper Report.
  1. Java
    Download and install java 7, please do mind not to install Java 8 as it is yet not supported by iReport.
  2. iReport Designer
    After installing the iReport, first thing you need to do is that the inclusion of java connector

    Below is the process to include the Java Connector

    i.  Download the Java connector for the Datasource, as we have the SQL Server datasource we need to download
    http://www.java2s.com/Code/Jar/s/Downloadsqljdbc120jar.htm
    For more info on the Connector follow the link -- https://docs.oracle.com/cd/E19501-01/819-3658/gcfoy/index.html

    ii.  Navigate to Tools—> Options  Classpath
    And select the Add JAR, and then browse to the downloaded path of the connector

    Now we  need to add a JDBC datasource

    i. Click on  the icon shown below on the top of the iReport window




  1. ii.  In the popup select New  Select The Datasource type as Database JDBC Connection

    iii. Now Enter the name of the connection, select the SQL Server driver and enter the name of the database in the url of the database, also key in your credentials, refer to the screenshot below





    iv. Now test the connection, it will say the connection successful.

    We are now ready to create reports.

  2. Jasper Server
    After installation in order to run Jasper Server open the browser and key in
    localhost:8080/jasperserver
    Then login using the credentials jasperadmin/jasperadmin

    Then setup the connection, righ click on the node and add a datasource
    Enter the details below,  for the connector and setup the datasource.



The above steps are pretty basic and gives a fair idea as to what all basic necessities are there to process the installation and setup.

Friday, 21 November 2014

Jasper Report- JRException: Image read failed

 This Exception comes generally when you try to export the report on Jasper Server in PDF Format, or from iReport, then due to the error in some of the image or all the images, which is producing the error.

So to overcome this issue, you could set following properties of the image:

1. Firstly you could simply setting the Cache Property to true
2. If that does not resolves the issue then you can set the property Error type to Blank


Hope that this helps.

Cheers!!


Monday, 3 November 2014

Jasper Reports Server's unique Source Code Management System


Jasper Reports Server is basically a stand alone as well as embedded  reporting server which can be easily used for deploying the Jasper Reports. It provides a way to embed reports as well as analytics into a web or mobile application, as well as act a informational hub.

Server is made to securely share and manage the Jasper reports and analytic views. The security feature is implemented via role management and user creation facility in Jasper Server.

Now there are two ways you can use Jasper Server
1. Standalone application
2. Embed into services, or applications.

Now moving on to the Source Code Management,


    What benefits do Source Code Management tools provide?

SCM tools help development teams in many ways:
  • Collaboration: SCM tools prevent one user from accidentally overwriting the changes of another, allowing many developers to work on the same code without stepping one each other's toes.
  • History: SCM tools track the complete development history of the software, including the exact changes which have occurred between releases and who made those changes.
  • Release notes generation: Given the tracking of each change, the SCM can be used to generate notes for their software releases which accurately capture all of the changes included in the new release.
  • Documentation and test management: SCM tools can be used to manage not just software source code, but also test suites and documentation for their software.
  • Change notifications: To keep interested members of the team informed when changes occur to the source code.

   Who uses SCM tools?

SCM tools are used by:
  • Project developers who are writing source code.
  • Project testers who need to download the very latest changes.
  • Advanced users who want to try out code that is not yet stable, mature or released.

In JasperServer, the SCM is managed very intelligently, whenever you draw a report for viewing in then you always get a version of the report, so you are not really modifying what is there on server. 

Jasper Server always keeps the original content on the server and provides the user with an instance of the report which is directly stored in the Temp folder, and if you need the modified version you have created as the current version then you need to replace the report with the current version of the report, by right clicking on the report in the repository and then replacing the report.

In light of this feature there is also a extreme care to be taken that which version is being replaced, because if once replaced the version of the report will be changes and it would be not possible to roll back the change.

This feature is really very great when you need to work on the small modification in the report as you can draw a copy on the local system and work onto that until you get the desired modification as well as you can simultaneously compare the previous version of the report and if you get the desired changes executed you can replace the report and have a new version of the report.

Hope this information helps you a lot!!
Cheers!!