elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Usando Git para manipular el directorio de trabajo, el índice y commits (segunda parte)


  Mostrar Temas
Páginas: [1]
1  Programación / Desarrollo Web / subir imágenes desde web (Lenguajes, javascript y java) en: 9 Octubre 2013, 23:56 pm
Hola a todos!

A ver si logro darme a entender, soy nueva en esto del manejo de imágenes y la verdad no tengo ni idea de como resolver lo siguiente. El asunto es el siguiente:

En mi página web, (un archivo llamado subirImagen.jsp tengo el siguiente código html)
Código
  1. <script type="text/javascript" src="activaciones/js/imagen.js"></script>
  2.  
  3. <h2 style="width: 100%; text-align: center;">Elegir Imágenes</h2>
  4. <br>
  5. <b>Nota importante: </b>El peso máximo de las imágenes permitido es de <u>500 Kb</u>
  6. <br>y el tipo de archivo permitido son: <u>jpg</u> y <u>gif</u>.
  7.  
  8. <h3>Fachada principal: <b id="b_fachada"></b></h3>
  9. <input type="file" id="fachada"/>
  10.  
  11. <h3>Tarjeta inteligente: <b id="b_tarjeta"></b></h3>
  12. <input type="file" id="tarjeta"/>
  13.  
  14. <h3>Instalación de la antena: <b id="b_antena"></b></h3>
  15. <input type="file" id="antena"/>
  16.  
  17. <h3>Ubicación de google: <b id="b_mapa"></b></h3>
  18. <input type="file" id="mapa"/>
  19. <br><br>
  20.  
  21. <center>    
  22.    <input id="guardarImg" style="width: 150px;" type="button" value="Subir Imágenes" onclick="subirImagen();" disabled="disabled" />
  23.  

Eso pues me genera una página donde al usuario le da opción de subir 4 imágenes (ya tengo hecha la verificación de que lass imagenes sean JPG o GIF y que el peso no sobrepase los 500Kb)

Ahora... al dar click en el botón "Subir Imágenes" se ejecuta la función "subirImagen()" que se encuentra en el archivo imagen.js que actualmente se encuentra algo así:
Código
  1. function subirImagen() {
  2.    var post = "";
  3.    var contrato, id_act;
  4.    var arch_fachada, arch_tarjeta, arch_antena, arch_mapa;
  5.  
  6.    contrato = $("#contrato"),val();
  7.    id_act = $("#id_activacion").val();
  8.  
  9.    var arch_fachada = // ??? como cacho aqui la imagen??
  10.  
  11.    post = "cont="+contrato+"&id_act="+id_act+"&fachada="+arch_fachada+"&tarjeta="+arch_tarjeta+"&antena="+arch_antena+"&mapa="+arch_mapa+"";
  12.  
  13.    var btguardar = $("#guardarImg").replaceWith("<img id='registrando' src='"+getBaseURL()+"recursos/iconos/cargando.gif' style='width: 20px; height:20px;'/>");
  14.  
  15.    $.ajax({
  16.        url: "/ni_dispacher/imagenes.do",
  17.        data: "opt=subirImagen&"+post,
  18.        async:true,
  19.        contentType: "application/x-www-form-urlencoded;charset=UTF-8",
  20.        dataType: "json",
  21.        processData:true,
  22.        success: function(data){
  23.            if( data.response){
  24.  
  25.            }
  26.        },
  27.        error: function(data){
  28.            alert( "Ocurrió un error al procesar su solicitud. Intente nuevamente" );
  29.            $("#registrando").replaceWith( btguardar );
  30.        },
  31.        timeout: 180000,
  32.        type: "POST"
  33.    });
  34. }
  35.  

La duda es... como puedo agarrar la imagen en el js que está en el jsp para pasarlo al java??
La idea esque esto mande una petición ajax al servidor  para luego en el servidor hacer algo como:
(este archivo lleva por nombre imagenes.java)
Código
  1. private JSONObject subirImagen( HttpServletRequest request, Connection con ) throws Exception{
  2.          JSONObject json = new JSONObject();
  3.  
  4.          // recibir imagen
  5.          // conectarse por ftp al donde se subirán las imagenes
  6.          // verificar que las carpetas existan
  7.          // renombrar imagen
  8.          // etc....          
  9.  
  10.          json.put("response", true);
  11.          return json;
  12.     }
  13.  

