Jump to content

hihaji4222

Members
  • Posts

    1
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

hihaji4222's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Estoy preparando un informe en JasperSoft Studio usando un JSON como origen de datos, que contiene una matriz al final de la última clave del objeto, con las claves del JSONObject, relleno la banda de detalles del informe y con la otra matriz, relleno una tabla en la banda Resumen, en JasperSoft Studio genera correctamente el informe genera el informe , al generar el informe en código Java utilizando Java 8 utilizando NetBeans como entorno IDE, el informe sólo genera una sola fila con valores Null y no muestra la tabla, adjunto las imágenes y el código Java. El JSON contiene la siguiente estructura: { "0": { "a": "datos1", "b": "M-datos2", "c": "datos3", "d": "datos4", "e": "datos5", "f": "datos6", "g": "2", "h": "datos7", "i": "$5,000.00", "j": "$0.00", "k": "$0.00", "l": "5000.00", "m": "datos8" }, "1": { "a": "datos1", "b": "M-datos2", "c": "datos3", "d": "datos4", "e": "datos5", "f": "datos6", "g": "2", "h": "datos7", "i": "$5,000.00", "j": "$0.00", "k": "$0.00", "l": "5000.00", "m": "datos8" }, "2": { "a": "datos1", "b": "M-datos2", "c": "datos3", "d": "datos4", "e": "datos5", "f": "datos6", "g": "2", "h": "datos7", "i": "$5,000.00", "j": "$0.00", "k": "$0.00", "l": "5000.00", "m": "datos8" }, "3": { "a": "datos1", "b": "M-datos2", "c": "datos3", "d": "datos4", "e": "datos5", "f": "datos6", "g": "2", "h": "datos7", "i": "$5,000.00", "j": "$0.00", "k": "$0.00", "l": "5000.00", "m": "datos8" }, "4": { "a": "datos1", "b": "M-datos2", "c": "datos3", "d": "datos4", "e": "datos5", "f": "datos6", "g": "2", "h": "datos7", "i": "$5,000.00", "j": "$0.00", "k": "$0.00", "l": "5000.00", "m": "datos8", "sub-totales": [ { "n-mes": "10", "sub-total": "13200.00" } ] }}JasperSoft Studio genera correctamente la siguiente imagen en su versión 6.15.0 /sites/default/files/user_uploads/hihaji4222/captura_de_pantalla_2020-10-24_114044.png Annex image of the report generated in Java 8 using NetBeans 8.2, where it only shows null values and does not show the table, using the same JSON data source Annex Java code using to generate the report: InputStream is; is = getClass().getResourceAsStream("/REPORTS/report.jasper"); Map parameters = new HashMap(); parameters.put("IMAGE", IMAGE); parameters.put("BACKG", BACKG); ByteArrayInputStream jsonDataStream = new ByteArrayInputStream(JSON.toString().getBytes()); JRDataSource ds = new JsonQLDataSource(jsonDataStream); JasperReport jr = (JasperReport) JRLoader.loadObject(is); JasperPrint jp = JasperFillManager.fillReport(jr, parameters, ds); JasperViewer jv = new JasperViewer(jp, false); jv.setVisible(true);I have updated the Java libraries to their latest version but it still doesn't work, I would appreciate your help
×
×
  • Create New...