<?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="grafico_modelo_madurez_global"
		 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="SUBREPORT_DIR" isForPrompting="true" class="java.lang.String">
		<defaultValueExpression ><![CDATA[".\\src\\informes\\"]]></defaultValueExpression>
	</parameter>
	<parameter name="PR" isForPrompting="false" class="java.lang.Integer"/>
	<parameter name="fecha_inicial" isForPrompting="false" class="java.lang.String"/>
	<parameter name="fecha_final" isForPrompting="false" class="java.lang.String"/>
	<queryString language="hql"><![CDATA[from InformeGraficoModeloMadurezGlobal
where id_proyecto = $P{PR}
and substring(fecha_modelo_madurez,1,4) || '/' ||
substring(fecha_modelo_madurez,6,2)|| '/' ||
substring(fecha_modelo_madurez,9,2) >= $P{fecha_inicial}

and substring(fecha_modelo_madurez,1,4) || '/' ||
substring(fecha_modelo_madurez,6,2)|| '/' ||
substring(fecha_modelo_madurez,9,2) <= $P{fecha_final}

order by fecha_modelo_madurez]]></queryString>

	<field name="fechaModeloMadurez" class="java.lang.String"/>
	<field name="idBloque" class="java.lang.Integer"/>
	<field name="idComponenteBloque" class="java.lang.Integer"/>
	<field name="idComponenteInstancia" class="java.lang.Integer"/>
	<field name="idInstancia" class="java.lang.Integer"/>
	<field name="idProyecto" class="java.lang.Integer"/>
	<field name="modeloMadurezMediaGlobal" class="java.lang.Float"/>
	<field name="nombreBloque" class="java.lang.String"/>
	<field name="nombreComponente" class="java.lang.String"/>
	<field name="nombreInstancia" class="java.lang.String"/>
	<field name="nombreProyecto" class="java.lang.String"/>
	<field name="posicion" class="java.lang.Integer"/>

	<variable name="num_bloques" class="java.lang.Integer" resetType="Report" calculation="DistinctCount">
		<variableExpression><![CDATA[$F{fechaModeloMadurez}]]></variableExpression>
	</variable>
		<background>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</background>
		<title>
			<band height="84"  isSplitAllowed="true" >
				<staticText>
					<reportElement
						mode="Opaque"
						x="0"
						y="6"
						width="534"
						height="75"
						forecolor="#000000"
						key="staticText"/>
					<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 pdfFontName="Helvetica-Bold" size="28" isBold="true"/>
					</textElement>
				<text><![CDATA[GRÁFICO MODELO DE MADUREZ DE MEDIAS GLOBALES]]></text>
				</staticText>
				<line direction="TopDown">
					<reportElement
						x="0"
						y="83"
						width="534"
						height="0"
						key="line"/>
					<graphicElement stretchType="NoStretch"/>
				</line>
				<line direction="TopDown">
					<reportElement
						x="0"
						y="3"
						width="534"
						height="0"
						key="line"/>
					<graphicElement stretchType="NoStretch"/>
				</line>
			</band>
		</title>
		<pageHeader>
			<band height="26"  isSplitAllowed="true" >
				<staticText>
					<reportElement
						mode="Opaque"
						x="3"
						y="5"
						width="62"
						height="17"
						forecolor="#000000"
						backcolor="#AAD6FB"
						key="staticText-8"
						positionType="Float"/>
					<box>					<pen lineWidth="0.5" lineStyle="Solid" lineColor="#003399"/>
					<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#003399"/>
					<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#003399"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#003399"/>
					<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#003399"/>
</box>
					<textElement>
						<font size="12"/>
					</textElement>
				<text><![CDATA[ Proyecto:]]></text>
				</staticText>
				<line direction="BottomUp">
					<reportElement
						x="0"
						y="-151"
						width="535"
						height="0"
						key="line-1"/>
					<graphicElement stretchType="NoStretch"/>
				</line>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="70"
						y="4"
						width="462"
						height="18"
						key="textField"/>
					<box></box>
					<textElement>
						<font size="12"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{nombreProyecto}]]></textFieldExpression>
				</textField>
				<line direction="TopDown">
					<reportElement
						x="0"
						y="25"
						width="535"
						height="0"
						key="line-2"/>
					<graphicElement stretchType="NoStretch"/>
				</line>
			</band>
		</pageHeader>
		<columnHeader>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</columnHeader>
		<detail>
			<band height="0"  isSplitAllowed="true" >
				<rectangle>
					<reportElement
						x="369"
						y="-190"
						width="0"
						height="0"
						key="rectangle-1"/>
					<graphicElement stretchType="NoStretch"/>
				</rectangle>
			</band>
		</detail>
		<columnFooter>
			<band height="23"  isSplitAllowed="true" >
				<staticText>
					<reportElement
						x="21"
						y="10"
						width="0"
						height="0"
						key="staticText-2"/>
					<box></box>
					<textElement>
						<font/>
					</textElement>
				<text><![CDATA[Texto estático]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="1"
						y="3"
						width="109"
						height="20"
						key="staticText-3"/>
					<box></box>
					<textElement>
						<font size="12"/>
					</textElement>
				<text><![CDATA[TOTAL FECHAS:]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="115"
						y="3"
						width="417"
						height="20"
						key="textField"/>
					<box></box>
					<textElement>
						<font size="12"/>
					</textElement>
				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{num_bloques}]]></textFieldExpression>
				</textField>
			</band>
		</columnFooter>
		<pageFooter>
			<band height="25"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="325"
						y="4"
						width="170"
						height="19"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="textField"/>
					<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="Right">
						<font size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA["Page " + $V{PAGE_NUMBER} + " of "]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="499"
						y="4"
						width="36"
						height="19"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="textField"/>
					<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 size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>
				</textField>
				<line direction="TopDown">
					<reportElement
						x="0"
						y="3"
						width="535"
						height="0"
						key="line"/>
					<graphicElement stretchType="NoStretch"/>
				</line>
				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="1"
						y="6"
						width="209"
						height="19"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="textField"/>
					<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 size="10"/>
					</textElement>
				<textFieldExpression   class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>
				</textField>
			</band>
		</pageFooter>
		<summary>
			<band height="583"  isSplitAllowed="true" >
				<staticText>
					<reportElement
						mode="Opaque"
						x="3"
						y="4"
						width="529"
						height="17"
						forecolor="#000000"
						backcolor="#AAD6FB"
						key="staticText-13"
						positionType="Float"/>
					<box>					<pen lineWidth="0.5" lineStyle="Solid" lineColor="#003399"/>
					<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#003399"/>
					<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#003399"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#003399"/>
					<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#003399"/>
</box>
					<textElement textAlignment="Center">
						<font size="12"/>
					</textElement>
				<text><![CDATA[Gráfico circular cronológico de medias globales:]]></text>
				</staticText>
				<pieChart>
					<chart  hyperlinkTarget="Self" >
					<reportElement
						x="2"
						y="24"
						width="532"
						height="229"
						key="element-1"/>
					<box></box>
						<chartLegend textColor="#000000" backgroundColor="#FFFFFF" >
					</chartLegend>
					</chart>
					<pieDataset>
						<dataset >
						</dataset>
						<keyExpression><![CDATA[$F{fechaModeloMadurez}]]></keyExpression>
						<valueExpression><![CDATA[$F{modeloMadurezMediaGlobal}]]></valueExpression>
						<labelExpression><![CDATA[$F{modeloMadurezMediaGlobal}.toString()]]></labelExpression>
				<sectionHyperlink >
						<hyperlinkTooltipExpression><![CDATA["FECHA: " + $F{fechaModeloMadurez} + " - Valor: " + $F{modeloMadurezMediaGlobal}]]></hyperlinkTooltipExpression>
				</sectionHyperlink>
					</pieDataset>
					<piePlot 
isCircular="true" >
						<plot />
					</piePlot>
				</pieChart>
				<staticText>
					<reportElement
						mode="Opaque"
						x="3"
						y="269"
						width="529"
						height="17"
						forecolor="#000000"
						backcolor="#AAD6FB"
						key="staticText-14"
						positionType="Float"/>
					<box>					<pen lineWidth="0.5" lineStyle="Solid" lineColor="#003399"/>
					<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#003399"/>
					<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#003399"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#003399"/>
					<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#003399"/>
</box>
					<textElement textAlignment="Center">
						<font size="12"/>
					</textElement>
				<text><![CDATA[Gráfico de líneas cronológico de medias globales:]]></text>
				</staticText>
				<lineChart>
					<chart isShowLegend="false"  hyperlinkTarget="Self" >
					<reportElement
						x="3"
						y="290"
						width="529"
						height="288"
						key="element-2"/>
					<box></box>
					</chart>
					<categoryDataset>
						<dataset >
						</dataset>
						<categorySeries>
							<seriesExpression><![CDATA[$F{fechaModeloMadurez}]]></seriesExpression>
							<categoryExpression><![CDATA[$F{fechaModeloMadurez}]]></categoryExpression>
							<valueExpression><![CDATA[$F{modeloMadurezMediaGlobal}]]></valueExpression>
							<labelExpression><![CDATA[$F{modeloMadurezMediaGlobal}.toString()]]></labelExpression>
				<itemHyperlink >
						<hyperlinkTooltipExpression><![CDATA[$F{fechaModeloMadurez} + " - Valor: " + $F{modeloMadurezMediaGlobal}]]></hyperlinkTooltipExpression>
				</itemHyperlink>
						</categorySeries>
					</categoryDataset>
					<linePlot >
						<plot labelRotation="50.0" />
						<categoryAxisFormat>
							<axisFormat >
							</axisFormat>
						</categoryAxisFormat>
						<valueAxisFormat>
							<axisFormat >
							</axisFormat>
						</valueAxisFormat>
					</linePlot>
				</lineChart>
			</band>
		</summary>
</jasperReport>