Pero la verdad no se como pasar la imagen desde el jsp al java... alguna idea??

Si no me explico lo suficiente porfavor avisenme para tratar de ponerlo con otras palabras... de antemano agradezco la ayuda
2  Programación / Desarrollo Web / Fechas en JSP en: 17 Mayo 2012, 22:54 pm
Bueno ya tengo rato batallando con esto y la verdad no se cual es el problema espero ustedes me puedan ayudar.

La idea es la siguiente:
- Tener 2 fechas fecha_inicial y fecha_final
- La fecha_final = fecha actual
- La fecha_inicial = inicio de mes de dos meses antes de fecha_final

Ejemplo:
si la fecha actual es: 17/05/2012
entonces fecha_final = 17/05/2012
y fecha_inicial = 01/03/2012

osea en la fecha_final siempre será la actual y en fecha_inicial el día siempre será 01 el año será el mismo año de fecha_final y el mes será mes de la fecha_final menos 2

adicional a eso, me gustaría que la fecha tuviera el siguiente formato yyyymmdd donde yyyy=año, mm=mes y dd=día y eso para poderlo poner en un String. Alguna idea?? Alguien que me pueda orientar porfavor??
3  Programación / Desarrollo Web / Error al procesar la solicitud org.xml.sax.SAXParseExce en: 8 Mayo 2012, 19:23 pm
Buen día:

Les comento mi problema, estoy modificando un código ya existente (no hecho por mi) donde utilizo (me parece que es) iRepord para generar archivos pdf estaba funcionando bien (como muestro en la primera imagen). Pero al agregarle una nueva columna (como muestro en la segunda imagen) sale el siguiente error:

Citar
Ocurrió un error al procesar su solicitud org.xml.sax.SAXParseException: cvc-complex-type.2.4.d: Invalid content was found starting with element 'paragraph'. No child element is expected at this point.
net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException: cvc-complex-type.2.4.d: Invalid content was found starting with element 'paragraph'. No child element is expected at this point.





Para ser sincera no se que parte del código mostrarles, así que les muestro el que tengo actualmente (con errores)

