Package net.sf.jasperreports.engine.export.data

Examples of net.sf.jasperreports.engine.export.data.TextValueHandler


    {
      sheetHelper.exportHyperlink(rowIndex, colIndex, href);
    }

   
    TextValueHandler handler =
      new TextValueHandler()
      {
        public void handle(BooleanTextValue textValue) throws JRException {
          writeText();
        }
       
        public void handle(DateTextValue textValue) throws JRException {
          Date date = textValue.getValue();
          sheetHelper.write(
            "<v>"
            + (date == null ? "" : JRDataUtils.getExcelSerialDayNumber(
              date,
              getTextLocale(text),
              getTextTimeZone(text)
              ))
            + "</v>"
            );
        }
       
        public void handle(NumberTextValue textValue) throws JRException {
          Number number = textValue.getValue();
          sheetHelper.write(
            "<v>"
            + (number == null ? "" : number)
            + "</v>"
            );
        }
       
        public void handle(StringTextValue textValue) throws JRException {
          writeText();
        }
       
        private void writeText() throws JRException {
          sheetHelper.write("<is>");//FIXMENOW make writer util; check everywhere
 
          if (textLength > 0)
          {
            exportStyledText(text.getStyle(), styledText, getTextLocale(text));
          }
 
          sheetHelper.write("</is>");
        }
      };
   
    if (textValue != null)
    {
      //detect cell type
      textValue.handle(handler);
    }
    else
    {
      handler.handle((StringTextValue)null);
    }
   
    sheetHelper.flush();

    cellHelper.exportFooter();
View Full Code Here


    }

    if (isDetectCellType)
    {
      TextValue value = getTextValue(textElement, textStr);
      value.handle(new TextValueHandler()
      {
        public void handle(StringTextValue textValue)
        {
          HSSFCellStyle cellStyle = initCreateCell(gridCell, colIndex, rowIndex, baseStyle);
          if (JRCommonText.MARKUP_NONE.equals(textElement.getMarkup()))
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.export.data.TextValueHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.