Classe Para Gerar Chamar o Relatorio do IReport
Autor: David | Publicado: 2012-02-20T18:08:00-03:00



Pessoal segue uma classe fornecida pelo Marcos Vinícius para chamar o relatório gerado pelo IReport






<!--[if !supportLists]-->1.&nbsp; <!--[endif]-->/*

<!--[if !supportLists]-->2.&nbsp; <!--[endif]-->* @(#)Relatorio.java&nbsp;1.0
28/04/2006

<!--[if !supportLists]-->3.&nbsp; <!--[endif]-->*

<!--[if !supportLists]-->4.&nbsp; <!--[endif]-->* Copyright 2006 Marcos Vinícius
Soares. Todos os direitos reservados.

<!--[if !supportLists]-->5.&nbsp; <!--[endif]-->* mvsoares@estadao.com.br

<!--[if !supportLists]-->6.&nbsp; <!--[endif]-->*

<!--[if !supportLists]-->7.&nbsp; <!--[endif]-->*/

<!--[if !supportLists]-->8.&nbsp; <!--[endif]-->&nbsp;

<!--[if !supportLists]-->9.&nbsp; <!--[endif]-->import&nbsp;java.sql.*;

<!--[if !supportLists]-->10. <!--[endif]-->import&nbsp;java.net.URL;

<!--[if !supportLists]-->11. <!--[endif]-->import&nbsp;java.util.HashMap;

<!--[if !supportLists]-->12. <!--[endif]-->import&nbsp;net.sf.jasperreports.engine.util.JRLoader;

<!--[if !supportLists]-->13. <!--[endif]-->import&nbsp;net.sf.jasperreports.view.JasperViewer;

<!--[if !supportLists]-->14. <!--[endif]-->import&nbsp;net.sf.jasperreports.engine.*;

<!--[if !supportLists]-->15. <!--[endif]-->import&nbsp;conexao.Conexao;

<!--[if !supportLists]-->16. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->17. <!--[endif]-->/**

<!--[if !supportLists]-->18. <!--[endif]-->* Relatorio.java
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->

<!--[if !supportLists]-->19. <!--[endif]-->*

<!--[if !supportLists]-->20.&nbsp; <!--[endif]-->*


A classe Relatorio deve ser utilizada para emissão
de relatórios. Após a



<!--[if !supportLists]-->21. <!--[endif]-->* criação de algum relatório é possível
exibí-lo na tela, exportá-lo para um

<!--[if !supportLists]-->22.&nbsp; <!--[endif]-->* arquivo pdf/html ou enviá-lo direto
para impressão.

<!--[if !supportLists]-->23.&nbsp; <!--[endif]-->*

<!--[if !supportLists]-->24.&nbsp; <!--[endif]-->*


A classe manipula relatórios desenvolvidos
utilizando-se a&nbsp;ferramenta



<!--[if !supportLists]-->25.&nbsp; <!--[endif]-->* iReport e utiliza a ferramenta
JasperReports para emissão dos relatórios

<!--[if !supportLists]-->26.&nbsp; <!--[endif]-->*

<!--[if !supportLists]-->27. <!--[endif]-->* @author Marcos Vinícius Soares

<!--[if !supportLists]-->28. <!--[endif]-->*/

