Hi people,
I've been looking for some solution for my problem at POI project's site.
What I need is read a template .PPT file, identify its keys, select each
value (from the database) that fits to each key of the file and generate a
new file, based on the template, with the values selected by the user inside
it.
For the .XLS file format, I found something pretty easy to use at
jxls.sourceforge.net (based on POI) and I wrote this code:
import java.io.IOException;
import java.util.Collection ;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import net.sf.jxls.exception.ParsePropertyException;
import net.sf.jxls.transformer.XLSTransformer;
public class TestjXLS {
public static void main(String args[]){
Collection<Item> items = new HashSet<Item>();
items.add(new Item("Luiz", 35, "R. Hermantino Coelho"));
Map<String,Collection> beans = new HashMap<String,Collection>();
beans.put("item", items);
XLSTransformer transformer = new XLSTransformer();
try {
transformer.transformXLS("testejXML.xls", beans, "
resultsFromjXML.xls ");
} catch (ParsePropertyException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
I searched for other projects which could do this, like jXLS for .XLS files
and didn't find too.
Please, does anybody could give me some tip to do this with HWPF and HSLF?
Since now, thanks for any help!
Luiz