public ReportResult fillWithData (
   String dirPath, 
   Map params, 
   IDocumentDataSource dataSource, 
   DataPresentationTemplate template, 
   IDocEngineHelper helper, 
   IDomainVersion domainVersion, 
   int outputFormat, 
   boolean printResults, 
   int numCopies) 
throws DocumentException

This method is called by Aware IM at run time when a particular document template is processed. The method is supposed to replace tags used in the document template with the appropriate attribute values. The values must be obtained from the provided data source – see IDocumentDataSource interface. The overall structure of the method must be as follows:

  1. Find the contents of the tags used in the document template.
  2. Call reset method of the provided data source to position it on the first element.
  3. Create a document (BinaryResource) from the original template that will have tags replaced with their value.
  4. Go through all the tags and call the getExpressionValue method of the provided data source to calculate the value of the expression used inside the tag
  5. Replace each tag in the document with its calculated value
  6. Call the next method of the data source. While there are elements in the data source repeat steps 3 to 5.

See also the example.

Parameters

dirPaththe name of the directory where the template file is stored
paramscan be ignored
dataSourcethe source of data for the values of the tags. See the IDocumentDataSource interface.
templatethe document template which is being filled with data
helpercan be ignored
domainVersionthe business space version where the document template is defined
outputFormatcan be ignored
printResultsif true the resulting document(s) should also be sent to the printer
numCopiesnumber of copies to print (only if printResults is true)

Returns

A structure represented by the ReportResult object. The first document created at the step 3 must be set into this structure as the BinaryResource. All other documents must be stored on disk as files. Full path names of the files must be set into the ReportResult structure.

Throws

the DocumentException if error occurs.

  • Last modified: 2023/05/08 06:54