<!--[if !supportLists]-->29. <!--[endif]-->public&nbsp;class&nbsp;Relatorio {

<!--[if !supportLists]-->30. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->31. <!--[endif]-->/** Representa o relatório gerado. */

<!--[if !supportLists]-->32. <!--[endif]-->private&nbsp;JasperPrint jasperPrint_;

<!--[if !supportLists]-->33. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->34. <!--[endif]-->/**

<!--[if !supportLists]-->35. <!--[endif]-->* Cria um novo Relatorio.

<!--[if !supportLists]-->36. <!--[endif]-->*

<!--[if !supportLists]-->37. <!--[endif]-->* @param conn Conexão com o banco de
dados.

<!--[if !supportLists]-->38. <!--[endif]-->* @param parameters Parâmetros a serem
exibidos no relatório.

<!--[if !supportLists]-->39. <!--[endif]-->* @param localRelatorio Localização do
relatório.

<!--[if !supportLists]-->40. <!--[endif]-->* @throws JRException Caso o relatório
não seja encontrado ou haja

<!--[if !supportLists]-->41. <!--[endif]-->* algum problema com ele, uma exceção é
gerada.

<!--[if !supportLists]-->42. <!--[endif]-->*/

<!--[if !supportLists]-->43. <!--[endif]-->public&nbsp;Relatorio(Conexao conn, HashMap parameters,
URL localRelatorio)&nbsp;throws&nbsp;JRException{

<!--[if !supportLists]-->44. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->45. <!--[endif]-->try&nbsp;{

<!--[if !supportLists]-->46. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->47. <!--[endif]-->// O objeto JasperReport representa o
objeto JasperDesign (arquivo .jrxml) compilado.

<!--[if !supportLists]-->48. <!--[endif]-->// Ou seja, o arquivo .jasper

<!--[if !supportLists]-->49. <!--[endif]-->JasperReport jr =
(JasperReport)JRLoader.loadObject(localRelatorio);

<!--[if !supportLists]-->50. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->51. <!--[endif]-->// JasperPrint representa o relatório
gerado.

<!--[if !supportLists]-->52. <!--[endif]-->// É criado um JasperPrint a partir de
um JasperReport, contendo o relatório preenchido.

<!--[if !supportLists]-->53. <!--[endif]-->this.jasperPrint_ = JasperFillManager.fillReport(jr,
parameters, conn.getConnection());

<!--[if !supportLists]-->54. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->55. <!--[endif]-->}&nbsp;catch&nbsp;(JRException e) {&nbsp;throw&nbsp;e; }

<!--[if !supportLists]-->56. <!--[endif]-->}

<!--[if !supportLists]-->57. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->58. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->59. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->60. <!--[endif]-->/**

<!--[if !supportLists]-->61. <!--[endif]-->* Cria um novo Relatorio.

<!--[if !supportLists]-->62. <!--[endif]-->*

<!--[if !supportLists]-->63. <!--[endif]-->* @param conn Conexão com o banco de
dados.

<!--[if !supportLists]-->64. <!--[endif]-->* @param parameters Parâmetros a serem
exibidos no relatório.

<!--[if !supportLists]-->65. <!--[endif]-->* @param localRelatorio Localização do
relatório.

<!--[if !supportLists]-->66. <!--[endif]-->* @throws JRException Caso o relatório
não seja encontrado ou haja

<!--[if !supportLists]-->67. <!--[endif]-->* algum problema com ele, uma exceção é
gerada.

<!--[if !supportLists]-->68. <!--[endif]-->*/

<!--[if !supportLists]-->69. <!--[endif]-->public&nbsp;Relatorio(Conexao conn, HashMap parameters,
String localRelatorio)&nbsp;throws&nbsp;JRException{

<!--[if !supportLists]-->70. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->71. <!--[endif]-->try&nbsp;{

<!--[if !supportLists]-->72. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->73. <!--[endif]-->// O objeto JasperReport representa o
objeto JasperDesign (arquivo .jrxml) compilado.

<!--[if !supportLists]-->74. <!--[endif]-->// Ou seja, o arquivo .jasper

<!--[if !supportLists]-->75. <!--[endif]-->JasperReport jr =
(JasperReport)JRLoader.loadObject(localRelatorio);

<!--[if !supportLists]-->76. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->77. <!--[endif]-->// JasperPrint representa o relatório
gerado.

<!--[if !supportLists]-->78. <!--[endif]-->// É criado um JasperPrint a partir de
um JasperReport, contendo o relatório preenchido.

<!--[if !supportLists]-->79. <!--[endif]-->this.jasperPrint_ = JasperFillManager.fillReport(jr,
parameters, conn.getConnection());

<!--[if !supportLists]-->80. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->81. <!--[endif]-->}&nbsp;catch&nbsp;(JRException e) {&nbsp;throw&nbsp;e; }

<!--[if !supportLists]-->82. <!--[endif]-->}

<!--[if !supportLists]-->83. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->84. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->85. <!--[endif]-->&nbsp;

<!--[if !supportLists]-->86. <!--[endif]-->/**

<!--[if !supportLists]-->87. <!--[endif]-->* Cria um novo Relatorio.

<!--[if !supportLists]-->88. <!--[endif]-->*

<!--[if !supportLists]-->89. <!--[endif]-->* @param conn Conexão com o banco de
dados.

<!--[if !supportLists]-->90. <!--[endif]-->* @param sql Expressão SQL (SELECT...)
a ser utilizada para preenchimento do relatório

<!--[if !supportLists]-->91. <!--[endif]-->* @param parameters Parâmetros a serem
exibidos no relatório.

<!--[if !supportLists]-->92. <!--[endif]-->* @param localRelatorio Localização do
relatório.

<!--[if !supportLists]-->93. <!--[endif]-->* @throws JRException Caso o relatório
não seja encontrado ou haja

<!--[if !supportLists]-->94. <!--[endif]-->* algum problema com ele, uma exceção é
gerada.

<!--[if !supportLists]-->95. <!--[endif]-->* @throws SQLException Caso exista
alguma divergência ou problema com

<!--[if !supportLists]-->96. <!--[endif]-->* a Expressão SQL passada como
parâmetro, uma exceção é gerada.

<!--[if !supportLists]-->97. <!--[endif]-->*/

<!--[if !supportLists]-->98. <!--[endif]-->public&nbsp;Relatorio(Conexao conn, String
sql,

<!--[if !supportLists]-->99. <!--[endif]-->HashMap
parameters, URL localRelatorio)&nbsp;throws&nbsp;SQLException,
JRException {

<!--[if !supportLists]-->100.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->101.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->try&nbsp;{

<!--[if !supportLists]-->102.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->103.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->// O
objeto JasperReport representa o objeto JasperDesign (arquivo .jrxml)
compilado.

<!--[if !supportLists]-->104.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
Ou seja, o arquivo .jasper

<!--[if !supportLists]-->105.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->JasperReport
jr = (JasperReport)JRLoader.loadObject(localRelatorio);

<!--[if !supportLists]-->106.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->107.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
Resultado da consulta

<!--[if !supportLists]-->108.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->ResultSet rs =
conn.executeQuery(sql);

<!--[if !supportLists]-->109.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->110.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
JRResultSetDataSource é uma implementaçao de JRDataSource, o qual é requerido

<!--[if !supportLists]-->111.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
como parametro para preencher o relatório criado.

<!--[if !supportLists]-->112.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
Ele armazena o dados do ResultSet

<!--[if !supportLists]-->113.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->JRResultSetDataSource jrRS
=&nbsp;new&nbsp;JRResultSetDataSource(rs);

<!--[if !supportLists]-->114.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->115.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
JasperPrint representa o relatório gerado.

<!--[if !supportLists]-->116.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->// É
criado um JasperPrint a partir de um JasperReport, contendo o

<!--[if !supportLists]-->117.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
relatório preenchido.

<!--[if !supportLists]-->118.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->this.jasperPrint_ =
JasperFillManager.fillReport(jr, parameters, jrRS);

<!--[if !supportLists]-->119.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->120.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->rs.close();

<!--[if !supportLists]-->121.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->122.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->}

<!--[if !supportLists]-->123.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->catch&nbsp;(SQLException
e) {&nbsp;throw&nbsp;e; }

<!--[if !supportLists]-->124.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->catch&nbsp;(JRException
e) {&nbsp;throw&nbsp;e; }

<!--[if !supportLists]-->125.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->}

<!--[if !supportLists]-->126.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->127.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->128.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->129.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->/**

<!--[if !supportLists]-->130.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
Cria um novo Relatorio.

<!--[if !supportLists]-->131.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*

<!--[if !supportLists]-->132.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
@param conn Conexão com o banco de dados.

<!--[if !supportLists]-->133.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
@param sql Expressão SQL (SELECT...) a ser utilizada para preenchimento do
relatório

<!--[if !supportLists]-->134.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
@param parameters Parâmetros a serem exibidos no relatório.

<!--[if !supportLists]-->135.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
@param localRelatorio Localização do relatório.

<!--[if !supportLists]-->136.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
@throws JRException Caso o relatório não seja encontrado ou haja

<!--[if !supportLists]-->137.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
algum problema com ele, uma exceção é gerada.

<!--[if !supportLists]-->138.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
@throws SQLException Caso exista alguma divergência ou problema com

<!--[if !supportLists]-->139.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->* a
Expressão SQL passada como parâmetro, uma exceção é gerada.

<!--[if !supportLists]-->140.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*/

<!--[if !supportLists]-->141.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->public&nbsp;Relatorio(Conexao conn, String
sql,

<!--[if !supportLists]-->142.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->HashMap parameters, String
localRelatorio)&nbsp;throws&nbsp;SQLException,
JRException {

<!--[if !supportLists]-->143.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->144.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->try&nbsp;{

<!--[if !supportLists]-->145.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->146.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->// O
objeto JasperReport representa o objeto JasperDesign (arquivo .jrxml)
compilado.

<!--[if !supportLists]-->147.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
Ou seja, o arquivo .jasper

<!--[if !supportLists]-->148.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->JasperReport
jr = (JasperReport)JRLoader.loadObject(localRelatorio);

<!--[if !supportLists]-->149.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->150.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
Resultado da consulta

<!--[if !supportLists]-->151.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->ResultSet rs =
conn.executeQuery(sql);

<!--[if !supportLists]-->152.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->153.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
JRResultSetDataSource é uma implementaçao de JRDataSource, o qual é requerido

<!--[if !supportLists]-->154.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
como parametro para preencher o relatório criado.

<!--[if !supportLists]-->155.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
Ele armazena o dados do ResultSet

<!--[if !supportLists]-->156.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->JRResultSetDataSource jrRS
=&nbsp;new&nbsp;JRResultSetDataSource(rs);

<!--[if !supportLists]-->157.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->158.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
JasperPrint representa o relatório gerado.

<!--[if !supportLists]-->159.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->// É
criado um JasperPrint a partir de um JasperReport, contendo o

<!--[if !supportLists]-->160.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
relatório preenchido.

<!--[if !supportLists]-->161.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->this.jasperPrint_ =
JasperFillManager.fillReport(jr, parameters, jrRS);

<!--[if !supportLists]-->162.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->163.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->rs.close();

<!--[if !supportLists]-->164.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->165.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->}

<!--[if !supportLists]-->166.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->catch&nbsp;(SQLException
e) {&nbsp;throw&nbsp;e; }

<!--[if !supportLists]-->167.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->catch&nbsp;(JRException
e) {&nbsp;throw&nbsp;e; }

<!--[if !supportLists]-->168.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->}

<!--[if !supportLists]-->169.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->170.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->171.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->172.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->/**

<!--[if !supportLists]-->173.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
Cria um novo Relatorio.

<!--[if !supportLists]-->174.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*

<!--[if !supportLists]-->175.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
@param parameters Parâmetros a serem exibidos no relatório.

<!--[if !supportLists]-->176.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
@param localRelatorio Localização do relatório.

<!--[if !supportLists]-->177.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
@throws JRException Caso o relatório não seja encontrado ou haja

<!--[if !supportLists]-->178.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
algum problema com ele, uma exceção é gerada.

<!--[if !supportLists]-->179.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*/

<!--[if !supportLists]-->180.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->public&nbsp;Relatorio(HashMap
parameters, URL localRelatorio)&nbsp;throws&nbsp;JRException
{

<!--[if !supportLists]-->181.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->182.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->try&nbsp;{

<!--[if !supportLists]-->183.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->184.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->// O
objeto JasperReport representa o objeto JasperDesign (arquivo .jrxml)
compilado.

<!--[if !supportLists]-->185.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
Ou seja, o arquivo .jasper

<!--[if !supportLists]-->186.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->JasperReport
jr = (JasperReport) JRLoader.loadObject(localRelatorio);

<!--[if !supportLists]-->187.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->188.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
JREmptyDataSource é uma implementaçao de JRDataSource, o qual é requerido

<!--[if !supportLists]-->189.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
como parametro para preencher o relatório criado.

<!--[if !supportLists]-->190.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
Ele armazena o dados do ResultSet, que, neste caso, é vazio

<!--[if !supportLists]-->191.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->JREmptyDataSource
jrEDS =&nbsp;new&nbsp;JREmptyDataSource();

<!--[if !supportLists]-->192.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->193.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
Jasper Print representa o relatório gerado.

<!--[if !supportLists]-->194.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->// É
criado um JasperPrint a partir de um JasperReport, contendo o

<!--[if !supportLists]-->195.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
relatório preenchido.

<!--[if !supportLists]-->196.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->this.jasperPrint_ =
JasperFillManager.fillReport(jr, parameters, jrEDS);

<!--[if !supportLists]-->197.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->198.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->}&nbsp;catch&nbsp;(JRException e) {&nbsp;throw&nbsp;e; }

<!--[if !supportLists]-->199.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->}

<!--[if !supportLists]-->200.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->201.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->202.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->203.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->/**

<!--[if !supportLists]-->204.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
Cria um novo Relatorio

<!--[if !supportLists]-->205.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*

<!--[if !supportLists]-->206.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
@param parameters Parâmetros a serem exibidos no relatório.

<!--[if !supportLists]-->207.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
@param localRelatorio Localização do relatório.

<!--[if !supportLists]-->208.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
@throws JRException Caso o relatório não seja encontrado ou haja

<!--[if !supportLists]-->209.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
algum problema com ele, uma exceção é gerada.

<!--[if !supportLists]-->210.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*/

<!--[if !supportLists]-->211.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->public&nbsp;Relatorio(HashMap
parameters, String localRelatorio)&nbsp;throws&nbsp;JRException
{

<!--[if !supportLists]-->212.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->213.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->try&nbsp;{

<!--[if !supportLists]-->214.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->215.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->// O
objeto JasperReport representa o objeto JasperDesign (arquivo .jrxml)
compilado.

<!--[if !supportLists]-->216.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
Ou seja, o arquivo .jasper

<!--[if !supportLists]-->217.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->JasperReport
jr = (JasperReport) JRLoader.loadObject(localRelatorio);

<!--[if !supportLists]-->218.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->219.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
JREmptyDataSource é uma implementaçao de JRDataSource, o qual é requerido

<!--[if !supportLists]-->220.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
como parametro para preencher o relatório criado.

<!--[if !supportLists]-->221.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
Ele armazena o dados do ResultSet, que, neste caso, é vazio

<!--[if !supportLists]-->222.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->JREmptyDataSource
jrEDS =&nbsp;new&nbsp;JREmptyDataSource();

<!--[if !supportLists]-->223.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->224.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
Jasper Print representa o relatório gerado.

<!--[if !supportLists]-->225.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->// É
criado um JasperPrint a partir de um JasperReport, contendo o

<!--[if !supportLists]-->226.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
relatório preenchido.

<!--[if !supportLists]-->227.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->this.jasperPrint_ =
JasperFillManager.fillReport(jr, parameters, jrEDS);

<!--[if !supportLists]-->228.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->229.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->}&nbsp;catch&nbsp;(JRException e) {&nbsp;throw&nbsp;e; }

<!--[if !supportLists]-->230.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->}

<!--[if !supportLists]-->231.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->232.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->233.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->234.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->/**

<!--[if !supportLists]-->235.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
Exibe o relatório na tela.

<!--[if !supportLists]-->236.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*/

<!--[if !supportLists]-->237.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->public&nbsp;void&nbsp;exibirRelatorio() {

<!--[if !supportLists]-->238.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
emite o relatório na tela

<!--[if !supportLists]-->239.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
false indica que a aplicação não será finalizada caso o relatório seja fechado

<!--[if !supportLists]-->240.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->JasperViewer.viewReport(this.jasperPrint_,&nbsp;false);

<!--[if !supportLists]-->241.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->}

<!--[if !supportLists]-->242.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->243.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->244.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->245.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->/**

<!--[if !supportLists]-->246.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
Grava o relatório em um arquivo de formato pdf.

<!--[if !supportLists]-->247.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*

<!--[if !supportLists]-->248.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
@param caminhoDestino&nbsp;Caminho&nbsp;onde o arquivo será gravado.

<!--[if !supportLists]-->249.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*/

<!--[if !supportLists]-->250.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->public&nbsp;void&nbsp;exportaParaPdf(String caminhoDestino)&nbsp;throws&nbsp;JRException {

<!--[if !supportLists]-->251.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->252.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->try&nbsp;{

<!--[if !supportLists]-->253.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
Gera o arquivo PDF

<!--[if !supportLists]-->254.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->JasperExportManager.exportReportToPdfFile(this.jasperPrint_, caminhoDestino);

<!--[if !supportLists]-->255.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->}&nbsp;catch&nbsp;(JRException e) {&nbsp;throw&nbsp;e; }

<!--[if !supportLists]-->256.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->257.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->}

<!--[if !supportLists]-->258.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->259.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->260.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->261.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->/**

<!--[if !supportLists]-->262.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
Grava o relatório em um arquivo de formato html.

<!--[if !supportLists]-->263.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*

<!--[if !supportLists]-->264.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
@param caminhoDestino Caminho onde o arquivo será gravado.

<!--[if !supportLists]-->265.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*/

<!--[if !supportLists]-->266.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->public&nbsp;void&nbsp;exportaParaHtml(String caminhoDestino)&nbsp;throws&nbsp;JRException {

<!--[if !supportLists]-->267.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->268.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->try&nbsp;{

<!--[if !supportLists]-->269.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
Gera o arquivo PDF

<!--[if !supportLists]-->270.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->JasperExportManager.exportReportToHtmlFile(this.jasperPrint_, caminhoDestino);

<!--[if !supportLists]-->271.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->}&nbsp;catch&nbsp;(JRException e) {&nbsp;throw&nbsp;e; }

<!--[if !supportLists]-->272.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->273.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->}

<!--[if !supportLists]-->274.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->275.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->276.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->277.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->/**

<!--[if !supportLists]-->278.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
Envia o relatório para impressão, exibindo uma caixa de dialogo de impressão ou
não.

<!--[if !supportLists]-->279.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*

<!--[if !supportLists]-->280.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*
@param exibeCaixaDialogo Boolean indicando se será exibida uma caixa de diálogo
ou não.

<!--[if !supportLists]-->281.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->*/

<!--[if !supportLists]-->282.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->public&nbsp;void&nbsp;imprimir(boolean&nbsp;exibeCaixaDialogo)&nbsp;throws&nbsp;JRException {

<!--[if !supportLists]-->283.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->284.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->try&nbsp;{

<!--[if !supportLists]-->285.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->//
Imprime o relatório

<!--[if !supportLists]-->286.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->// o
segundo parâmetro indica se existirá uma caixa de dialogo antes ou nao

<!--[if !supportLists]-->287.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->JasperPrintManager.printReport(this.jasperPrint_, exibeCaixaDialogo);

<!--[if !supportLists]-->288.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->}&nbsp;catch&nbsp;(JRException e) {&nbsp;throw&nbsp;e; }

<!--[if !supportLists]-->289.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->290.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->}

<!--[if !supportLists]-->291.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->292.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->293.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->&nbsp;

<!--[if !supportLists]-->294.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--[endif]-->}




Primeiro vamos criar um relatório através de um dos métodos disponíveis, depois basta chamar algum método....   Esse objeto conexão representa uma conexão com o banco de dados, e o método getConn retorna o objeto Connection associado a ele. No caso, você deve implementar o seu, pois não sei qual banco de dados você está utilizando.