Thursday 18 July 2013

Taking backup from the jasper server with an example

Hi..
This post teach you how to take backup of your reports from jasper server..
It could be the entire folder which consists of list of reports
Or a single report.



Will update you with a nice working example as quick as possible as time is very short... probably in 2 or 3 days....
Mean while there is a superb post related to taking back up.
You can find the following link..
http://passionfordata.blogspot.in/2012/04/how-to-take-backup-of-jasperreport.html



Installing Jasper server community with MySQL Database



Pre requisites
1)  Install the Oracle/Sun Java JDK 1.6 or 1.7. Create and set the JAVA_HOME system
environment variable. i.e., Make sure Java path are set for your user profile or system
profile
Please follow the link to get the software.
2. Jasperreports-server-cp-5.0.0-bin-zip
a. Download Jasperreports-server-cp-5.0.0-bin-zip from the below mentioned location.
http://sourceforge.net/projects/jasperserver/files/JasperServer/JasperReports%20S
erver%205.0.0/jasperreports-server-cp-5.0.0-bin.zip/download
3. MySQL database.
a. Please follow this link to get the software.
http://dev.mysql.com/downloads/mysql/5.0.html
Note: We can use any other database as well. For demo purpose we are using mySQL.
4. Apache Tomcat Server
a. Please follow this link to get the software.
http://tomcat.apache.org/download-60.cgi
Follow below mentioned steps to install Jasper server CE 5.0.0 with mySQL database.
Step 1:- Extract all files from jasperreports-server-cp-5.0.0-bin.zip. Choose a destination, such as C:\Jaspersoft on Windows. The directory, jasperreports-server-cp-5.0.0-bin, appears in the file location you choose.
Step 2 :- Copy the <database>_master.properties file for your database from sample_conf and paste it to buildomatic:
Copy from — <js-install>/buildomatic/sample_conf/
Paste to — <js-install>/buildomatic
For example, copy mysql_master.properties to <js-install>/buildomatic.
Step 3:- Rename the file you copied to default_master.properties.
Step 4:- Edit the default_master.properties file to add the settings for your database and application server.
Below mentioned is a sample property values MySql database.
MySQL appServerType=tomcat6 [tomcat7, tomcat5, jboss, jboss7, glassfish2,
glassfish3, skipAppServerCheck*]
appServerDir=c:\\Program Files\\Apache Software Foundation\\Tomcat 6†
dbUsername=root
dbPassword=password
dbHost=localhost
Set the following in the file
webAppNameCE = jasperserver
***NOTE:
Place mysql-connector-java-5.1.10.jar driver in the following location
D:\install SW\jasperreports-server-cp-5.0.0-bin\buildomatic\conf_source\db\mysql\jdbc
Step 6:-
Run the js-install scripts.
a. Start your database server.
b. Stop your application server.
c. Open Command Prompt as Administrator on Windows.
d. Run the appropriate commands:
js-install-ce.bat : Installs JasperReports Server, sample data,
and sample databases (foodmart and sugarcrm)
js-install-ce.bat minimal : Installs JasperReports Server, but does not
install sample data and sample databases
NOTE
If you installed the optional sample databases, complete the installation by executing this command: js-ant deploy-webapp-ce from buildomatic location in command prompt.
For example in the following location:
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps
Step 7:-
Run the tomcat server and type the jasper server url.
For example: http://localhost:2222/jasperserver/login.html

Monday 15 July 2013

JFree Meter chart customization in Jasper iReport-- Removing values from the meter...

Hi..
This artical will teach you how to write custom code for meter chart to remove the values over the meter.
You need to see the text(theroy) part of the post below mentioned before you start trying this

http://jasper-bi-suite.blogspot.in/2013/06/jfree-bar-chart-customization-in.html

For this artical the output would looks some thing like this.


See there are no values over the meter chart... That you achive using the code below.


package com.sadakar.meter.chart.customizer;
import org.jfree.chart.plot.MeterPlot;

public class MeterChartCustomizer implements  net.sf.jasperreports.engine.JRChartCustomizer{

