<?xml version="1.0" encoding="UTF-8"  ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport
		 name="OUTROS_PERCENTUAL_MARKETING"
		 columnCount="1"
		 printOrder="Vertical"
		 orientation="Portrait"
		 pageWidth="595"
		 pageHeight="842"
		 columnWidth="535"
		 columnSpacing="0"
		 leftMargin="30"
		 rightMargin="30"
		 topMargin="20"
		 bottomMargin="20"
		 whenNoDataType="NoPages"
		 isTitleNewPage="false"
		 isSummaryNewPage="false">
	<property name="ireport.scriptlethandling" value="0" />
	<property name="ireport.encoding" value="UTF-8" />
	<import value="java.util.*" />
	<import value="net.sf.jasperreports.engine.*" />
	<import value="net.sf.jasperreports.engine.data.*" />

	<parameter name="CNPJ_NOME" isForPrompting="false" class="java.lang.String"/>
	<parameter name="INSCRICAO_ESTADUAL_NOME" isForPrompting="false" class="java.lang.String"/>
	<parameter name="LOGO_RELATORIO" isForPrompting="false" class="net.sf.jasperreports.engine.JRImageRenderer"/>
	<parameter name="NOME_EMPRESA" isForPrompting="false" class="java.lang.String"/>
	<parameter name="FECHO" isForPrompting="false" class="java.lang.String"/>
	<parameter name="DATA_INICIAL" isForPrompting="false" class="java.util.Date"/>
	<parameter name="DATA_FINAL" isForPrompting="false" class="java.util.Date"/>
	<parameter name="LOGO_RELATORIO_1" isForPrompting="false" class="net.sf.jasperreports.engine.JRImageRenderer"/>
	<queryString><![CDATA[select count(r.id_relacionamento_pessoa) as qtd,p.nome from relacionamento_pessoa r
inner join procedencia_solicitacao p on p.id_procedencia_solicitacao = r.id_procedencia_solicitacao
where cast(r.data_relacionamento as Date) between $P{DATA_INICIAL} and $P{DATA_FINAL}
group by p.nome]]></queryString>

	<field name="QTD" class="java.lang.Integer"/>
	<field name="NOME" class="java.lang.String"/>

	<variable name="SUM_QTD_1" class="java.lang.Integer" resetType="Report" calculation="Sum">
		<variableExpression><![CDATA[$F{QTD}]]></variableExpression>
	</variable>
	<variable name="presoma" class="java.lang.Double" resetType="Page" calculation="Nothing">
		<variableExpression><![CDATA[new Double($F{QTD}.floatValue()/$V{SUM_QTD_1}.floatValue()*100)]]></variableExpression>
	</variable>
		<background>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</background>
		<title>
			<band height="53"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="155"
						y="9"
						width="279"
						height="17"
						key="textField-1"/>
					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
					<textElement textAlignment="Center" verticalAlignment="Top">
						<font pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$P{NOME_EMPRESA}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="434"
						y="16"
						width="35"
						height="14"
						key="staticText-1"/>
					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
					<textElement>
						<font pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[Data :]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="434"
						y="32"
						width="35"
						height="14"
						key="staticText-2"/>
					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
					<textElement>
						<font pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[Hora :]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="159"
						y="33"
						width="27"
						height="12"
						key="staticText-3"/>
					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
					<textElement>
						<font pdfFontName="Helvetica-BoldOblique" size="8" isBold="true" isItalic="true"/>
					</textElement>
				<text><![CDATA[CNPJ :]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="268"
						y="33"
						width="77"
						height="12"
						key="staticText-4"/>
					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
					<textElement>
						<font pdfFontName="Helvetica-BoldOblique" size="8" isBold="true" isItalic="true"/>
					</textElement>
				<text><![CDATA[Inscrição Estadual :]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="187"
						y="33"
						width="80"
						height="12"
						key="textField-4"/>
					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
					<textElement verticalAlignment="Middle">
						<font size="8"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$P{CNPJ_NOME}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="346"
						y="33"
						width="85"
						height="12"
						key="textField-5"/>
					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
					<textElement verticalAlignment="Middle">
						<font size="8"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$P{INSCRICAO_ESTADUAL_NOME}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="dd/MM/yyyy" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="469"
						y="16"
						width="66"
						height="14"
						key="textField"/>
					<box></box>
					<textElement>
						<font/>
					</textElement>
				<textFieldExpression   class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="HH.mm.ss" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="469"
						y="30"
						width="66"
						height="16"
						key="textField"/>
					<box></box>
					<textElement>
						<font/>
					</textElement>
				<textFieldExpression   class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
				</textField>
				<image  onErrorType="Blank" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="2"
						y="0"
						width="154"
						height="52"
						key="image-1"/>
					<box></box>
					<graphicElement stretchType="NoStretch"/>
					<imageExpression class="net.sf.jasperreports.engine.JRRenderable"><![CDATA[$P{LOGO_RELATORIO}]]></imageExpression>
				</image>
			</band>
		</title>
		<pageHeader>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</pageHeader>
		<columnHeader>
			<band height="31"  isSplitAllowed="true" >
				<staticText>
					<reportElement
						x="245"
						y="20"
						width="55"
						height="11"
						key="staticText-8"/>
					<box></box>
					<textElement textAlignment="Right" verticalAlignment="Bottom">
						<font pdfFontName="Helvetica-Bold" size="7" isBold="true"/>
					</textElement>
				<text><![CDATA[Quantidade:]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="0"
						y="1"
						width="535"
						height="19"
						key="staticText-10"/>
					<box></box>
					<textElement textAlignment="Center">
						<font/>
					</textElement>
				<text><![CDATA[Proporção do Relacionamento com Pessoas]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="312"
						y="20"
						width="45"
						height="11"
						key="staticText-12"/>
					<box></box>
					<textElement textAlignment="Right" verticalAlignment="Bottom">
						<font pdfFontName="Helvetica-Bold" size="7" isBold="true"/>
					</textElement>
				<text><![CDATA[Percentual:]]></text>
				</staticText>
			</band>
		</columnHeader>
		<detail>
			<band height="13"  isSplitAllowed="true" >
				<line direction="BottomUp">
					<reportElement
						x="0"
						y="11"
						width="535"
						height="1"
						key="line-2"/>
					<graphicElement stretchType="NoStretch">
					<pen lineWidth="0.25"/>
</graphicElement>
				</line>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="68"
						y="0"
						width="177"
						height="11"
						key="textField"/>
					<box></box>
					<textElement>
						<font size="7"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{NOME}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="0"
						y="0"
						width="68"
						height="11"
						key="staticText-9"/>
					<box></box>
					<textElement>
						<font pdfFontName="Helvetica-Bold" size="7" isBold="true"/>
					</textElement>
				<text><![CDATA[Procedência:]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="245"
						y="0"
						width="55"
						height="11"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right">
						<font size="7"/>
					</textElement>
				<textFieldExpression   class="java.lang.Integer"><![CDATA[$F{QTD}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="368"
						y="1"
						width="29"
						height="10"
						key="staticText-13"/>
					<box></box>
					<textElement>
						<font size="7"/>
					</textElement>
				<text><![CDATA[%]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Auto" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="311"
						y="0"
						width="57"
						height="11"
						key="textField-14"/>
					<box></box>
					<textElement textAlignment="Center">
						<font size="7"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[new Double($F{QTD}.floatValue()/$V{SUM_QTD_1}.floatValue()*100)]]></textFieldExpression>
				</textField>
			</band>
		</detail>
		<columnFooter>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</columnFooter>
		<pageFooter>
			<band height="31"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="478"
						y="16"
						width="17"
						height="15"
						key="textField-6"/>
					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
					<textElement textAlignment="Center" verticalAlignment="Middle">
						<font pdfFontName="Helvetica-Bold" size="9" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="503"
						y="16"
						width="17"
						height="15"
						key="textField-7"/>
					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
					<textElement textAlignment="Center" verticalAlignment="Middle">
						<font pdfFontName="Helvetica-Bold" size="9" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="495"
						y="16"
						width="8"
						height="15"
						key="staticText-5"/>
					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
					<textElement textAlignment="Center" verticalAlignment="Middle">
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[/]]></text>
				</staticText>
			</band>
		</pageFooter>
		<lastPageFooter>
			<band height="40"  isSplitAllowed="true" >
				<staticText>
					<reportElement
						x="311"
						y="14"
						width="160"
						height="14"
						key="staticText-6"/>
					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
					<textElement textAlignment="Center">
						<font/>
					</textElement>
				<text><![CDATA[Contato Sistemas]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="477"
						y="17"
						width="17"
						height="15"
						key="textField-8"/>
					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
					<textElement textAlignment="Center" verticalAlignment="Middle">
						<font pdfFontName="Helvetica-Bold" size="9" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="502"
						y="17"
						width="17"
						height="15"
						key="textField-9"/>
					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
					<textElement textAlignment="Center" verticalAlignment="Middle">
						<font pdfFontName="Helvetica-Bold" size="9" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="494"
						y="17"
						width="8"
						height="15"
						key="staticText-7"/>
					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
					<textElement textAlignment="Center" verticalAlignment="Middle">
						<font pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[/]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="RemotePage"  hyperlinkTarget="Self" >
					<reportElement
						x="311"
						y="26"
						width="160"
						height="14"
						forecolor="#0099FF"
						key="textField-10"/>
					<box></box>
					<textElement textAlignment="Center">
						<font pdfFontName="Helvetica-Oblique" size="9" isItalic="true" isUnderline="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA["www.contatosistemas.com"]]></textFieldExpression>
						<hyperlinkReferenceExpression><![CDATA["HTTP://WWW.CONTATOSISTEMAS.COM"]]></hyperlinkReferenceExpression>
				</textField>
				<line direction="TopDown">
					<reportElement
						x="311"
						y="15"
						width="160"
						height="1"
						key="line-1"/>
					<graphicElement stretchType="NoStretch"/>
				</line>
			</band>
		</lastPageFooter>
		<summary>
			<band height="243"  isSplitAllowed="true" >
				<pie3DChart>
					<chart  hyperlinkTarget="Self" >
					<reportElement
						x="0"
						y="13"
						width="535"
						height="200"
						key="element-1"/>
					<box></box>
						<chartTitle color="#000000" >
								<titleExpression><![CDATA["Proporções de Atendimento"]]></titleExpression>
					</chartTitle>
						<chartLegend textColor="#000000" backgroundColor="#FFFFFF" >
					</chartLegend>
					</chart>
					<pieDataset>
						<dataset >
						</dataset>
						<keyExpression><![CDATA[$F{NOME}]]></keyExpression>
						<valueExpression><![CDATA[$F{QTD}]]></valueExpression>
				<sectionHyperlink >
				</sectionHyperlink>
					</pieDataset>
					<pie3DPlot >
						<plot />
					</pie3DPlot>
				</pie3DChart>
				<textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="0"
						y="220"
						width="535"
						height="23"
						key="textField-11"
						isRemoveLineWhenBlank="true"/>
					<box></box>
					<textElement textAlignment="Center" markup="html">
						<font/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$P{FECHO}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="139"
						y="0"
						width="106"
						height="11"
						key="staticText-11"/>
					<box></box>
					<textElement textAlignment="Right" verticalAlignment="Bottom">
						<font pdfFontName="Helvetica-Bold" size="7" isBold="true"/>
					</textElement>
				<text><![CDATA[Total de Relacionamentos:]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="245"
						y="0"
						width="55"
						height="11"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right" verticalAlignment="Bottom">
						<font size="7"/>
					</textElement>
				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{SUM_QTD_1}]]></textFieldExpression>
				</textField>
				<line direction="BottomUp">
					<reportElement
						x="0"
						y="216"
						width="535"
						height="1"
						key="line-3"/>
					<graphicElement stretchType="NoStretch">
					<pen lineWidth="0.25"/>
</graphicElement>
				</line>
			</band>
		</summary>
</jasperReport>
