Closed GoogleCodeExporter closed 8 years ago
Hi,
In the WEB Application demo when you are uploading odt, docx, it displays you
the fields that you have defined in the template (it works with simple case,
not tested with complex case like if condition....). Please see code at
https://xdocreport.googlecode.com/svn/trunk/xdocreport-webapp/src/main/java/fr/o
pensagres/xdocreport/webapp/LoadXDocReportServlet.java (doLoad method).
After loding the IXDocReport you can use IXDocReport
#extractFields(FieldsExtractor extractor) like this :
-------------------------------------
IXDocReport report = ...
FieldsExtractor<FieldExtractor> extractor = new
FieldsExtractor<FieldExtractor>();
report.extractFields(extractor);
-------------------------------------
You can use after FieldsExtractor#getFields() to loop for FieldExtractor and
check if IContext contains the key :
-------------------------------------
IContext context = report.createContext();
// Populate context
// Check if fields exists
List<FieldExtractor> fields = extractor.getFields()
for(FieldExtractor field : fields) {
Strint fieldName = field.getName();
if (context .get(fieldName)) {
throw YourException();
}
}
-------------------------------------
Hope this code will help you.
Regards Angelo
Original comment by angelo.z...@gmail.com
on 20 Jul 2011 at 11:33
Original comment by angelo.z...@gmail.com
on 20 Jul 2011 at 11:33
Original comment by angelo.z...@gmail.com
on 19 Jan 2012 at 11:50
Original issue reported on code.google.com by
berchane...@gmail.com
on 20 Jul 2011 at 10:20