Class XLSXCreator

java.lang.Object
com.nomagic.magicreport.format.html.AbstractDocumentCreator
com.nomagic.magicreport.format.html.XLSXCreator
All Implemented Interfaces:
IHTMLHandler, IDocumentCreator

@OpenApiAll public class XLSXCreator extends AbstractDocumentCreator implements IHTMLHandler
The class use for create Html to XLSX content.
Since:
Feb 9, 2010
  • Constructor Details

    • XLSXCreator

      public XLSXCreator()
  • Method Details

    • convert

      public void convert(Reader reader, Writer writer) throws IOException
      Convert the HTML content from reader into XLSX document.
      Specified by:
      convert in interface IDocumentCreator
      Parameters:
      reader - the reader containing HTML source.
      writer - the writer containing XLSX document.
      Throws:
      IOException - If any IO errors occur.
      See Also:
    • startTag

      public void startTag(HTML.Tag tag, AttributeSet attributes)
      Receive notification of the start of a tag.
      Specified by:
      startTag in interface IHTMLHandler
      Parameters:
      tag - HTML tag
      attributes - The attributes attached to the tag. If there are no attributes, it shall be an empty Attributes object.
    • endTag

      public void endTag(HTML.Tag tag)
      Receive notification of the end of a tag.
      Specified by:
      endTag in interface IHTMLHandler
      Parameters:
      tag - HTML tag
    • characters

      public void characters(char[] data)
      Receive notification of character data inside a tag.
      Specified by:
      characters in interface IHTMLHandler
      Parameters:
      data - The characters.
    • endDocument

      public void endDocument()
      Receive notification of end document tag.
      Specified by:
      endDocument in interface IHTMLHandler
      See Also:
    • setPaperHeight

      public void setPaperHeight(float h)
      set paper height.
      Specified by:
      setPaperHeight in interface IDocumentCreator
      Parameters:
      h - paper height.
      See Also:
    • setPaperWidth

      public void setPaperWidth(float w)
      set paper width.
      Specified by:
      setPaperWidth in interface IDocumentCreator
      Parameters:
      w - paper width.
      See Also:
    • comment

      public void comment(char[] data)
      Description copied from interface: IHTMLHandler
      Receive notification of comment data.
      Specified by:
      comment in interface IHTMLHandler
      Parameters:
      data - An array holding the characters in the document.
    • getXLSXColor

      public String getXLSXColor(String color)
      Get color code.
      Parameters:
      color - color
      Returns:
      color
    • getXLSXFontSize

      public String getXLSXFontSize(String size)
      Convert html font size to XLSX font size.
      Parameters:
      size - HTML font size
      Returns:
      XLSX font size
    • getXLSXFontName

      public String getXLSXFontName(String fontName)
      Convert HTML font name to XLSX font name code.
      Parameters:
      fontName - html font name
      Returns:
      XLSX font name code
    • changeColorFormat

      public String changeColorFormat(String color)
      Change color(3-digits RGB, 6-digits RGB and color name) to RGB format.
      Parameters:
      color - color format
      Returns:
      RGB format and return empty String when invalid color format.
    • setProperties

      public void setProperties(Properties properties)
      Set properties.
      Specified by:
      setProperties in interface IDocumentCreator
      Parameters:
      properties - properties
    • setDocumentPage

      public void setDocumentPage(com.nomagic.magicreport.DocumentPage page)
      Description copied from interface: IDocumentCreator
      set document page property.
      Specified by:
      setDocumentPage in interface IDocumentCreator
      Parameters:
      page - page property.