Jump to content
We've recently updated our Privacy Statement, available here ×

kamran21754_1

Members
  • Posts

    2
  • Joined

  • Last visited

kamran21754_1'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. Changed Resolution from Open to Fixed Changed Assigned User from - to @kamran I have been able to extend JRXlsExporter.java to provide my own implementation that utilizes Apache POI library in order to accomplish the this. You can further add more formatting details to it according to your needs. In addition to that you can configure your jrxml by adding the following custom property.Jasper Report jrxml Custom Property:I also introduce a new feature to Jasper Report 5.0.1 with the following custom custom property for repeating rows. Following line needs to be added to each Jasper report that needs to have repeating rows, if we don’t add the following line then I have already introduced the default to be 2:4 repeating rows. property name="net.sf.jasperreports.export.xls.repeating.rows.range" value="1:4"
  2. IntroductionI have been able to extend JRXlsExporter.java to provide my own implementation that utilizes Apache POI library. You can further add more formatting details to it according to your needs. In addition, you can configure your jrxml by adding the following custom property. Jasper Report jrxml Custom Property:I also introduce a new feature to JasperReports v5.0.1 with the following custom property for repeating rows. The following line needs to be added to each Jasper report that needs to have repeating rows, if we don’t add the following line then I have already introduced the default to be 2:4 repeating rows. <property name="net.sf.jasperreports.export.xls.repeating.rows.range" value="1:4" />[/code]Please let me know if you need additional details Modified JRXlsExporter.java/*** @author ANWAR_K** This is a custom implementation of JRXlsExporter class that allows* for providing custom JRXlsExporter implementation in order to provide* extra features that is not supported by the default JRXlsExporter class.*/package osh.bls.gov.jasperreports.engine.export;import org.apache.poi.ss.util.CellRangeAddress;import net.sf.jasperreports.engine.JRPropertiesUtil;import net.sf.jasperreports.engine.JasperReportsContext;import net.sf.jasperreports.engine.export.JRXlsExporter;public class CustomJRXlsExporter extends JRXlsExporter { /** * Custom Property used to store the range of repeating rows for the sheet. */ public static final String PROPERTY_REPEATING_ROWS_RANGE = JRPropertiesUtil.PROPERTY_PREFIX + "export.xls.repeating.rows.range"; /** * */ public CustomJRXlsExporter() { super(); } /** * @param jasperReportsContext */ public CustomJRXlsExporter(JasperReportsContext jasperReportsContext) { super(jasperReportsContext); } /** * @param name */ protected void createSheet(String name) { super.createSheet(name); // Set the rows to repeat from range1 to range2 on the first sheet. String repeatingRowsRange = getPropertiesUtil().getProperty(jasperPrint, PROPERTY_REPEATING_ROWS_RANGE) == null ? "2:4" : getPropertiesUtil().getProperty(jasperPrint, PROPERTY_REPEATING_ROWS_RANGE); sheet.setRepeatingRows(CellRangeAddress.valueOf(repeatingRowsRange)); }}[/code]
×
×
  • Create New...