Código
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Cierre de Remesa" pageWidth="612" pageHeight="792" whenNoDataType="AllSectionsNoDetail" columnWidth="572" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" whenResourceMissingType="Empty">
  3. <property name="ireport.zoom" value="1.098075000000002"/>
  4. <property name="ireport.x" value="212"/>
  5. <property name="ireport.y" value="0"/>
  6. <parameter name="rutalogo" class="java.lang.String"/>
  7. <parameter name="clavePersona" class="java.lang.String"/>
  8. <parameter name="folioCuenta" class="java.lang.String">
  9. <defaultValueExpression><![CDATA[]]></defaultValueExpression>
  10. </parameter>
  11. <parameter name="claveCuenta" class="java.lang.String">
  12. <defaultValueExpression><![CDATA[]]></defaultValueExpression>
  13. </parameter>
  14. <parameter name="claveBodega" class="java.lang.String">
  15. <defaultValueExpression><![CDATA[]]></defaultValueExpression>
  16. </parameter>
  17. <queryString>
  18. <![CDATA[SELECT
  19. adm_bodega.descripcion AS [bodega]
  20. ,CONVERT(VARCHAR(10), adm_movimientos_cuentas.fecha, 103) AS [fecha]
  21. ,CONVERT(VARCHAR(10), adm_movimientos_cuentas.vence_documento, 103) AS [fechaExp]
  22. ,adm_movimientos_cuentas.folio_documento AS [foliodocumento]
  23. ,ISNULL(adm_movimientos_cuentas.serie_documento,'') AS [seriedocumento]
  24. ,CASE adm_movimientos_cuentas.tipo_documento WHEN 9 THEN 'Comprobante Digital' ELSE 'Factura' END AS [tipodocumento]
  25. ,RTRIM(ISNULL(adm_movimientos_cuentas.nota,'')) AS [nota]
  26. ,RTRIM( ISNULL(CAST(adm_movimientos_cuentas_detalle.clave_articulo AS varchar), ISNULL(adm_movimientos_cuentas_detalle.descripcion,'') ) ) AS [articulo]
  27. ,adm_movimientos_cuentas_detalle.cantidad AS [cantidad]
  28. ,adm_movimientos_cuentas_detalle.contrato AS [contrato]
  29. ,ROUND(adm_movimientos_cuentas_detalle.importe-adm_movimientos_cuentas_detalle.iva,2) AS [unitario]
  30. ,ROUND(adm_movimientos_cuentas.iva,2) AS [iva]
  31. FROM
  32. adm_movimientos_cuentas
  33. INNER JOIN adm_movimientos_cuentas_detalle
  34. ON adm_movimientos_cuentas.folio_cuenta = adm_movimientos_cuentas_detalle.folio_cuenta
  35. AND adm_movimientos_cuentas.clave_cuenta = adm_movimientos_cuentas_detalle.clave_cuenta
  36. AND adm_movimientos_cuentas.bodega_registro = adm_movimientos_cuentas_detalle.clave_bodega
  37. INNER JOIN adm_bodega ON adm_movimientos_cuentas.bodega_registro = adm_bodega.clave_bodega
  38. WHERE
  39. adm_movimientos_cuentas.clave_asignado_a =  $P{clavePersona}
  40. AND adm_movimientos_cuentas.folio_cuenta = $P{folioCuenta}
  41. AND adm_movimientos_cuentas.clave_cuenta = $P{claveCuenta}
  42. AND adm_movimientos_cuentas.bodega_registro = $P{claveBodega}]]>
  43. </queryString>
  44. <field name="bodega" class="java.lang.String"/>
  45. <field name="fecha" class="java.lang.String"/>
  46. <field name="fechaExp" class="java.lang.String"/>
  47. <field name="foliodocumento" class="java.lang.Long"/>
  48. <field name="seriedocumento" class="java.lang.String"/>
  49. <field name="tipodocumento" class="java.lang.String"/>
  50. <field name="nota" class="java.lang.String"/>
  51. <field name="articulo" class="java.lang.String"/>
  52. <field name="cantidad" class="java.lang.Integer"/>
  53. <field name="contrato" class="java.lang.String"/>
  54. <field name="unitario" class="java.math.BigDecimal"/>
  55. <field name="iva" class="java.math.BigDecimal"/>
  56. <variable name="totalContratos" class="java.lang.Integer" resetType="Page" calculation="Count">
  57. <variableExpression><![CDATA[]]></variableExpression>
  58. </variable>
  59. <variable name="subtotal_1" class="java.lang.Double" calculation="Sum">
  60. <variableExpression><![CDATA[$F{unitario}.doubleValue()]]></variableExpression>
  61. </variable>
  62. <variable name="iva_1" class="java.lang.Double">
  63. <variableExpression><![CDATA[$F{iva}.doubleValue()]]></variableExpression>
  64. </variable>
  65. <background>
  66. <band splitType="Stretch"/>
  67. </background>
  68. <title>
  69. <band height="55" splitType="Stretch">
  70. <textField>
  71. <reportElement mode="Opaque" x="105" y="0" width="467" height="55" forecolor="#FFFF00" backcolor="#1818B4"/>
  72. <textElement textAlignment="Center" verticalAlignment="Middle">
  73. <font fontName="Arial" size="20" isBold="true"/>
  74. </textElement>
  75. <textFieldExpression><![CDATA["Factura"]]></textFieldExpression>
  76. </textField>
  77. <image scaleImage="FillFrame" hAlign="Center" vAlign="Middle">
  78. <reportElement x="0" y="0" width="105" height="55"/>
  79. <imageExpression><![CDATA[$P{rutalogo}]]></imageExpression>
  80. </image>
  81. </band>
  82. </title>
  83. <pageHeader>
  84. <band height="135" splitType="Stretch">
  85. <staticText>
  86. <reportElement x="19" y="15" width="536" height="18"/>
  87. <textElement verticalAlignment="Middle">
  88. <font fontName="Arial" isBold="true" pdfFontName="" isPdfEmbedded="true"/>
  89. </textElement>
  90. <text><![CDATA[Datos De Factura]]></text>
  91. </staticText>
  92. <staticText>
  93. <reportElement x="19" y="35" width="54" height="18"/>
  94. <textElement verticalAlignment="Middle">
  95. <font fontName="Arial" isBold="true"/>
  96. </textElement>
  97. <text><![CDATA[Folio:]]></text>
  98. </staticText>
  99. <staticText>
  100. <reportElement x="331" y="35" width="54" height="18"/>
  101. <textElement verticalAlignment="Middle">
  102. <font fontName="Arial" isBold="true"/>
  103. </textElement>
  104. <text><![CDATA[Serie:]]></text>
  105. </staticText>
  106. <textField>
  107. <reportElement x="385" y="35" width="170" height="18"/>
  108. <box leftPadding="5">
  109. <bottomPen lineWidth="1.0"/>
  110. </box>
  111. <textElement verticalAlignment="Middle">
  112. <font fontName="Arial"/>
  113. </textElement>
  114. <textFieldExpression><![CDATA[$F{seriedocumento}]]></textFieldExpression>
  115. </textField>
  116. <textField>
  117. <reportElement x="73" y="35" width="136" height="18"/>
  118. <box leftPadding="5">
  119. <bottomPen lineWidth="1.0"/>
  120. </box>
  121. <textElement verticalAlignment="Middle">
  122. <font fontName="Arial"/>
  123. </textElement>
  124. <textFieldExpression><![CDATA[$F{foliodocumento}]]></textFieldExpression>
  125. </textField>
  126. <staticText>
  127. <reportElement x="19" y="55" width="54" height="18"/>
  128. <textElement verticalAlignment="Middle">
  129. <font fontName="Arial" isBold="true"/>
  130. </textElement>
  131. <text><![CDATA[Fecha:]]></text>
  132. </staticText>
  133. <textField>
  134. <reportElement x="73" y="53" width="136" height="18"/>
  135. <box leftPadding="5">
  136. <bottomPen lineWidth="1.0"/>
  137. </box>
  138. <textElement verticalAlignment="Middle">
  139. <font fontName="Arial"/>
  140. </textElement>
  141. <textFieldExpression><![CDATA[$F{fecha}]]></textFieldExpression>
  142. </textField>
  143. <staticText>
  144. <reportElement x="331" y="55" width="54" height="18"/>
  145. <textElement verticalAlignment="Middle">
  146. <font fontName="Arial" isBold="true"/>
  147. </textElement>
  148. <text><![CDATA[Tipo:]]></text>
  149. </staticText>
  150. <textField>
  151. <reportElement x="385" y="55" width="170" height="18"/>
  152. <box leftPadding="5">
  153. <bottomPen lineWidth="1.0"/>
  154. </box>
  155. <textElement verticalAlignment="Middle">
  156. <font fontName="Arial"/>
  157. </textElement>
  158. <textFieldExpression><![CDATA[$F{tipodocumento}]]></textFieldExpression>
  159. </textField>
  160. <staticText>
  161. <reportElement x="19" y="96" width="54" height="18"/>
  162. <textElement verticalAlignment="Middle">
  163. <font fontName="Arial" isBold="true"/>
  164. </textElement>
  165. <text><![CDATA[Bodega:]]></text>
  166. </staticText>
  167. <textField>
  168. <reportElement x="73" y="96" width="482" height="18"/>
  169. <box leftPadding="5">
  170. <bottomPen lineWidth="1.0"/>
  171. </box>
  172. <textElement verticalAlignment="Middle">
  173. <font fontName="Arial"/>
  174. </textElement>
  175. <textFieldExpression><![CDATA[$F{bodega}]]></textFieldExpression>
  176. </textField>
  177. <textField>
  178. <reportElement x="73" y="117" width="482" height="18"/>
  179. <box leftPadding="5">
  180. <bottomPen lineWidth="1.0"/>
  181. </box>
  182. <textElement verticalAlignment="Middle">
  183. <font fontName="Arial"/>
  184. </textElement>
  185. <textFieldExpression><![CDATA[$F{nota}]]></textFieldExpression>
  186. </textField>
  187. <staticText>
  188. <reportElement x="19" y="117" width="54" height="18"/>
  189. <textElement verticalAlignment="Middle">
  190. <font fontName="Arial" isBold="true"/>
  191. </textElement>
  192. <text><![CDATA[Nota:]]></text>
  193. </staticText>
  194. <textField pattern="" isBlankWhenNull="true">
  195. <reportElement mode="Transparent" x="127" y="73" width="100" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
  196. <box leftPadding="5">
  197. <bottomPen lineWidth="1.0"/>
  198. </box>
  199. <textElement textAlignment="Left" verticalAlignment="Middle" rotation="None" markup="none">
  200. <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
  201. <paragraph lineSpacing="Single"/>
  202. </textElement>
  203. <textFieldExpression><![CDATA[$F{fechaExp}]]></textFieldExpression>
  204. </textField>
  205. <staticText>
  206. <reportElement x="19" y="75" width="109" height="18"/>
  207. <textElement verticalAlignment="Middle">
  208. <font fontName="Arial" isBold="true"/>
  209. </textElement>
  210. <text><![CDATA[Fecha de expiración:]]></text>
  211. </staticText>
  212. </band>
  213. </pageHeader>
  214. <columnHeader>
  215. <band height="20" splitType="Stretch">
  216. <staticText>
  217. <reportElement mode="Opaque" x="28" y="0" width="206" height="20" forecolor="#FFFFFF" backcolor="#1818B4"/>
  218. <box>
  219. <pen lineWidth="1.0" lineColor="#000000"/>
  220. <topPen lineWidth="1.0" lineColor="#000000"/>
  221. <leftPen lineWidth="1.0" lineColor="#000000"/>
  222. <bottomPen lineWidth="1.0" lineColor="#000000"/>
  223. <rightPen lineWidth="1.0" lineColor="#000000"/>
  224. </box>
  225. <textElement textAlignment="Center" verticalAlignment="Middle">
  226. <font fontName="Arial" isBold="true"/>
  227. </textElement>
  228. <text><![CDATA[Descripción:]]></text>
  229. </staticText>
  230. <staticText>
  231. <reportElement mode="Opaque" x="234" y="0" width="60" height="20" forecolor="#FFFFFF" backcolor="#1818B4"/>
  232. <box>
  233. <pen lineWidth="1.0" lineColor="#000000"/>
  234. <topPen lineWidth="1.0" lineColor="#000000"/>
  235. <leftPen lineWidth="1.0" lineColor="#000000"/>
  236. <bottomPen lineWidth="1.0" lineColor="#000000"/>
  237. <rightPen lineWidth="1.0" lineColor="#000000"/>
  238. </box>
  239. <textElement textAlignment="Center" verticalAlignment="Middle">
  240. <font fontName="Arial" isBold="true"/>
  241. </textElement>
  242. <text><![CDATA[Cantidad]]></text>
  243. </staticText>
  244. <staticText>
  245. <reportElement mode="Opaque" x="294" y="0" width="80" height="20" forecolor="#FFFFFF" backcolor="#1818B4"/>
  246. <box>
  247. <pen lineWidth="1.0" lineColor="#000000"/>
  248. <topPen lineWidth="1.0" lineColor="#000000"/>
  249. <leftPen lineWidth="1.0" lineColor="#000000"/>
  250. <bottomPen lineWidth="1.0" lineColor="#000000"/>
  251. <rightPen lineWidth="1.0" lineColor="#000000"/>
  252. </box>
  253. <textElement textAlignment="Center" verticalAlignment="Middle">
  254. <font fontName="Arial" isBold="true"/>
  255. </textElement>
  256. <text><![CDATA[Contrato]]></text>
  257. </staticText>
  258. <staticText>
  259. <reportElement mode="Opaque" x="374" y="0" width="100" height="20" forecolor="#FFFFFF" backcolor="#1818B4"/>
  260. <box>
  261. <pen lineWidth="1.0" lineColor="#000000"/>
  262. <topPen lineWidth="1.0" lineColor="#000000"/>
  263. <leftPen lineWidth="1.0" lineColor="#000000"/>
  264. <bottomPen lineWidth="1.0" lineColor="#000000"/>
  265. <rightPen lineWidth="1.0" lineColor="#000000"/>
  266. </box>
  267. <textElement textAlignment="Center" verticalAlignment="Middle">
  268. <font fontName="Arial" isBold="true"/>
  269. </textElement>
  270. <text><![CDATA[Unitario]]></text>
  271. </staticText>
  272. <staticText>
  273. <reportElement mode="Opaque" x="474" y="0" width="100" height="20" forecolor="#FFFFFF" backcolor="#1818B4"/>
  274. <box>
  275. <pen lineWidth="1.0" lineColor="#000000"/>
  276. <topPen lineWidth="1.0" lineColor="#000000"/>
  277. <leftPen lineWidth="1.0" lineColor="#000000"/>
  278. <bottomPen lineWidth="1.0" lineColor="#000000"/>
  279. <rightPen lineWidth="1.0" lineColor="#000000"/>
  280. </box>
  281. <textElement textAlignment="Center" verticalAlignment="Middle">
  282. <font fontName="Arial" isBold="true"/>
  283. </textElement>
  284. <text><![CDATA[Importe]]></text>
  285. </staticText>
  286. </band>
  287. </columnHeader>
  288. <detail>
  289. <band height="18" splitType="Stretch">
  290. <textField>
  291. <reportElement x="28" y="0" width="206" height="18"/>
  292. <box leftPadding="5" rightPadding="0">
  293. <topPen lineWidth="1.0"/>
  294. <leftPen lineWidth="1.0"/>
  295. <bottomPen lineWidth="1.0"/>
  296. <rightPen lineWidth="1.0"/>
  297. </box>
  298. <textElement textAlignment="Left" verticalAlignment="Middle">
  299. <font fontName="Arial"/>
  300. </textElement>
  301. <textFieldExpression><![CDATA[$F{articulo}]]></textFieldExpression>
  302. </textField>
  303. <textField>
  304. <reportElement x="234" y="0" width="60" height="18"/>
  305. <box rightPadding="0">
  306. <topPen lineWidth="1.0"/>
  307. <leftPen lineWidth="1.0"/>
  308. <bottomPen lineWidth="1.0"/>
  309. <rightPen lineWidth="1.0"/>
  310. </box>
  311. <textElement textAlignment="Center" verticalAlignment="Middle">
  312. <font fontName="Arial"/>
  313. </textElement>
  314. <textFieldExpression><![CDATA[$F{cantidad}]]></textFieldExpression>
  315. </textField>
  316. <textField>
  317. <reportElement x="294" y="0" width="80" height="18"/>
  318. <box rightPadding="0">
  319. <topPen lineWidth="1.0"/>
  320. <leftPen lineWidth="1.0"/>
  321. <bottomPen lineWidth="1.0"/>
  322. <rightPen lineWidth="1.0"/>
  323. </box>
  324. <textElement textAlignment="Center" verticalAlignment="Middle">
  325. <font fontName="Arial"/>
  326. </textElement>
  327. <textFieldExpression><![CDATA[$F{contrato}]]></textFieldExpression>
  328. </textField>
  329. <textField>
  330. <reportElement x="374" y="0" width="100" height="18"/>
  331. <box rightPadding="5">
  332. <topPen lineWidth="1.0"/>
  333. <leftPen lineWidth="1.0"/>
  334. <bottomPen lineWidth="1.0"/>
  335. <rightPen lineWidth="1.0"/>
  336. </box>
  337. <textElement textAlignment="Right" verticalAlignment="Middle">
  338. <font fontName="Arial"/>
  339. </textElement>
  340. <textFieldExpression><![CDATA[new DecimalFormat("###,##0.00",
  341.    new DecimalFormatSymbols(
  342.        new Locale("es","MX")
  343.    )
  344. ).format( $F{unitario}.doubleValue() /$F{cantidad}.doubleValue())]]></textFieldExpression>
  345. </textField>
  346. <textField>
  347. <reportElement x="474" y="0" width="100" height="18"/>
  348. <box rightPadding="5">
  349. <topPen lineWidth="1.0"/>
  350. <leftPen lineWidth="1.0"/>
  351. <bottomPen lineWidth="1.0"/>
  352. <rightPen lineWidth="1.0"/>
  353. </box>
  354. <textElement textAlignment="Right" verticalAlignment="Middle">
  355. <font fontName="Arial"/>
  356. </textElement>
  357. <textFieldExpression><![CDATA[new DecimalFormat("###,##0.00",
  358.    new DecimalFormatSymbols(
  359.        new Locale("es","MX")
  360.    )
  361. ).format( $F{unitario}.doubleValue())]]></textFieldExpression>
  362. </textField>
  363. <textField>
  364. <reportElement x="0" y="0" width="28" height="18"/>
  365. <box rightPadding="0">
  366. <topPen lineWidth="1.0"/>
  367. <leftPen lineWidth="1.0"/>
  368. <bottomPen lineWidth="1.0"/>
  369. <rightPen lineWidth="1.0"/>
  370. </box>
  371. <textElement textAlignment="Center" verticalAlignment="Middle">
  372. <font fontName="Arial"/>
  373. </textElement>
  374. <textFieldExpression><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression>
  375. </textField>
  376. </band>
  377. </detail>
  378. <columnFooter>
  379. <band height="16" splitType="Stretch"/>
  380. </columnFooter>
  381. <pageFooter>
  382. <band height="49" splitType="Stretch">
  383. <line>
  384. <reportElement x="0" y="20" width="572" height="1"/>
  385. </line>
  386. <textField>
  387. <reportElement x="7" y="1" width="387" height="20"/>
  388. <textElement/>
  389. <textFieldExpression><![CDATA["Documento generado el "
  390. +new SimpleDateFormat("EEEEEEEEE, dd/MM/yyyy", new Locale("es","MX") ).format(new Date())]]></textFieldExpression>
  391. </textField>
  392. <staticText>
  393. <reportElement x="5" y="21" width="567" height="20"/>
  394. <textElement/>
  395. <text><![CDATA[Códice. Av. Ventura Puente 846 Col. Ventura Puente Morelia C.P. 58020 Michoacán, México]]></text>
  396. </staticText>
  397. <textField>
  398. <reportElement x="399" y="0" width="126" height="20"/>
  399. <textElement textAlignment="Right"/>
  400. <textFieldExpression><![CDATA["Página "+$V{PAGE_NUMBER}+" de"]]></textFieldExpression>
  401. </textField>
  402. <textField evaluationTime="Report">
  403. <reportElement x="525" y="0" width="40" height="20"/>
  404. <textElement/>
  405. <textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
  406. </textField>
  407. </band>
  408. </pageFooter>
  409. <summary>
  410. <band height="60" splitType="Stretch">
  411. <textField>
  412. <reportElement x="399" y="0" width="75" height="20"/>
  413. <textElement textAlignment="Right" verticalAlignment="Middle"/>
  414. <textFieldExpression><![CDATA["Subtotal: "]]></textFieldExpression>
  415. </textField>
  416. <textField>
  417. <reportElement x="399" y="20" width="75" height="20"/>
  418. <textElement textAlignment="Right" verticalAlignment="Middle"/>
  419. <textFieldExpression><![CDATA["I.V.A.: "]]></textFieldExpression>
  420. </textField>
  421. <textField>
  422. <reportElement x="474" y="1" width="98" height="19"/>
  423. <box rightPadding="5"/>
  424. <textElement textAlignment="Right" verticalAlignment="Middle">
  425. <font fontName="Arial"/>
  426. </textElement>
  427. <textFieldExpression><![CDATA[new DecimalFormat("###,##0.00",
  428.    new DecimalFormatSymbols(
  429.        new Locale("es","MX")
  430.    )
  431. ).format( $V{subtotal_1}.doubleValue() )]]></textFieldExpression>
  432. </textField>
  433. <textField>
  434. <reportElement x="399" y="40" width="75" height="20"/>
  435. <textElement textAlignment="Right" verticalAlignment="Middle"/>
  436. <textFieldExpression><![CDATA["Total: "]]></textFieldExpression>
  437. </textField>
  438. <textField>
  439. <reportElement x="474" y="20" width="98" height="20"/>
  440. <box rightPadding="5"/>
  441. <textElement textAlignment="Right" verticalAlignment="Middle">
  442. <font fontName="Arial"/>
  443. </textElement>
  444. <textFieldExpression><![CDATA[new DecimalFormat("###,##0.00",
  445.    new DecimalFormatSymbols(
  446.        new Locale("es","MX")
  447.    )
  448. ).format( $V{iva_1}.doubleValue() )]]></textFieldExpression>
  449. </textField>
  450. <textField>
  451. <reportElement x="474" y="40" width="98" height="20"/>
  452. <box rightPadding="5"/>
  453. <textElement textAlignment="Right" verticalAlignment="Middle">
  454. <font fontName="Arial"/>
  455. </textElement>
  456. <textFieldExpression><![CDATA[new DecimalFormat("###,##0.00",
  457.    new DecimalFormatSymbols(
  458.        new Locale("es","MX")
  459.    )
  460. ).format( $V{iva_1}.doubleValue() + $V{subtotal_1}.doubleValue() )]]></textFieldExpression>
  461. </textField>
  462. </band>
  463. </summary>
  464. </jasperReport>
