 <p>You can download jar from below link</p> <p><a href="http://www.java2s.com/Code/Jar/d/Downloaddynamicreportscore310jar.htm" rel="nofollow">http://www.java2s.com/Code/Jar/d/Downloaddynamicreportscore310jar.htm</a></p> <p>Or If you are using maven then just add below dependency to your pom.xml file</p> <pre><code>&lt;dependency&gt; &lt;groupId&gt;net.sourceforge.dynamicreports&lt;/groupId&gt; &lt;artifactId&gt;dynamicreports-core&lt;/artifactId&gt; &lt;version&gt;3.1.3&lt;/version&gt; &lt;/dependency&gt; </code></pre> <p>XHTML page </p> <pre><code>&lt;h:commandLink id="summary_jasper" actionListener="#{workReportBean.prepareJasperReport()}"&gt; &lt;p:graphicImage name="/images/jasper.png" title="Jasper"/&gt; &lt;/h:commandLink&gt; </code></pre> <p>Managed Bean //Just provide DB_NAME, CREDENTIALS and TABLE_NAME, JASPER report will be created for you </p> <pre><code>public void prepareJasperReport(){ Map&lt;String, String&gt; columnNameNTypeMap = new HashMap&lt;String, String&gt;(); Connection connection = null; try { Class.forName("com.mysql.jdbc.Driver"); connection = DriverManager.getConnection( "jdbc:mysql://localhost:3306/DB_NAME", "USER", "PASSWORD"); ResultSet rsColumns = null; DatabaseMetaData meta = connection.getMetaData(); rsColumns = meta.getColumns(null, null, "TABLE_NAME", null); while (rsColumns.next()) { columnNameNTypeMap.put(rsColumns.getString("COLUMN_NAME"), rsColumns.getString("TYPE_NAME")); }} catch (SQLException e) { e.printStackTrace(); return; } catch (ClassNotFoundException e) { e.printStackTrace(); return; } // a new report JasperReportBuilder report = DynamicReports.report(); // populating new report with TABLE object report.setDataSource("select * from TABLE_NAME;", connection); // creating COLUMNS // add extra datatypes if your table have ex. long, float etc for (Map.Entry&lt;String, String&gt; entry : columnNameNTypeMap.entrySet()){ if(entry.getValue().equalsIgnoreCase("int")){ report.columns(Columns.column(entry.getKey(), entry.getKey(), DataTypes.integerType())); }else if(entry.getValue().equalsIgnoreCase("varchar")){ report.columns(Columns.column(entry.getKey(), entry.getKey(), DataTypes.stringType())); }else if(entry.getValue().equalsIgnoreCase("bit")){ report.columns(Columns.column(entry.getKey(), entry.getKey(), DataTypes.booleanType())); }else if(entry.getValue().equalsIgnoreCase("datetime") || entry.getValue().equalsIgnoreCase("date")){ report.columns(Columns.column(entry.getKey(), entry.getKey(), DataTypes.dateType())); } } report.title(Components.text("Summary Report").setHeight(40) .setStyle(DynamicReports.stl.style() .setBold(true).setFontSize(16).setForegroundColor(Color.BLUE) .setAlignment(HorizontalAlignment.CENTER, VerticalAlignment.MIDDLE))); report.setColumnTitleStyle(DynamicReports.stl.style().setBold(true)); report.setColumnStyle(DynamicReports.stl.style().setHorizontalAlignment(HorizontalAlignment.LEFT)); report.setHighlightDetailEvenRows(true); report.pageFooter(Components.pageXofY()); try { // show the report report.show(false); // export the report to a pdf file //report.toPdf(new FileOutputStream("d://report.pdf")); } catch (DRException e) { e.printStackTrace(); } /*catch (FileNotFoundException e) { e.printStackTrace(); }*/ } </code></pre>