As a process for learning the Excel 2003 XML file format, an Excel XML writer is implemented to generate an Excel XML file. Basically, it provides complete support for the Excel 2003 XML file format. The list is as follows:
Row
Cell
Styles (font, alignment, interior, numberformat)
Namedrange
Formula (not complete yet ).
Condition formatting.
In a short DEMO code, set the unit content from A1 to E5:
Import com. dyz. xfe .*;
/**
* @ Author dengyunze
*
* Todo to change the template for this generated type comment go
* Window-preferences-Java-code style-code templates
*/
Public class testmain {
Public static void main (string [] ARGs ){
Workbook book = new Workbook ("D:/Excel. xml ");
Worksheet S1 = book. getworksheet (1 );
Book. definerange ("range1", 1, 1, 4 );
For (INT I = 1; I <5; I ++ ){
For (Int J = 1; j <5; j ++ ){
Cell cell = s1.getcell (I, j );
Cell. setvalue (I * j );
}
}
Book. Close ();
}
}