Como Fazer a Passagem de Parâmetros no JasperReports

Olá Pessoal boa tarde estou com uma duvida que está me matando. Tenho um projeto que tem que imprimir um relatório que contem duas listas e duas tabelas. Meu problema é o seguinte, estou sem intender como o jasper interpreta os dados que são passados pra ele, por causa do seguinte:

No meu relatório na primeira vez que eu fiz, no jasper studio eu criei o relatório com um banco fixo lá funcionava tudo perfeitamente, e ai eu passei esse relatório para o java, lá quando eu rodava o código o relatório era gerado com o banco que foi criado no jasper studio e não com os dados passado pelo java.

Então eu mudei o relatório e ai surgiram mais duvidas, por que eu mudei para a utilização de parâmetros e criei as listas e tabelas sem banco de dados, mas o relatório nem aparece, mesmo eu passando os parâmetros pelo java. A minha duvida é como o jasper interpreta esses dados que eu estou passando, tipo, no meu código eu passo a conexão do banco que eu estou usando, é mesmo necessário passa-la já que eu passo as informações por parâmetro?

Outra duvida, pesquisando na internet reparei que posso colocar parâmetros nas sqls dos dataset que crio no jasper studio, como que eu consigo passar esse parâmetros via java?

Abaixo segue os códigos que fiz até agora:

Classe que Gera o Relatório:

    private Connection conexao;

    public GeradorRelatorio(Connection conexao) {
        this.conexao = conexao;
    }

    public void geraPdf(String jrxml, 
        Map<String, Object> parametros, OutputStream saida) {

        try {
            // compila jrxml em memoria
            JasperReport jasper = JasperCompileManager.compileReport(jrxml);

            // preenche relatorio
            JasperPrint print = JasperFillManager.fillReport(jasper, parametros, this.conexao);

            // exporta para pdf
            JRExporter exporter = new JRPdfExporter();
            exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
            exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, saida);

            exporter.exportReport();

        } catch (Exception e) {
        	e.printStackTrace();
        }
    }   

Classe que faz a passagem de Parâmetros:

    @WebServlet("/RelatorioMensalController")
    public class RelatorioMensalController extends HttpServlet {
    private static final long serialVersionUID = 1L;

	private Conexao conexao;
	private ParametrosRelatorio pr = new ParametrosRelatorio();

	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		int idUsuario = Integer.parseInt(request.getParameter("idUsuario"));
		System.out.println(idUsuario);
		// acha jrxml dentro da aplicação
		ServletContext contexto = request.getServletContext();
		String jrxml = contexto.getRealPath("relatorio/exemplo.jrxml");

		// prepara parâmetros
		Map<String, Object> parametros = new HashMap<>();

		List<Conta> listaConta = pr.buscarContaUsuario(idUsuario);
		for (Conta conta : listaConta) {
			parametros.put("nomeConta", conta.getNome());
			parametros.put("saldo", conta.getSaldo());
			List<Debito> listaDebito = pr.buscarDebitosContasMesAtual(idUsuario, conta.getId());
			for (Debito debito : listaDebito) {
				parametros.put("descricaoDebitoConta", debito.getDescricao());
				parametros.put("valorDebitoConta", debito.getValor());
				parametros.put("dataDebitoConta", debito.getData());
			}
		}

		List<CartaoDeCredito> listaCartao = pr.buscarCartaoUsuario(idUsuario);
		for (CartaoDeCredito cartaoDeCredito : listaCartao) {
			parametros.put("nomeCartao", cartaoDeCredito.getNome());
			parametros.put("limite", cartaoDeCredito.getLimite());
			parametros.put("valorTotal", cartaoDeCredito.getValorTotal());
			parametros.put("vencimento", cartaoDeCredito.getVencimento());
			List<Debito> listaDebitoCartao = pr.buscarDebitosCartaoMesAtual(idUsuario, cartaoDeCredito.getId());
			for (Debito debito : listaDebitoCartao) {
				parametros.put("descricaoDebitoCartao", debito.getDescricao());
				parametros.put("valorDebitoCartao", debito.getValor());
				parametros.put("dataDebitoCartao", debito.getData());
			}
		}

		List<Object> listaCategoriaCartao = pr.buscarCategoriaCartaoMesAtual(idUsuario);
		for (Object object : listaCategoriaCartao) {
			if (object.getClass().equals(String.class)) {
				parametros.put("nomeCategoriaCartao", object);
				System.out.println(object);
			} else {
				parametros.put("quantidadeCartao", object);
			}
		}

		List<Object> listaCategoriaConta = pr.buscarCategoriaContaMesAtual(idUsuario);
		for (Object object : listaCategoriaConta) {
			if (object.getClass().equals(String.class)) {
				parametros.put("nomeCategoriaConta", object);
			} else {
				parametros.put("quantidadeConta", object);
			}
		}

		// abre conexão com o banco
		conexao = Conexao.getConexao();

		// gera relatório
		GeradorRelatorio gerador = new GeradorRelatorio(conexao.getConnection());
		gerador.geraPdf(jrxml, parametros, response.getOutputStream());

	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
	}

