Jump to content
Changes to the Jaspersoft community edition download ×

bhooppandra_jat

Members
  • Posts

    1
  • Joined

  • Last visited

bhooppandra_jat's Achievements

Newbie

Newbie (1/14)

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

Recent Badges

0

Reputation

  1. Hi, Please used the below mentioned code for Image Displaying. Please pass the argument with image name. Parameter name is "IMAGE_DIR". HashMap<String,Object> jasperParameter = new HashMap<String,Object>(); jasperParameter.put("SUBREPORT_DIR",jrxmlSourceLocation); jasperParameter.put("IMAGE_DIR",ImageDir); if(reportFormat.equalsIgnoreCase(ReportConstansts.FORMAT_HTML) || reportFormat.equalsIgnoreCase(ReportConstansts.FORMAT_EXCEL)){ jasperParameter.put(JRParameter.IS_IGNORE_PAGINATION, Boolean.TRUE); } File fname = new File(destinationPath + FILE_SEPARATOR + filename+ReportConstansts.EXCEL_EXT); JRXlsExporter jRXlsExporter = new JRXlsExporter(); jRXlsExporter.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE); jRXlsExporter.setParameter(JRXlsExporterParameter.IS_IGNORE_CELL_BORDER,Boolean.TRUE); jRXlsExporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET,Boolean.FALSE); jRXlsExporter.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,Boolean.TRUE); jRXlsExporter.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS,Boolean.TRUE); jRXlsExporter.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE,Boolean.TRUE); jRXlsExporter.setParameter(JRXlsExporterParameter.OFFSET_X,0); jRXlsExporter.setParameter(JRXlsExporterParameter.OFFSET_Y,0); jRXlsExporter.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE,Boolean.TRUE); jRXlsExporter.setParameter(JRXlsExporterParameter.JASPER_PRINT_LIST, jprintlist); jRXlsExporter.setParameter(JRXlsExporterParameter.SHEET_NAMES,ReportConstansts.TAB_NAMES); jRXlsExporter.setParameter(JRXlsExporterParameter.OUTPUT_FILE_NAME,fname.toString()); try { jRXlsExporter.exportReport(); } catch (JRException ex) { logger.log(ILogger.LEVEL_SEVERE,"Exception occured while exporting the JasperReport:"+ex.getMessage(),null,ex); } Thanks, Bhooppandra Code:<?xml version="1.0" encoding="UTF-8"?><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="Topology" language="groovy" pageWidth="650" pageHeight="750" columnWidth="0" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <parameter name="IMAGE_DIR" class="java.lang.String"/> <background> <band splitType="Stretch"/> </background> <title> <band splitType="Stretch"/> </title> <pageHeader> <band splitType="Stretch"/> </pageHeader> <columnHeader> <band height="30" splitType="Stretch"/> </columnHeader> <detail> <band height="650" splitType="Stretch"> <image isLazy="true" scaleImage="RealHeight"> <reportElement x="0" y="0" width="500" height="650"/> <imageExpression><![CDATA[$P{IMAGE_DIR}]]></imageExpression> </image> </band> </detail> <columnFooter> <band splitType="Stretch"/> </columnFooter> <pageFooter> <band splitType="Stretch"/> </pageFooter> <summary> <band splitType="Stretch"/> </summary></jasperReport>
×
×
  • Create New...