k5n.us
X Home X X News X X Apps/Tools X X Support X X Downloads X X Articles X X Contact X
jxmlss
 AboutLicensingTutorialDownloadDevelopersCompetitors  

jxmlss Tutorial

The jxmlss interface is very simple to use. Basically, you create a Document object and add one or more Worksheet objects to it. Each Worksheet should have Row objects added to it. When you're done, invoke the Document.toXMLSS() method.



A Simple Example:


  public void SimpleTest ()
  {
    Document d = new us.k5n.jxmlss.Document ();
    d.setTitle ( "Example 1" );
    d.setSubject ( "Example 1 Subject" );
    d.setDescription ( "Example 1 File For Testing" );
    d.setAuthor ( "Joe Schmoe" );
    d.setKeywords ( "Microsoft, Excel, k5n.us, Java" );
    Worksheet worksheet = new Worksheet ( "Worksheet 1" );
    Row header = new Row ();
    header.addCell ( "" ); // blank
    header.addCell ( "Value 1" );
    header.addCell ( "Value 2" );
    header.addCell ( "Value 3" );
    header.addCell ( "Property 1" );
    worksheet.addRow ( header );

    Row row = new Row ();
    row.addCell ( "Item 1" ); row.addCell ( new Float ( 0.97 ) );
    row.addCell ( new Float ( 10097 ) ); row.addCell ( new Integer ( 37 ) );
    worksheet.addRow ( row );

    row = new Row ();
    row.addCell ( "Item 2" ); row.addCell ( new Float ( 21.97 ) );
    row.addCell ( new Integer ( 447 ) );
    row.addCell ( new Float ( 432.333 ) );
    worksheet.addRow ( row );

    d.addWorksheet ( worksheet );

    String outputString = d.toXMLSS();
    // You would likely write the output to a file here...
  }



SourceForge.net Logo

Valid XHTML 1.0 Valid CSS PHP
Page Last Updated: 02-Aug-2017
Copyright ©2004-2017 k5n.us, All Rights Reserved