Inserting Fields

To enable field code recognition, use the following parameter:



   import com.aspose.words.jasperreports.*;
   AWDocExporter exporter = new AWDocExporter();
   exporter.setParameter(AWExporterParameter.RECOGNIZE_FIELDS, true);



<bean id="aw_exportParameters" class="com.aspose.words.jasperreports.AWExportParametersBean">
    <property name="recognizeFields" value="true"/>

Once this parameter is set to true, the exporter treats any text enclosed in curved brackets ({}) as a field code and exports it appropriately. For example, the following text

Page { PAGE } of { NUMPAGES }

adds two fields to the output document, PAGE and NUMPAGES, displaying the current page number and the total number of pages in the document, respectively.

You can add any field arguments and switches supported by the field. For example, to insert a document creation timestamp, insert the following text:

{ DOCPROPERTY CreateTime }