Espero que vocês consigam me ajudar, nunca tinha trabalhado antes com jasper reports então eu estou bem confusa, não sei como ele funciona.

Obrigada desde já a todos.

No jasper, vc pode mandar parâmetros e datasource. Os parâmetros no formato de mapa (como você está fazendo) ou datasource usando uma implementação de JRDatasource.

No relatório (JRXML), vc recupera os parâmetros com $P{...} e, no caso de ser um datasource, você tem que usar os fields $F{...}. Vamos supor que vc mande um datasource contendo uma lista de pessoas (JRBeanCollectionDataSource), que possui um id e um nome, por exemplo, no seu relatório vc deverá ter 2 fields, cada um representando um atributo de Pessoa (id e nome).

Entendi. Na verdade a minha duvida não seria exatamente essa. Acho que não me expressei direito. É o seguinte, eu tenho um sistema que faz o gerenciamento financeiro do usuário, no relatório eu quero listar as contas, os cartões de créditos e os respectivos débitos de cada um deles e em quais categorias o usuário gastou mais. Estou tentando implementar a solução no jasper studio com duas list para as contas e os cartões e duas tables pra os débitos dos dois e dois charts para as categorias. O meu problema está exatamente em como irei passar os parâmetros para os datasets das list, do charts e dos tables, alias eu nem sei se teria como porque até pelo jasper studio não está funcionando. Vou passar o código do meu relatório.

