Skip to main content

Posts

Showing posts with the label JSF 2.0

Integrate Charts in Jasper Reports +JSF 2.0

In this post we will walk through how to integrate Charts (JFreeChart) into Jasper Report framework. JasperReports is the world's most popular open source reporting engine. It is entirely written in Java and it is able to use data coming from any kind of data source and produce pixel-perfect documents that can be viewed, printed or exported in a variety of document formats including HTML, PDF, Xlsx, Docx, Pptx, Odf Check my  Introduction to Jasper Reports and  Sub-report with jasper Report posts. 2-ways to Integrate the Charts/Graphs into Jasper Reports Use JFreeChart API inside Jasper Report to generate the Charts while generating reports Use any 3rd party Java Libraries to create the chart and stored in In-memory Image object (or) stored in file. then pass the Image/file to Jasper Report. then embed the Image into Report. (check here ) In this post we going to use 1st option. In Jasper Report use JFreeChart Components to make charts. In my next post we will see the

JSF + JPA + JasperReports (iReport) Part 2

In this post  is  a continuation of Jasper Report Part 1 . here we will discuss about some advanced jasper report concepts like passing complex object like List, Date object and how to create and use local variable in jasper report, Add the sub-report and background image to report. Check my latest post about  Integrate Charts into Jasper Reports . here i am using JPA (Java Persistence API) for accessing the Database. so i create the two entity ShoppingCart and Item. here ShoppingCart entity contain list of Item entities. then i am going to pass these objects to Jasper Report. (Check the video in below) ShoppingCart.java Item.java Create Report           now i am going create report. we can use iReport standalone or iReport Netbeans Plugin to create the report. first we need to create some fields in report. these fields are matched with ShoppingCart Bean property names and Data types also. and set the data types of these fields correctly. firstName  ==>

JSF + JPA + JasperReports (iReport) Part 1

Hi in this post we will see the overview of  JasperReports  and how to integrate into JSF application. JasperReports is the world's most popular open source reporting engine. It is entirely written in Java and it is able to use data coming from any kind of data source and produce pixel-perfect documents that can be viewed, printed or exported in a variety of document formats including HTML, PDF, Excel, OpenOffice and Word.  In Primeface  library also use this JasperReports to generate the PDF, CSV and DOC formats with single line of code. see here . but its not flexible and we cant change template. so here we see the how to use JasperReports for create the template and integrate  JSF 2.0. We are using iReport tool for crating template. Download JasperReports and iReport Jasper Reports download from here . This zip contain jasper library and its dependencies and lots sample codes. iReport download  from here Now create the simple JSF Application to retrieve the data f

Understanding Java Server Faces 2.0 Part 3

This is Third  part of JSF 2.0 discussion. Please visit  part one   and part two Update : New Post JasperReports in JSF In this post we will discuss JSF with AJAX. In JSF 2.0 gives full support for ajax integration in web application.  With Ajax, web applications can send data to, and retrieve data from, a  server  asynchronously (in the background) without interfering with the display and behavior of the existing page. so with help of ajax we will make more interactive page.   JSF 2.0 Faclets provide <f:ajax> tag for achieve ajax in web application without writing client side java script ajax code. JSF 2.0 takes care all of this. JSF and ajax integration is one of the greatest feature. and no other framework provide this much easy ajax integration in web application. Consider we have one simple web application it prompt the name and click submit button its display the name in same page in some where . we will see this example without ajax  index.xhtml < h

Understanding Java Server Faces 2.0 Part 2

This is Second  part of JSF 2.0 discussion. Please visit   part one   Update :  New Post JasperReports in JSF In JSF 2.0 part 1   post, i used  @ManagedBean annotation for POJO java class. Its OK, actually it derived from JSF 1.2.But we should use @Named annotation instead of @ManagedBean, if CDI  ( Contexts and Dependency Injection ) environment is available. I used Tomcat 7, its not Java EE 6 server and by default CDI is not available.  But we can use JBoss's Weld lib for achieve  CDI in tomcat with minimal configuration. Weld is reference implementation of CDI and its comes standalone version also. This standalone version weld provide CDI environment for both Web Application and Java SE application. By default Glassfish 3.0/3.1 server comes with weld  library for CDI Environment. Here i am using Glassfish server with CDI enabled. Page Navigation        This post we will discuss page navigation in JSF2.0. Page Navigation means flow of the application. From one page

Why should I learn JSF

Java Server Faces (JSF) is one of the presentation web frameworks in java. There is lots of others frameworks like Spring, GWT, Wickets, Struts. Today this post we ll discuss why JSF is more important then others.Here I am not  criticize any frameworks. i just talking about JSF.   In JSF 1.2 and previous version of JSF used JSP as a view declarative language and JSP life cycle is not matched with JSF and ajax requests. JSF 1.2 are complex to use and they have some short coming in feature. But JSF 2 is completely changed the adapt lots of technologies, but still its support backward compatible.Its very easy to learn. More over JSF is center piece in Java EE 6 Spec. It means that what are the new components or specification introduced in Java EE 6 are seamlessly integrated into JSF. Because those components spec is designed for JSF in mind.

Understanding Java Server Faces 2.0 Part 1

Update : I put new post for  Why should I learn JSF                   I put new post for  Understanding Java Server Faces 2.0  Part  2   JavaServer Faces (JSF) is a Java-based Web application framework intended to simplify development integration of web-based user interfaces.  Java Server Faces (JSF) 2.0 is a improved component of Java EE 6 Specification.  Its Component based model. Its is alternative technology for Struts, JSP, Spring. Its MVC (Model-View-Controller) based architecture.