Tuesday, September 20, 2016

BIRT Viewer in Tomcat




BIRT Viewer in Tomcat


BIRT is a powerful and open source reporting tool in java and its easy and compatible.
To install BIRT viewer firstly we should have tomcat server, if you don’t have please download the tomcat from https://tomcat.apache.org/download-80.cgi and it’s better to use a binary distribution rather installer.
After configuring tomcat, we should download the birt viewer.
And Download the file under “Report Engine OSGi Deployment” file named
birt-runtime-osgi-4.6.0-20160607.zip
After successful download of the file, Unzip the file and you can see all the files as below.



Steps to be down after downloading the file.
1.       Now the birt.war file should be copied into tomcat webapps.
2.       And copy the jar files into tomcat lib.
If you are using mysql database, you should put mysql-connector-java-5.1.30.jar
If you are using mongodb database so you should put mongodb-driver-3.3.0.jar
Finally, we should copy commons-logging-1.2.jar
3.       We should unzip the birt.war and place in a folder of the name you want. Here I placed in birt folder.
4.       For Mongo DB users We should go to apache-tomcat-7.0.42\webapps\birt\WEB-INF\platform\plugins and need to remove org.eclipse.birt.data.oda.mongodb_4.6.0.v201606072122.jar and need to update the new one with mongo-java-driver-2.13.1.jar
And that’s it the configuration has been done.

Now we need to check the birt in tomcat.
1.       Go to tomcat bin directory and start the tomcat by using startup batch file.
2.       And open the browser and type in http://localhost:8080/birt/
3.       You can see the page as below.



4.       So, birt has been installed in tomcat now.
5.       And we can check the sample report by clicking on the link View Example on the same page we can see



6.       Now we will check the report which we have made in eclipse. So, we should place our files in the tomcat/weapps/birt/test1.rptdesign

Now you can see the report



8.       Now we can place as many reports as we want and see on the server also.


Happy Coding with BIRT… Enjoy!!



Maven Plugin Installation Steps in Eclipse



Maven Plugin Installation Steps


First in eclipse go to Help -> Install New Software



And Then click on Add and type in
Name = Maven or whatever name you like



And It will load the available plugins and select all of them as below



And Click on next



Click on next



Click on I accept and click on next



And the Plugin will be installed.

After successful installation IDE prompts to restart. Please restart the system and after restart you can see the convert to Maven and we can also see maven project in new.



Enjoy Maven.

Wednesday, September 7, 2016

Setting up BIRT in eclipse



BIRT Installation


To install BIRT we have two scenarios like
I.                     We can directly download BIRT included Eclipse
II.                   We can install Plugin in the Eclipse we have

BIRT Included eclipse Downloading steps
Go to the link http://download.eclipse.org/birt/downloads/ and Click on All in one

 


BIRT Plugin Installation Steps

1       Open Eclipse
2       Go to Help and Click on Install New Software
3       In the menu Click on Add button then we should add the details like below


     Click Ok.
5       The below Screen will display


6    Select all and click on Next.
        And accept the license agreement.
8      And installation will start



 After successful installation you can see the Birt files in the file menu.

 Enjoy Doing Reports...

Have a Good Day.... :)


Tuesday, January 21, 2014

Code for video calling using webRTC


Here is the code and step by step procedure how to execute the code
Step1
Download the Zip file or Source Code from then  after opening the folder you will find the following folders.


Step2
After downloading the files add them to the root directory of netbeans
Example
In NETBEANS
·       Video chat
o   Webpages
§  VideoConference.htm
§  Capture.htm
§  captureAndeffects.htm
§  index.jsp
§  websocket-server.js

Here Video chat is web application created in netbeans
After adding files in this manner to the root directory of web application.
Step 3
Download the Node.js from nodejs.org and install it.
Step 4
After installing open the Node.js command prompt and perform the following steps
Go to the directory where websocket-server.js is located from the downloaded souce files.


Then type the following command
Node websocket-server.js

If you get an error like this

it means that websocket server is missing to install this follow the below steps
   npm install websocket@1.0.3
   npm link websocket@1.0.3
   node websocket-server.js

Then server is ready to listen on port 1337.
Step 5
Open the VideoConference.htm page and change the ip address to server ip address where the server has been run.
Example
var socket = new WebSocket('ws://127.0.0.1:1337/');  change ip address don’t delete the port number.
After changing the ip address then it is ready to run
Run the Video Conference.htm
Then it displays the following page


Saturday, November 23, 2013

JAVA – How To Calculate An Age From A Date Of Birth (DOB)

The following code illustrates how to derive an age from a given DOB.

This example uses the DOB format YYYY-MM-DD.

This can be altered to any format by changing the substrings taken from the original DOB input.


=======================================================================


String dob = “1990-05-07″;
//TAKE SUBSTRINGS OF THE DOB SO SPLIT OUT YEAR, MONTH AND DAY
//INTO SEPERATE VARIABLES
int yearDOB = Integer.parseInt(dob.substring(0, 4));
int monthDOB = Integer.parseInt(dob.substring(5, 7));
int dayDOB = Integer.parseInt(dob.substring(8, 10));
//CALCULATE THE CURRENT YEAR, MONTH AND DAY
//INTO SEPERATE VARIABLES
DateFormat dateFormat = new SimpleDateFormat(“yyyy”);
java.util.Date date = new java.util.Date();
int thisYear = Integer.parseInt(dateFormat.format(date));
dateFormat = new SimpleDateFormat(“MM”);
date = new java.util.Date();
int thisMonth = Integer.parseInt(dateFormat.format(date));
dateFormat = new SimpleDateFormat(“dd”);
date = new java.util.Date();
int thisDay = Integer.parseInt(dateFormat.format(date));
//CREATE AN AGE VARIABLE TO HOLD THE CALCULATED AGE
//TO START WILL – SET THE AGE EQUEL TO THE CURRENT YEAR MINUS THE YEAR
//OF THE DOB
int age = thisYear – yearDOB;
//IF THE CURRENT MONTH IS LESS THAN THE DOB MONTH
//THEN REDUCE THE DOB BY 1 AS THEY HAVE NOT HAD THEIR
//BIRTHDAY YET THIS YEAR
if(thisMonth < monthDOB){
age = age – 1;
}
//IF THE MONTH IN THE DOB IS EQUEL TO THE CURRENT MONTH
//THEN CHECK THE DAY TO FIND OUT IF THEY HAVE HAD THEIR
//BIRTHDAY YET. IF THE CURRENT DAY IS LESS THAN THE DAY OF THE DOB
//THEN REDUCE THE DOB BY 1 AS THEY HAVE NOT HAD THEIR
//BIRTHDAY YET THIS YEAR
if(thisMonth == monthDOB && thisDay < dayDOB){
age = age – 1;
}
//THE AGE VARIBALE WILL NOW CONTAIN THE CORRECT AGE
//DERIVED FROMTHE GIVEN DOB
System.out.println(age);