Repositório do Código do Relatório: github.com/JessPergentino/relatorio.git

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.5.1.final using JasperReports Library version 6.5.1  -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="exemplo" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="8d70994c-7752-49fe-a6f6-51f3ddf4693d">
	<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
	<property name="com.jaspersoft.studio.data.defaultdataadapter" value="mycash"/>
	<property name="com.jaspersoft.studio.unit." value="pixel"/>
	<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
	<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
	<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
	<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
	<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
	<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
	<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
	<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
	<style name="Table_TH" mode="Opaque" backcolor="#F0F8FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table_CH" mode="Opaque" backcolor="#BFE1FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 1_TH" mode="Opaque" backcolor="#F0F8FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 1_CH" mode="Opaque" backcolor="#BFE1FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 1_TD" mode="Opaque" backcolor="#FFFFFF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 2_TH" mode="Opaque" backcolor="#F0F8FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 2_CH" mode="Opaque" backcolor="#BFE1FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 2_TD" mode="Opaque" backcolor="#FFFFFF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 3_TH" mode="Opaque" backcolor="#F0F8FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 3_CH" mode="Opaque" backcolor="#BFE1FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 3_TD" mode="Opaque" backcolor="#FFFFFF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 4_TD" mode="Opaque" backcolor="#FFFFFF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 4_CH" mode="Opaque" backcolor="#BFE1FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 4_TH" mode="Opaque" backcolor="#F0F8FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 5_TH" mode="Opaque" backcolor="#F0F8FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 5_CH" mode="Opaque" backcolor="#BFE1FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 5_TD" mode="Opaque" backcolor="#FFFFFF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 6_TH" mode="Opaque" backcolor="#F0F8FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 6_CH" mode="Opaque" backcolor="#BFE1FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 6_TD" mode="Opaque" backcolor="#FFFFFF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 7_TH" mode="Opaque" backcolor="#F0F8FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 7_CH" mode="Opaque" backcolor="#BFE1FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 7_TD" mode="Opaque" backcolor="#FFFFFF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 8_TH" mode="Opaque" backcolor="#F0F8FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 8_CH" mode="Opaque" backcolor="#BFE1FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 8_TD" mode="Opaque" backcolor="#FFFFFF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 9_TH" mode="Opaque" backcolor="#F0F8FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 9_CH" mode="Opaque" backcolor="#BFE1FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Table 9_TD" mode="Opaque" backcolor="#FFFFFF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
			<topPen lineWidth="0.5" lineColor="#000000"/>
			<leftPen lineWidth="0.5" lineColor="#000000"/>
			<bottomPen lineWidth="0.5" lineColor="#000000"/>
			<rightPen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<subDataset name="Contas" uuid="a550ac43-bfcd-4040-9204-1bb606191e9d">
		<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
		<property name="com.jaspersoft.studio.data.defaultdataadapter" value="mycash"/>
		<parameter name="idUsuario" class="java.lang.Integer"/>
		<queryString language="SQL">
			<![CDATA[select * from conta where id_usuario =  $P{idUsuario} ]]>
		</queryString>
		<field name="nomeconta" class="java.lang.String">
			<property name="com.jaspersoft.studio.field.label" value="nomeconta"/>
		</field>
		<field name="saldo" class="java.lang.Float">
			<property name="com.jaspersoft.studio.field.label" value="saldo"/>
		</field>
	</subDataset>
	<subDataset name="DebitoContas" uuid="8079ed07-6eb5-42fc-98a0-beb666dd0e9b">
		<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
		<property name="com.jaspersoft.studio.data.defaultdataadapter" value="mycash"/>
		<parameter name="idConta" class="java.lang.Integer"/>
		<parameter name="data" class="java.util.Date"/>
		<queryString language="SQL">
			<![CDATA[select descricao, valor, data_debito from debito
inner join conta on conta.id = debito.id_conta
where conta.id=  $P{idConta}  and Extract(month from data_debito) >= Extract(month from  $P{data}  ::DATE)
and Extract(month from data_debito) <= Extract(month from  $P{data} ::DATE)]]>
		</queryString>
		<field name="descricao" class="java.lang.String">
			<property name="com.jaspersoft.studio.field.label" value="descricao"/>
		</field>
		<field name="valor" class="java.lang.Float">
			<property name="com.jaspersoft.studio.field.label" value="valor"/>
		</field>
		<field name="data_debito" class="java.sql.Date">
			<property name="com.jaspersoft.studio.field.label" value="data_debito"/>
		</field>
	</subDataset>
	<subDataset name="Cartoes" uuid="afeaa0c3-051b-49c8-81b1-a9ae68421ed0">
		<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
		<property name="com.jaspersoft.studio.data.defaultdataadapter" value="mycash"/>
		<parameter name="idUsuario" class="java.lang.Integer"/>
		<queryString language="SQL">
			<![CDATA[select * from cartaodecredito where id_usuario =  $P{idUsuario} ]]>
		</queryString>
		<field name="nomecartao" class="java.lang.String">
			<property name="com.jaspersoft.studio.field.label" value="nomecartao"/>
		</field>
		<field name="limite" class="java.lang.Float">
			<property name="com.jaspersoft.studio.field.label" value="limite"/>
		</field>
		<field name="valor_total" class="java.lang.Float">
			<property name="com.jaspersoft.studio.field.label" value="valor_total"/>
		</field>
		<field name="vencimento" class="java.sql.Date">
			<property name="com.jaspersoft.studio.field.label" value="vencimento"/>
		</field>
	</subDataset>
	<subDataset name="DebitosCartao" uuid="9d6ff08a-cfc4-462f-93a6-e71a66329add">
		<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
		<property name="com.jaspersoft.studio.data.defaultdataadapter" value="mycash"/>
		<parameter name="idCartao" class="java.lang.Integer"/>
		<parameter name="data" class="java.util.Date"/>
		<queryString language="SQL">
			<![CDATA[select descricao, valor, data_debito from debito
inner join cartaodecredito on cartaodecredito.id = debito.id_cartao
where cartaodecredito.id =  $P{idCartao} and Extract(month from data_debito) >= Extract(month from  $P{data} ::DATE)
and Extract(month from data_debito) <= Extract(month from  $P{data} ::DATE)]]>
		</queryString>
		<field name="descricao" class="java.lang.String">
			<property name="com.jaspersoft.studio.field.label" value="descricao"/>
		</field>
		<field name="valor" class="java.lang.Float">
			<property name="com.jaspersoft.studio.field.label" value="valor"/>
		</field>
		<field name="data_debito" class="java.sql.Date">
			<property name="com.jaspersoft.studio.field.label" value="data_debito"/>
		</field>
	</subDataset>
	<subDataset name="CategoriaConta" uuid="afe9d715-d250-4500-993f-b36454f15654">
		<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
		<property name="com.jaspersoft.studio.data.defaultdataadapter" value="mycash"/>
		<queryString language="SQL">
			<![CDATA[select categoria.nome, count(categoria.nome) as quantidade
from categoria
inner join debito on debito.id_categoria = categoria.id
inner join conta on conta.id = debito.id_conta
inner join usuario on usuario.id = conta.id_usuario
where Extract(month from data_debito) >= Extract(month from '2018-05-01'::DATE)
and Extract(month from data_debito) <= Extract(month from '2018-05-31'::DATE) and usuario.id = 7
group by categoria.nome
]]>
		</queryString>
		<field name="nome" class="java.lang.String">
			<property name="com.jaspersoft.studio.field.label" value="nome"/>
		</field>
		<field name="quantidade" class="java.lang.Long">
			<property name="com.jaspersoft.studio.field.label" value="quantidade"/>
		</field>
	</subDataset>
	<subDataset name="CategoriaCartao" uuid="7f138177-b7de-4fe9-8839-fd0f28f03af1">
		<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
		<property name="com.jaspersoft.studio.data.defaultdataadapter" value="mycash"/>
		<parameter name="idUsuario" class="java.lang.Integer"/>
		<parameter name="data" class="java.util.Date"/>
		<queryString language="SQL">
			<![CDATA[select categoria.nome, count(categoria.nome) as quantidade
from categoria
inner join debito on debito.id_categoria = categoria.id
inner join cartaodecredito on cartaodecredito.id = debito.id_cartao
inner join usuario on usuario.id = cartaodecredito.id_usuario
 where Extract(month from data_debito) >= Extract(month from $P{data}  ::DATE)
and Extract(month from data_debito) <= Extract(month from  $P{data} ::DATE) and usuario.id = $P{idUsuario}  
group by categoria.nome]]>
		</queryString>
		<field name="nome" class="java.lang.String">
			<property name="com.jaspersoft.studio.field.label" value="nome"/>
		</field>
		<field name="quantidade" class="java.lang.Long">
			<property name="com.jaspersoft.studio.field.label" value="quantidade"/>
		</field>
	</subDataset>
	<parameter name="idUsuario" class="java.lang.Integer"/>
	<queryString language="SQL">
		<![CDATA[select conta.nomeconta, conta.saldo, cartaodecredito.nomecartao, cartaodecredito.limite, cartaodecredito.valor_total, cartaodecredito.vencimento
from conta, cartaodecredito
inner join usuario on usuario.id = cartaodecredito.id_usuario
where usuario.id =  $P{idUsuario} ]]>
	</queryString>
	<field name="nomeconta" class="java.lang.String">
		<property name="com.jaspersoft.studio.field.label" value="nomeconta"/>
	</field>
	<field name="saldo" class="java.lang.Float">
		<property name="com.jaspersoft.studio.field.label" value="saldo"/>
	</field>
	<field name="nomecartao" class="java.lang.String">
		<property name="com.jaspersoft.studio.field.label" value="nomecartao"/>
	</field>
	<field name="limite" class="java.lang.Float">
		<property name="com.jaspersoft.studio.field.label" value="limite"/>
	</field>
	<field name="valor_total" class="java.lang.Float">
		<property name="com.jaspersoft.studio.field.label" value="valor_total"/>
	</field>
	<field name="vencimento" class="java.sql.Date">
		<property name="com.jaspersoft.studio.field.label" value="vencimento"/>
	</field>
	<variable name="decricao" class="java.lang.String"/>
	<variable name="nome" class="java.lang.String"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="73" splitType="Stretch">
			<textField pattern="MMMMM dd, yyyy">
				<reportElement x="470" y="40" width="90" height="30" uuid="e5f98f97-546a-40a8-861a-44f8fa1bd0a1"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="12"/>
				</textElement>
				<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="180" y="21" width="179" height="30" uuid="4f74ccef-1a3d-4e68-a33c-23cd727400b4"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="SansSerif" size="16" isBold="true"/>
				</textElement>
				<text><![CDATA[Gastos do Mês]]></text>
			</staticText>
			<staticText>
				<reportElement x="390" y="40" width="100" height="30" uuid="2c0f9af9-2ac3-46b3-ad4a-4f5db643d9ae"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="12"/>
				</textElement>
				<text><![CDATA[Gerado em:]]></text>
			</staticText>
		</band>
	</title>
	<pageHeader>
		<band height="48" splitType="Stretch">
			<staticText>
				<reportElement x="92" y="0" width="370" height="39" uuid="261b348b-9e33-4c40-a001-c85458b3973e"/>
				<textElement textAlignment="Center">
					<font size="14"/>
				</textElement>
				<text><![CDATA[Neste relatório você irá encontrar informações detalhadas sobre todos os seus gastos.]]></text>
			</staticText>
		</band>
	</pageHeader>
	<detail>
		<band height="152" splitType="Stretch">
			<staticText>
				<reportElement x="60" y="40" width="100" height="19" uuid="6af6b0e4-b725-4ff7-bcc5-8421e1c76779"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="14" isBold="true"/>
				</textElement>
				<text><![CDATA[Contas]]></text>
			</staticText>
			<staticText>
				<reportElement x="350" y="40" width="145" height="19" uuid="a4f9313d-4a19-4d82-84a2-19e38cbecb47"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="14" isBold="true"/>
				</textElement>
				<text><![CDATA[Cartões de Crédito]]></text>
			</staticText>
			<staticText>
				<reportElement x="22" y="0" width="448" height="40" uuid="bf0d5ca4-0a4c-4ca4-b4f5-92e8eb4bb258"/>
				<textElement>
					<font fontName="SansSerif" size="12"/>
				</textElement>
				<text><![CDATA[Aqui abaixo temos uma lista de todos os gastos dos seus cartões e contas para você ter um maior contole sobre as suas economias:]]></text>
			</staticText>
			<componentElement>
				<reportElement x="20" y="60" width="200" height="90" uuid="271b0f74-9890-450a-b810-92f05e62238b"/>
				<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
					<datasetRun subDataset="Contas" uuid="21f901b5-c5fa-46de-8eb8-ae617dd6a829">
						<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
					</datasetRun>
					<jr:listContents height="90" width="200">
						<textField>
							<reportElement x="0" y="10" width="130" height="20" uuid="8c87f150-52f4-4161-94e3-f90bd7217b22"/>
							<textElement>
								<font size="12" isBold="true"/>
							</textElement>
							<textFieldExpression><![CDATA[$F{nomeconta}]]></textFieldExpression>
						</textField>
						<textField>
							<reportElement x="130" y="10" width="70" height="20" uuid="6c08bfd1-30e6-4248-b16b-f1e11980c5a3"/>
							<textElement>
								<font size="12" isBold="true"/>
							</textElement>
							<textFieldExpression><![CDATA[$F{saldo}]]></textFieldExpression>
						</textField>
						<componentElement>
							<reportElement x="0" y="30" width="200" height="60" uuid="ff5d1448-6b19-431e-b791-40e83fc25fb2">
								<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
								<property name="com.jaspersoft.studio.table.style.table_header" value="Table 8_TH"/>
								<property name="com.jaspersoft.studio.table.style.column_header" value="Table 8_CH"/>
								<property name="com.jaspersoft.studio.table.style.detail" value="Table 8_TD"/>
							</reportElement>
							<jr:table>
								<datasetRun subDataset="DebitoContas" uuid="cdedef4d-3f92-4b90-a63a-13c02a5d6dfe">
									<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
								</datasetRun>
								<jr:column width="66" uuid="bd573f10-3954-4ea9-a55b-8c7dcc534360">
									<jr:tableHeader style="Table 8_TH" height="30">
										<staticText>
											<reportElement x="0" y="0" width="66" height="30" uuid="e996be2b-6ff8-485a-8e17-639f974742ed"/>
											<textElement textAlignment="Center" verticalAlignment="Middle">
												<font size="12" isBold="true"/>
											</textElement>
											<text><![CDATA[Débito]]></text>
										</staticText>
									</jr:tableHeader>
									<jr:detailCell style="Table 8_TD" height="30">
										<textField>
											<reportElement x="0" y="0" width="66" height="30" uuid="c2969a52-55e1-4f4e-a323-21e628ba6b46"/>
											<textElement textAlignment="Center" verticalAlignment="Middle">
												<font size="12"/>
											</textElement>
											<textFieldExpression><![CDATA[$F{descricao}]]></textFieldExpression>
										</textField>
									</jr:detailCell>
								</jr:column>
								<jr:column width="66" uuid="8a7f6291-69de-4bf2-86d9-8768dfcff59b">
									<jr:tableHeader style="Table 8_TH" height="30">
										<staticText>
											<reportElement x="0" y="0" width="66" height="30" uuid="90773027-2a00-4d47-9c74-5ed42b94fc3e"/>
											<textElement textAlignment="Center" verticalAlignment="Middle">
												<font size="12" isBold="true"/>
											</textElement>
											<text><![CDATA[Valor]]></text>
										</staticText>
									</jr:tableHeader>
									<jr:detailCell style="Table 8_TD" height="30">
										<textField>
											<reportElement x="0" y="0" width="66" height="30" uuid="f905aef4-078f-4b31-8fb3-35507fb86960"/>
											<textElement textAlignment="Center" verticalAlignment="Middle">
												<font size="12"/>
											</textElement>
											<textFieldExpression><![CDATA[$F{valor}]]></textFieldExpression>
										</textField>
									</jr:detailCell>
								</jr:column>
								<jr:column width="66" uuid="ce6d276c-7292-4f6d-a003-4beb5d2fb1ff">
									<jr:tableHeader style="Table 8_TH" height="30">
										<staticText>
											<reportElement x="0" y="0" width="66" height="30" uuid="31b6034e-7bb2-44ff-9625-be66e6854763"/>
											<textElement textAlignment="Center" verticalAlignment="Middle">
												<font size="12" isBold="true"/>
											</textElement>
											<text><![CDATA[Data]]></text>
										</staticText>
									</jr:tableHeader>
									<jr:detailCell style="Table 8_TD" height="30">
										<textField>
											<reportElement x="0" y="0" width="66" height="30" uuid="2cff2600-7a30-43bf-a2ab-849c4c4da61d"/>
											<textElement textAlignment="Center" verticalAlignment="Middle">
												<font size="12"/>
											</textElement>
											<textFieldExpression><![CDATA[$F{data_debito}]]></textFieldExpression>
										</textField>
									</jr:detailCell>
								</jr:column>
							</jr:table>
						</componentElement>
					</jr:listContents>
				</jr:list>
			</componentElement>
			<componentElement>
				<reportElement x="305" y="60" width="240" height="90" uuid="12e545b2-c4ed-4b7b-bdde-93b7d5264340"/>
				<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
					<datasetRun subDataset="Cartoes" uuid="9e29d645-ad80-47b0-8c5b-c86a638d6b2c">
						<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
					</datasetRun>
					<jr:listContents height="90" width="240">
						<textField>
							<reportElement x="0" y="10" width="100" height="20" uuid="507517fa-57c4-4374-abf2-6bdb1ee7e334"/>
							<textElement>
								<font size="12" isBold="true"/>
							</textElement>
							<textFieldExpression><![CDATA[$F{nomecartao}]]></textFieldExpression>
						</textField>
						<textField>
							<reportElement x="100" y="10" width="40" height="20" uuid="f9ac6f69-c377-4040-9d6e-48e1c8ca7c94"/>
							<textElement>
								<font size="12" isBold="true"/>
							</textElement>
							<textFieldExpression><![CDATA[$F{limite}]]></textFieldExpression>
						</textField>
						<textField>
							<reportElement x="140" y="10" width="40" height="20" uuid="3a95d35b-abfc-476b-a039-afa52b436d07"/>
							<textElement>
								<font size="12" isBold="true"/>
							</textElement>
							<textFieldExpression><![CDATA[$F{valor_total}]]></textFieldExpression>
						</textField>
						<textField>
							<reportElement x="180" y="10" width="60" height="20" uuid="e71d9409-9a26-45f4-9d38-9e5874b0c4b8"/>
							<textElement>
								<font size="12" isBold="true"/>
							</textElement>
							<textFieldExpression><![CDATA[$F{vencimento}]]></textFieldExpression>
						</textField>
						<componentElement>
							<reportElement x="0" y="30" width="200" height="60" uuid="78ff01ae-3f66-46fd-9763-aad8b83779a1">
								<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
								<property name="com.jaspersoft.studio.table.style.table_header" value="Table 9_TH"/>
								<property name="com.jaspersoft.studio.table.style.column_header" value="Table 9_CH"/>
								<property name="com.jaspersoft.studio.table.style.detail" value="Table 9_TD"/>
							</reportElement>
							<jr:table>
								<datasetRun subDataset="DebitosCartao" uuid="d847c14d-6cd2-4937-84f2-872b0f9f698b">
									<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
								</datasetRun>
								<jr:column width="100" uuid="1a95a11d-d2c4-4d02-9ade-8780803b9153">
									<jr:tableHeader style="Table 9_TH" height="30">
										<staticText>
											<reportElement x="0" y="0" width="100" height="30" uuid="8f88f07e-cb6d-4c68-8fb6-a70338100944"/>
											<textElement textAlignment="Center" verticalAlignment="Middle">
												<font size="12" isBold="true"/>
											</textElement>
											<text><![CDATA[Débito]]></text>
										</staticText>
									</jr:tableHeader>
									<jr:detailCell style="Table 9_TD" height="30">
										<textField>
											<reportElement x="0" y="0" width="100" height="30" uuid="a883bb16-9166-47cb-a0ac-4ff42edab250"/>
											<textElement textAlignment="Center" verticalAlignment="Middle">
												<font size="12"/>
											</textElement>
											<textFieldExpression><![CDATA[$F{descricao}]]></textFieldExpression>
										</textField>
									</jr:detailCell>
								</jr:column>
								<jr:column width="60" uuid="0b4decf4-2e51-448e-9e37-4005115fd7d3">
									<jr:tableHeader style="Table 9_TH" height="30">
										<staticText>
											<reportElement x="0" y="0" width="60" height="30" uuid="1ea92de7-fac7-4879-ac84-babfa11e108c"/>
											<textElement textAlignment="Center" verticalAlignment="Middle">
												<font size="12" isBold="true"/>
											</textElement>
											<text><![CDATA[Valor]]></text>
										</staticText>
									</jr:tableHeader>
									<jr:detailCell style="Table 9_TD" height="30">
										<textField>
											<reportElement x="0" y="0" width="60" height="30" uuid="d841e04d-ab8a-4424-899a-11427a989fd5"/>
											<textElement textAlignment="Center" verticalAlignment="Middle">
												<font size="12"/>
											</textElement>
											<textFieldExpression><![CDATA[$F{valor}]]></textFieldExpression>
										</textField>
									</jr:detailCell>
								</jr:column>
								<jr:column width="80" uuid="df31395b-91ad-4a57-ae34-45fa5b762829">
									<jr:tableHeader style="Table 9_TH" height="30">
										<staticText>
											<reportElement x="0" y="0" width="80" height="30" uuid="658ad099-7e68-4a02-96d7-ee1352da9855"/>
											<textElement textAlignment="Center" verticalAlignment="Middle">
												<font size="12" isBold="true"/>
											</textElement>
											<text><![CDATA[Data]]></text>
										</staticText>
									</jr:tableHeader>
									<jr:detailCell style="Table 9_TD" height="30">
										<textField>
											<reportElement x="0" y="0" width="80" height="30" uuid="394cd0f3-f615-4ffb-acd3-798e4f35fe92"/>
											<textElement textAlignment="Center" verticalAlignment="Middle">
												<font size="12"/>
											</textElement>
											<textFieldExpression><![CDATA[$F{data_debito}]]></textFieldExpression>
										</textField>
									</jr:detailCell>
								</jr:column>
							</jr:table>
						</componentElement>
					</jr:listContents>
				</jr:list>
			</componentElement>
		</band>
		<band height="264">
			<staticText>
				<reportElement x="142" y="0" width="270" height="50" uuid="6b8f31d2-bc4c-453d-b858-78a28253bd0b"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="12"/>
				</textElement>
				<text><![CDATA[Aqui está os gráfico que mostram em quais categorias você mais gastou ao longo deste mês:]]></text>
			</staticText>
			<pieChart>
				<chart evaluationTime="Report">
					<reportElement x="60" y="60" width="440" height="200" uuid="7f4f0642-2e6b-420b-84c4-c2eda302829b"/>
					<chartTitle/>
					<chartSubtitle/>
					<chartLegend/>
				</chart>
				<pieDataset>
					<dataset>
						<datasetRun subDataset="CategoriaConta" uuid="7b4072c7-9643-4dba-b455-958d4be47e76">
							<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
						</datasetRun>
					</dataset>
					<keyExpression><![CDATA[$F{nome}]]></keyExpression>
					<valueExpression><![CDATA[$F{quantidade}]]></valueExpression>
				</pieDataset>
				<piePlot>
					<plot/>
					<itemLabel/>
				</piePlot>
			</pieChart>
		</band>
		<band height="213">
			<pieChart>
				<chart evaluationTime="Report">
					<reportElement x="60" y="10" width="440" height="200" uuid="43f90792-2edf-4a92-b8d3-1b94b6dc50b2"/>
					<chartTitle/>
					<chartSubtitle/>
					<chartLegend/>
				</chart>
				<pieDataset>
					<dataset>
						<datasetRun subDataset="CategoriaCartao" uuid="5cb105ef-fdda-4da8-9290-b4963232537c">
							<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
						</datasetRun>
					</dataset>
					<keyExpression><![CDATA[$F{nome}]]></keyExpression>
					<valueExpression><![CDATA[$F{quantidade}]]></valueExpression>
				</pieDataset>
				<piePlot>
					<plot/>
					<itemLabel/>
				</piePlot>
			</pieChart>
		</band>
	</detail>
</jasperReport>