4  Programación / Desarrollo Web / Menú desplegable HTML + CSS + JQuery (ayuda) en: 20 Enero 2012, 07:32 am
Buen día.

Buscando en Google sobre este tema me encontré un tutorial muy bueno d como hacer esto, donde básicamente el código es el siguiente:

HTML
Código:
        <div class="menu">
            <ul>
                <li><a href="#">Menú 1</a>
                    <ul>
                        <li><a href="#">Menú 1.1</a>
                            <ul>
                                <li><a href="#">Menú 1.1.1</a></li>
                                <li><a href="#">Menú 1.1.2</a></li>
                            </ul>
                        </li>
                        <li><a href="#">Menú 1.2</a>
                            <ul>
                                <li><a href="#">Menú 1.2.1</a></li>
                                <li><a href="#">Menú 1.2.2</a></li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li><a href="#">Menú 2</a>
                    <ul>
                        <li><a href="#">Menú 2.1</a>
                            <ul>
                                <li><a href="#">Menú 2.1.1</a></li>
                                <li><a href="#">Menú 2.1.2</a></li>
                            </ul>
                        </li>
                        <li><a href="#">Menú 2.2</a>
                            <ul>
                                <li><a href="#">Menú 2.2.1</a></li>
                                <li><a href="#">Menú 2.2.2</a></li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li><a href="#">Menú 3</a></li>
                <li><a href="#">Menú 4</a></li>
            </ul>
        </div>

