package utiliServlet;

import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Locale;
import java.util.ResourceBundle;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import m05bClasses.m05bComun;
import m05bClasses.m05bConstantes;
import m05bClasses.m05bFileLog;
import m05bObjects.m05bCTK;

import org.apache.fop.apps.Driver;
import org.xml.sax.InputSource;

/**
 * Inserte aquí la descripción del tipo. Fecha de creación: (02/11/05)
 */

public class m05bImpCTKServlet extends javax.servlet.http.HttpServlet {m05bFileLog miLog = new m05bFileLog();

	java.sql.Connection conn = null;
	String sLinea;
	String sFoFileDir = "/datos/m05b/tmp/";
	File foFileDir;
	File tmpFoFile;
	FileOutputStream tmpFoFileStream;
	m05bComun miComun = new m05bComun();
	
	// Logger log = null;

	public static final String FO_REQUEST_PARAM = "fo";

	public void doPost(javax.servlet.http.HttpServletRequest request,
			javax.servlet.http.HttpServletResponse response)
			throws javax.servlet.ServletException, java.io.IOException {
		performTask(request, response);
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException {
		performTask(request, response);
	}

	public void performTask(javax.servlet.http.HttpServletRequest request,
			javax.servlet.http.HttpServletResponse response)
			throws ServletException {

		try {
			HttpSession session = request.getSession(false);
			ResourceBundle res = (ResourceBundle) session
					.getAttribute("res");
			ResourceBundle resTit = (ResourceBundle) session
			.getAttribute("resTit");
			Locale idiomaLocal = (Locale) session.getAttribute("Local");
			String idiomaSes = ((idiomaLocal.getLanguage() == null) ? "es"
					: idiomaLocal.getLanguage());
			String campoTexto = "", campoTexto2 = "", campoTexto3 = "C";
			String formatoFecha="dd/MM/yyyy";
			if (!idiomaSes.equals("es")) {
				campoTexto = "E";
				campoTexto2 = "E_";
				campoTexto3 = "E";
				formatoFecha = "yyyy/MM/dd";
			}
			m05bCTK objCTK = (m05bCTK) session.getAttribute("CTK");
			String desde = request.getParameter("Desde");
			String fDesde ;
			String hasta = request.getParameter("Hasta");
			String fHasta ;
			if (idiomaSes.equals("es")) {
				fHasta = hasta.substring(6, 8) + "-" + hasta.substring(4, 6)
				+ "-" + hasta.substring(0, 4);
				fDesde = desde.substring(6, 8) + "-" + desde.substring(4, 6)
				+ "-" + desde.substring(0, 4);
			}
			else{
				fHasta = hasta.substring(0, 4) + "-" + hasta.substring(4, 6)
				+ "-" + hasta.substring(6, 8);
				fDesde = desde.substring(0, 4) + "-" + desde.substring(4, 6)
				+ "-" + desde.substring(6, 8);
			}
			m05bComun miComun = new m05bComun();

			// Extraccion de parametros, aprovecho la url para xlnets para sacar
			// la url de jakina
			String xlnetsini = miComun.leerPropiedad("xlnets");
			// String urlprin = xlnetsini.substring(0, xlnetsini.indexOf("/",
			// 8));

			// String foParam = request.getParameter(FO_REQUEST_PARAM);
			fncAbrirFicheroTemporal();

			tmpFoFileStream = new FileOutputStream(tmpFoFile);

			sLinea = "<?xml version=\"1.0\" encoding=\"windows-1252\"?>\n";
			tmpFoFileStream.write(sLinea.getBytes());

			sLinea = "<fo:root xmlns:fo=\"http://www.w3.org/1999/XSL/Format\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// LAYOUT DEL LISTADO
			sLinea = "<fo:layout-master-set>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	<fo:simple-page-master master-name=\"general\"  page-height=\"21cm\" page-width=\"29.5cm\" margin-top=\"2cm\" margin-bottom=\"2cm\" margin-left=\"2.5cm\" margin-right=\"2.5cm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "		<fo:region-before extent=\"2cm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "		<fo:region-body  margin-top=\"2cm\" margin-bottom=\"2cm\" />\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "		<fo:region-after  extent=\"2cm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "		<fo:region-start extent=\"0cm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "		<fo:region-end extent=\"0cm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());

			sLinea = "	</fo:simple-page-master>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "</fo:layout-master-set>\n";
			tmpFoFileStream.write(sLinea.getBytes());

			// PAGE-SEQUENCE DEL LISTADO
			sLinea = "<fo:page-sequence master-reference=\"general\">\n";
			tmpFoFileStream.write(sLinea.getBytes());

			// REGION BEFORE
			sLinea = "		<fo:static-content flow-name=\"xsl-region-before\" >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block font-weight=\"bold\" padding-top=\"10pt\">\n "
					+ res.getString("etCtkinf")
					+ "</fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block font-weight=\"bold\" padding-top=\"10pt\">\n "
					+ res.getString("etCtk7")
					+ fDesde
					+ "  -  "+ res.getString("etCtk8")
					+ fHasta
					+ "</fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = " 		</fo:static-content>\n";
			tmpFoFileStream.write(sLinea.getBytes());

			// PIE DE PAGINA
			fncGenerarPiePagina(campoTexto3,resTit);

			// BODY
			sLinea = "	<fo:flow flow-name=\"xsl-region-body\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			Context ctx = new InitialContext(System.getProperties());
			// -------------- DETALLE DEL LISTADO --------------
			// tabla CONCEPTOS
			sLinea = "        <fo:table space-after.optimum=\"12pt\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"50mm\" background-color=\"rgb(200,200,200)\" />\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"20mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"20mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"25mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"20mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"25mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"25mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"20mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"65mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			/*
			 * sLinea =
			 * "	    <fo:table-header font-family=\"Helvetica\" font-size=\"7pt\" >\n"
			 * ; tmpFoFileStream.write(sLinea.getBytes()); sLinea =
			 * "	    </fo:table-header>\n";
			 * tmpFoFileStream.write(sLinea.getBytes());
			 */

			// DETALLE
			sLinea = "	    <fo:table-body font-family=\"Helvetica\" font-size=\"8pt\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// CABECERA
			sLinea = "	    <fo:table-row background-color=\"rgb(200,200,200)\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell border-width=\"0.1mm\" border-bottom-width=\"0pt\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block>\n  </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
//			// Blanco
//			sLinea = "	    <fo:table-cell border-width=\"0.1mm\" border-right-width=\"0pt\" border-style=\"solid\">\n";
//			tmpFoFileStream.write(sLinea.getBytes());
//			sLinea = "      <fo:block>\n</fo:block>\n";
//			tmpFoFileStream.write(sLinea.getBytes());
//			sLinea = "	    </fo:table-cell>\n";
//			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES
			sLinea = "	    <fo:table-cell number-columns-spanned=\"6\" padding-top=\"1mm\" border-left-width=\"0pt\" border-right-width=\"0pt\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n"+res.getString("etValoresPorRango")+"</fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// POR
//			sLinea = "	    <fo:table-cell padding-top=\"1mm\" border-width=\"0.1mm\" border-left-width=\"0pt\" border-right-width=\"0pt\" border-style=\"solid\">\n";
//			tmpFoFileStream.write(sLinea.getBytes());
//			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\nPOR</fo:block>\n";
//			tmpFoFileStream.write(sLinea.getBytes());
//			sLinea = "	    </fo:table-cell>\n";
//			tmpFoFileStream.write(sLinea.getBytes());
//			// RANGO
//			sLinea = "	    <fo:table-cell padding-top=\"1mm\" border-width=\"0.1mm\" border-left-width=\"0pt\" border-right-width=\"0pt\" border-style=\"solid\">\n";
//			tmpFoFileStream.write(sLinea.getBytes());
//			sLinea = "      <fo:block  text-align=\"left\" font-weight=\"bold\">\nRANGO</fo:block>\n";
//			tmpFoFileStream.write(sLinea.getBytes());
//			sLinea = "	    </fo:table-cell>\n";
//			tmpFoFileStream.write(sLinea.getBytes());
//			// Blanco
//			sLinea = "	    <fo:table-cell border-width=\"0.1mm\" border-left-width=\"0pt\" border-right-width=\"0pt\" border-style=\"solid\">\n";
//			tmpFoFileStream.write(sLinea.getBytes());
//			sLinea = "      <fo:block>\n</fo:block>";
//			tmpFoFileStream.write(sLinea.getBytes());
//			sLinea = "	    </fo:table-cell>\n";
//			tmpFoFileStream.write(sLinea.getBytes());
//			// Blanco
//			sLinea = "	    <fo:table-cell border-width=\"0.1mm\" border-left-width=\"0pt\" border-right-width=\"0pt\" border-style=\"solid\">\n";
//			tmpFoFileStream.write(sLinea.getBytes());
//			sLinea = "      <fo:block>\n</fo:block>";
//			tmpFoFileStream.write(sLinea.getBytes());
//			sLinea = "	    </fo:table-cell>\n";
//			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell border-width=\"0.1mm\" border-bottom-width=\"0pt\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block>\n</fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell border-bottom-width=\"0pt\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block>\n</fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// CABECERA
			sLinea = "	    <fo:table-row background-color=\"rgb(200,200,200)\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// CONCEPTOS
			sLinea = "	    <fo:table-cell border-width=\"0.1mm\" border-top-width=\"0pt\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\" font-weight=\"bold\">\n "+res.getString("etConceptos")+"</fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// A
			sLinea = "	    <fo:table-cell padding-top=\"1mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n A </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// B
			sLinea = "	    <fo:table-cell padding-top=\"1mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n B </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// C
			sLinea = "	    <fo:table-cell padding-top=\"1mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n C </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// D
			sLinea = "	    <fo:table-cell padding-top=\"1mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n D </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// RA
			sLinea = "	    <fo:table-cell padding-top=\"1mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n RA </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// RB
			sLinea = "	    <fo:table-cell padding-top=\"1mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n RB </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell border-width=\"0.1mm\" border-top-width=\"0pt\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n "+res.getString("etDetTotal")+" </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell border-width=\"0.1mm\" border-top-width=\"0pt\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\" font-weight=\"bold\">\n "+res.getString("etObservaciones")+" </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-body>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "       </fo:table>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// tabla NUMERO DE VEHICULOS
			sLinea = "        <fo:table space-after.optimum=\"12pt\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"50mm\" background-color=\"rgb(200,200,200)\" />\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"20mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"20mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"25mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"20mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"25mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"25mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"20mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"65mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());

			// /DETALLE
			sLinea = "	    <fo:table-body font-family=\"Helvetica\" font-size=\"8pt\">\n";
			tmpFoFileStream.write(sLinea.getBytes());

			// NUMERO DE VEHICULOS
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// NUMERO DE VEHICULOS
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\" font-weight=\"bold\">\n"+res.getString("etNumVehiculos")+"</fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block>\n </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block>\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block>\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block>\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block>\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block>\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block>\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block>\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// TOTAL
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// TOTAL
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+res.getString("etDetTotal")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(0, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(0, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(0, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(0, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(0, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(0, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(0, 6) + "  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\">\n "
					+ objCTK.getCTK_elem(0, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// MEDIA
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// MEDIA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+res.getString("etMedia")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(1, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(1, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(1, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(1, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(1, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(1, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(1, 6) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\">\n "
					+ objCTK.getCTK_elem(1, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// KILOMETROS
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// KILOMETROS
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+res.getString("etKilometros")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(2, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(2, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(2, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(2, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(2, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(2, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(2, 6) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\">\n "
					+ objCTK.getCTK_elem(2, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// AMORTIZACION
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// AMORTIZACION
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\">\n"+res.getString("etAmortizacion")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(3, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(3, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(3, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(3, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(3, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(3, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(3, 6) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\">\n "
					+ objCTK.getCTK_elem(3, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// COMBUSTIBLE
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// COMBUSTIBLE
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block padding-left=\"1mm\" text-align=\"left\">\n "+res.getString("etGastosCombustible")+"</fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(4, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(4, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(4, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(4, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(4, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\">\n "
					+ objCTK.getCTK_elem(4, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(4, 6) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\">\n "
					+ objCTK.getCTK_elem(4, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-body>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "       </fo:table>\n";
			tmpFoFileStream.write(sLinea.getBytes());

			// tabla GASTOS TALLER
			sLinea = "        <fo:table space-after.optimum=\"12pt\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"50mm\" background-color=\"rgb(200,200,200)\" />\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"20mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"20mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"25mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"20mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"25mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"25mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"20mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"65mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// /DETALLE
			sLinea = "	    <fo:table-body font-family=\"Helvetica\" font-size=\"8pt\">\n";
			tmpFoFileStream.write(sLinea.getBytes());

			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// GASTOS TALLER
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\" font-weight=\"bold\">\n "+res.getString("etGastosTaller")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// N. INTERVENCIONES TALLER PROPIO
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// INTERVENCIONES TALLER PROPIO
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" padding-left=\"1mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+res.getString("etIntervTallerPropio")+"</fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(5, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(5, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(5, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(5, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(5, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(5, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(5, 6) + "  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(5, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// PROPORCION REPARTO GASTOS TALLER
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// PROPORCION REPARTO GASTOS TALLER
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+res.getString("etRepartoGastosTaller")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(6, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(6, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(6, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(6, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(6, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(6, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(6, 6) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(6, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// SUMINISTROS TALLER
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// SUMINISTROS TALLER
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+res.getString("etSuministrosTaller")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(7, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(7, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(7, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(7, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(7, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(7, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(7, 6) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(7, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// AMORTIZACION EQUIPO TALLER
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// AMORTIZACION EQUIPO TALLER
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+res.getString("etAmortizEquipoTaller")+"</fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(8, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(8, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(8, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(8, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(8, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(8, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(8, 6) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(8, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// OTROS GASTOS TALLER PROPIO
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// OTROS GASTOS TALLER PROPIO
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+res.getString("etOtrosGasTalPropio")+"</fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(9, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(9, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(9, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(9, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(9, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(9, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(9, 6) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(9, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// GASTOS TALLERES EXTERNOS
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// GASTOS TALLERES EXTERNOS
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+res.getString("etGastosTallerExt")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(10, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(10, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(10, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(10, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(10, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(10, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(10, 6) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(10, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-body>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "       </fo:table>\n";
			tmpFoFileStream.write(sLinea.getBytes());

			// tabla GASTOS DE PERSONAL
			sLinea = "        <fo:table space-after.optimum=\"12pt\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"50mm\" background-color=\"rgb(200,200,200)\" />\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"20mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"20mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"25mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"20mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"25mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"25mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"20mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    <fo:table-column column-width=\"65mm\"/>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			/*
			 * sLinea =
			 * "	    <fo:table-header font-family=\"Helvetica\" font-size=\"7pt\" >\n"
			 * ; tmpFoFileStream.write(sLinea.getBytes()); sLinea =
			 * "	    </fo:table-header>\n";
			 * tmpFoFileStream.write(sLinea.getBytes());
			 */

			// /DETALLE
			sLinea = "	    <fo:table-body font-family=\"Helvetica\" font-size=\"8pt\">\n";
			tmpFoFileStream.write(sLinea.getBytes());

			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// GASTOS DE PERSONAL
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\" font-weight=\"bold\">\n "+res.getString("etGastosPersonal")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Blanco
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0mm\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"center\" font-weight=\"bold\">\n  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// PLANTILLA MEDIA TOTAL PM
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// PLANTILLA MEDIA TOTAL PM
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+res.getString("etPlantMediaPM")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(11, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(11, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(11, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(11, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(11, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(11, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(11, 6) + "  </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(11, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// TOTAL GASTOS DE PERSONAL
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// TOTAL GASTOS DE PERSONAL
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+res.getString("etTotGastosPersonal")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(12, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(12, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(12, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(12, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(12, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(12, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(12, 6) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(12, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// PLANTILLA MEDIA TALLER
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// PLANTILLA MEDIA TALLER
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+res.getString("etPlantMediaTaller")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(13, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(13, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(13, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(13, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(13, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(13, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(13, 6) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(13, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// PLANTILLA MEDIA ADMON
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// PLANTILLA MEDIA ADMON
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+ res.getString("etPlantMediaAdmon")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(14, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(14, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(14, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(14, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(14, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(14, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(14, 6) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(14, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// PRIMA ANUAL SEGURO
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// PRIMA ANUAL SEGURO
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+res.getString("etPrimaAnualSeguro")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(15, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(15, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(15, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(15, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(15, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(15, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(15, 6) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(15, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// ITV
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// ITV
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+res.getString("etITV")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(16, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(16, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(16, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(16, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(16, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(16, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(16, 6) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(16, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Impuestos
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Impuestos
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+res.getString("etImpuestos")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(17, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(17, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(17, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(17, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(17, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(17, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(17, 6) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(17, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Renting
			sLinea = "	    <fo:table-row >\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Renting
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block text-align=\"left\">\n "+res.getString("etRenting")+" </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - A
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(18, 0) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - B
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(18, 1) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - C
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(18, 2) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - D
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(18, 3) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RA
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(18, 4) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// VALORES POR RANGO - RB
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(18, 5) + " </fo:block>";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Total
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"right\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(18, 6) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			// Observaciones
			sLinea = "	    <fo:table-cell padding-top=\"0.2mm\" border-width=\"0.1mm\" border-style=\"solid\">\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      <fo:block  text-align=\"left\" font-weight=\"bold\">\n "
					+ objCTK.getCTK_elem(18, 7) + " </fo:block>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-cell>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-row>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "	    </fo:table-body>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "       </fo:table>\n";
			tmpFoFileStream.write(sLinea.getBytes());
			sLinea = "      </fo:flow>\n";
			tmpFoFileStream.write(sLinea.getBytes());

			sLinea = "   </fo:page-sequence>\n";
			tmpFoFileStream.write(sLinea.getBytes());

			sLinea = "</fo:root>\n";
			tmpFoFileStream.write(sLinea.getBytes());

			tmpFoFileStream.close();

			FileInputStream file = new FileInputStream(sFoFileDir
					+ tmpFoFile.getName());
			renderFO(new InputSource(file), response);
			tmpFoFile.delete();
			response.flushBuffer();

		} catch (Exception ex) {
			try {
				response.sendRedirect("m05bError.jsp");
			} catch (IOException e) {
				// TODO Auto-generated catch block
				miLog.addTraza(e);
			}
		}
	} // Fin funcion performTask

	/**
	 * renders an FO inputsource into a PDF file which is rendered directly to
	 * the response object's OutputStream
	 */
	public void renderFO(InputSource foFile, HttpServletResponse response)
			throws ServletException {
		try {
			ByteArrayOutputStream out = new ByteArrayOutputStream();

			response.reset();
			OutputStream oOut = response.getOutputStream();
			BufferedOutputStream bOut = new BufferedOutputStream(oOut);
			Driver driver = new Driver(foFile, out);
			driver.setRenderer(Driver.RENDER_PDF);
			driver.run();

			response.setContentLength(out.size());
			response.setContentType("application/pdf");

			bOut.write(out.toByteArray());
			out.close();
			bOut.flush();
			bOut.close();
			// response.flushBuffer();
		} catch (Exception ex) {
			throw new ServletException(ex);
		}
	}

	private void fncAbrirFicheroTemporal() throws java.io.IOException {
		foFileDir = new File(sFoFileDir);
		tmpFoFile = File.createTempFile("m05b", "Fo", foFileDir);
		tmpFoFileStream = new FileOutputStream(tmpFoFile);
	}

	private void fncGenerarPiePagina(String idioma,ResourceBundle res) throws java.io.IOException {
		sLinea = "		<fo:static-content flow-name=\"xsl-region-after\">\n";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "      <fo:block >\n";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "       <fo:table>\n";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "	    <fo:table-column column-width=\"80mm\"/>\n";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "	    <fo:table-column column-width=\"160mm\"/>\n";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "	    <fo:table-body font-family=\"Helvetica\" font-size=\"6pt\">\n";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "	    <fo:table-row>\n";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "	    <fo:table-cell >\n";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "      <fo:block text-align=\"left\">"
				+ miComun.getDetFechaActual(idioma)
				+ "</fo:block>";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "	    </fo:table-cell>\n";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "	    <fo:table-cell >\n";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "      <fo:block text-align=\"right\">";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = res.getString("pagina")+" <fo:page-number/> \n";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "</fo:block>";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "	    </fo:table-cell>\n";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "	    </fo:table-row>\n";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "	    </fo:table-body>\n";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "       </fo:table>\n";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = "      </fo:block>\n";
		tmpFoFileStream.write(sLinea.getBytes());
		sLinea = " 		</fo:static-content>\n";
		tmpFoFileStream.write(sLinea.getBytes());
		miLog.addTraza(m05bConstantes.LOG_NO_USER, m05bConstantes.LOG_NO_SRC,
				"CUATRO", m05bConstantes.LOG_NIVEL_BAJO);
	}

}