  @Override
    public void customize(org.jfree.chart.JFreeChart chart, net.sf.jasperreports.engine.JRChart jasperChart) 
    {    
       MeterPlot plot = (MeterPlot) chart.getPlot();
       
        for(int i=0; i< plot.getIntervals().size(); i++)
        {
                if(i >0 && i < plot.getIntervals().size()-1)
                    plot.setTickLabelsVisible(false);
        }     
       
         
    }
}

Thanks for reading this artical..

Other useful blog:

http://passionfordata.blogspot.in/




JFree Line Chart Cusomization in Jasper iReport. Line to Dashed-line, line width,gap in the dashed lines

Hello guys...

Here is the code for customizing Line chart....
The code credit goes to Mr. Shard Sinha.. who is an exprert in cutomizing..

You must read the points in the following artical before you starting this work to do.
http://jasper-bi-suite.blogspot.in/2013/06/jfree-bar-chart-customization-in.html

Grasp.. how to make jar file in NetBeans, How to make jar file, where to keep the jar file, where to call the class in iReport and all the theory related stuff from the above link...

What we are customizing is :
1) Line to Dashed line
2) Line width
3)Gap in the dashed lines

OUTPUT is some thing like as follows:



package com.sadakar.line.chart.customizer;

import java.awt.BasicStroke;

import java.awt.Stroke;

import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.renderer.category.LineAndShapeRenderer;

public class LineChartCustomizer implements  net.sf.jasperreports.engine.JRChartCustomizer{

    @Override
    public void customize(org.jfree.chart.JFreeChart chart, net.sf.jasperreports.engine.JRChart jasperChart) 
    {
        
       CategoryPlot plot = (CategoryPlot) chart.getPlot();
       LineAndShapeRenderer lineAndShapeRenderer =(LineAndShapeRenderer) plot.getRenderer();
       Stroke dashed =  new BasicStroke(1.0f,BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, new float[] {10.0f}, 0.0f);
      lineAndShapeRenderer.setBaseStroke(dashed);
       lineAndShapeRenderer.setBaseItemLabelsVisible(false);
      lineAndShapeRenderer.setSeriesStroke(
            0, new BasicStroke(
                1.5f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER,
                1.0f, new float[] {4.0f, 2.0f}, 0.0f
            )
        );
       
    } 
       
    }
    
Thanks,
SADAKAR
Software Engineer in BI
(jasper, pentaho & Talend)

Jasper Server(Community OR Commercial) Starting up problem resolved by incresing the memory size

Hi Guys...!!!

Here is the tip to increase the size of the memory to start the jasper server ..

What could be the probable scenarios we can observe ..??

If you install external postgreSQL in your machine..
If you install community server with postgreSQL....
If you install another community server(with latest version) with embeded postgreSQL..
If you install commericial server(jasperserver-pro) with postgreSQL....

When you install all these type of servers in your machine ... there might be very slowness of jasper server startup... It may take 30 min or an hour to start the server..

Make sure when you install more than 1 server in your machine there should be different port numbers for every tomcat and every postgre SQL.

for example you have to give:
1) For community some 5050 for tomact,for postgreSQL 1234
2) For community with another version 6060 for tomcat, for postgreSQL 2345
3) For commercial jasper server pro 7070 for tomcat, for postgreSQL 3456
4) pro with another version 9090 for tomcat, for postgreSQL 6789

& also in services stop all the servers.. i.e, make services start up as manual but not automatic.


Increse memorey size in this file as shown below figure.
File location is :  C:\Program Files\jasperreports-server-5.1\apache-tomcat\bin


Edit here : shown red in color.

Shut down the server and then start the server... you are done.

It's always better to run the startup files and shutdown files from command prompt rather than from statr menu or cicking start service from services or clicking on .bat files in tomcat server.

Thanks,

Another useful blog :

http://passionfordata.blogspot.in/

Enjoy now starting up jasper server ... :)


Saturday 13 July 2013

Where and How to download different professional versions of iReport ???

Hi..
The latest version of jaspersoft-pro is 5.2 . and the jasper community download page only gives us the updated software links.
Then how to download 5.1 or 5.0 or 4.7 or 4.5 and etc vesions of jaspersoft ?

Simple..

1. Go to
http://community.jaspersoft.com/download

2.Click on 3rd or any link as shown below image and copy the link address and paste the address in new window address bar of the browser and press enter


address bar:


That's it.
In this way you can download the software as you like .. inplace of 5.2 type 5.1 or 5.0 or 4.7 which ever version you want to download.


Thanks :)
SADAKAR
BI developer(Jaspersoft, Pentaho & Talend ETL)

Tuesday 9 July 2013

XML as datasource for Reports and XPath Queries.

Hello Jasperians...!!!
Here is a nice tutorial for creating a report using XML file as data source and we use X-Path query to get the columns..

LINK :
1) Example
2)Example

Other useful links.


Thanks guys,
SADAKAR.P
Jr BI developer 
(Jaspersoft, Pentaho & Talend ETL)
Helical IT Solutions Pvt. Ltd,
Hyderabad

Stored procedure calling in iReport

Hi guys..
Here is the nice tutorial which demonstrates stored procedure in iReport .

Stored procedures in
MySQL,
SQL,
MS-SQL Server,
PgAdmin(PostgreSQL).


Find the below link and have fun

http://community.jaspersoft.com/wiki/ireport-calling-stored-procedures#PostgreSQL



Will update this artical with a nice working example either using MySQL or PostgreSQL as soon as possible.


Thank you :)




Monday 8 July 2013

Split Excel output into multiple sheets

Hi Jasperians ...!!!!

A friend posted an intersting thing Over LinkedIn that how to split Excel output into multiple sheets... !!! Just worked out and sharing it with you guys..!!!

It's a sample one.. No parameters, No headers are used... There might be getting issues when we use all the stuff..If we work out we can also overcome them.. Though I just want to share how we can split excel output into multiple sheets..!!

Greetings..!!! Here are the stpes to follow...!!!

Aim: To split the output into multiple sheets in Excel exporting
Solution Way: Printing data in one sheet & a bar chart in another sheet.

I have used the follwoing.
i) iReport Designer : 5.0.4 (Community)
ii) PostgreSQL : 9.2 (foodmart database)

Query I have used:
select  * from employee limit 15

Step 1: 
Open iReport desinger and save it to your fav location.

Step 2:
Write the query in query designer area

Step 3:
Remove all the bands from design area except
Column header, Detail & summury band.

Step 4:
Drag and drop your fav columns to detail band as shown in below figure
Drag and drop a bar chart to the summary band as shown in below figure


Step 5 :
We need to set properties at two places.

i) In the report properties
ii) In settings

i) In the report properties
Rport Inspector->ReportName(report1)->Right Click->Properties
Now add the propertey.
net.sf.jasperreports.export.xls.one.page.per.sheet
and value is set to be "true" do not use double quoutes for giving value but in xml code it automatically goes into double quotes.
Find the below image.


ii) In the report Settings
Tools->Options-> Click on export Settings -> In the list of export options click on Excel
It opens Excel Export Parameters
In common tab ---> Check One page per sheet.
Find the image below


NOTE:
Do not forget to place page break on the place from where you want to split the page.

In this example I used page break above the chart so that data comes in one sheet and chart comes in another sheet.

That's it... Save the report and see the preview.
I'm not seeing the preview in Server but previwing internally in the iReport.


OUTPUT
The output would be something like as follows. Find the images of excel sheet.

OUTPUT in first sheet:


OUTPUT in second sheet:



Thanks for posting a good idea to work out on LinkedIn.

Thanks for reading this document.

Simlar posts on various sites:

1) http://stackoverflow.com/questions/3977658/how-do-you-export-a-jasperreport-to-an-excel-file-with-multiple-worksheets

2) http://community.jaspersoft.com/questions/531936/multiple-sheets-excel

3) http://jasperreports.sourceforge.net/config.reference.html

4) http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.xls.one.page.per.sheet

5)http://community.jaspersoft.com/questions/533232/how-create-multi-worksheet-excel-jasper-repor

6) http://community.jaspersoft.com/questions/540310/unable-split-excel-output-multiple-sheets

7) http://stackoverflow.com/questions/8753401/exporting-a-report-with-multiple-sheets-from-jasperserver-to-excel


SADAKAR.P
Software Engineer in BI - Jaspersoft, Pentaho & Talend.
Hyderabad, INDIA.