CSS
Código:
        <style>
            .menu ul {
                list-style: none;
                padding: 0;
            }
            
            .menu a {
                display: block;
                width: 150px;
                height: 20px;
                background: red;
                color: white;
                text-decoration: none;
                text-align: center;
            }
            
            .menu a:hover {
                background: green;
            }
            
            .menu li li a {
                background: blue;
            }      
        </style>

JQuery
Código:
        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script>
        <script>
            $(document).ready(function() {
                $('.menu ul ul').css({
                    display:"none"
                });
      
                $('.menu li').hover(function(){
                    $(this).find('> ul').stop(true, true).slideDown('slow');
                }, function(){
                    $(this).find('> ul').stop(true, true).slideUp('slow');
                });
            });
        </script>

Todo eso me deja el menú de la siguiente manera (suponiendo q está desplegado por completo):

Menú 1
Menú 1.1
Menú 1.1.1
Menú 1.1.2
Menú 1.2
Menú 1.2.1
Menú 1.2.2

Menú 2
Menú 2.1
Menú 2.1.1
Menú 2.1.2
Menú 2.2
Menú 2.2.1
Menú 2.2.2

Menú 3
Menú 4


Pero lo que yo deseo es que quede de la siguiente manera (suponiendo q está desplegado por completo):

Menú 1      | Menú 2    | Menú 3 | Menú 4
Menú 1.1      Menú 2.1
Menú 1.1.1   Menú 2.1.1
Menú 1.1.2   Menú 2.1.2
Menú 1.2      Menú 2.2
Menú 1.2.1   Menú 2.2.1
Menú 1.2.2   Menú 2.2.2


En otras palabras... solo q el primer nivel del menú se encuentre horizontal y los demás q sean verticales.

Desde ahora agradezco su ayuda.

Editando: Lo lamento, envíe sin querer el post incompleto
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines