com.aspose.words

Class ReportingEngine

  • java.lang.Object
    • com.aspose.words.ReportingEngine
public class ReportingEngine 
extends java.lang.Object

Provides routines to populate template documents with data and a set of settings to control these routines.

Constructor Summary
ReportingEngine()
Initializes a new instance of this class.
 
Property Getters/Setters Summary
KnownTypeSetgetKnownTypes()
Gets an unordered set (i.e. a collection of unique items) containing java.lang.Class objects which fully or partially qualified names can be used within report templates processed by this engine instance to invoke the corresponding types' static members, perform type casts, etc.
intgetOptions()
void
setOptions(intvalue)
           Gets or sets a set of flags controlling behavior of this ReportingEngine instance while building a report. The value of the property is ReportBuildOptions integer constant.
static booleangetUseReflectionOptimization()
staticvoid
           Gets or sets a value indicating whether invocations of custom type members performed via reflection API are optimized using dynamic class generation or not. The default value is true.
 
Method Summary
booleanbuildReport(Document document, java.lang.Object dataSource)
Populates the specified template document with data from the specified source making it a ready report.
booleanbuildReport(Document document, java.lang.Object dataSource, java.lang.String dataSourceName)
Populates the specified template document with data from the specified source making it a ready report.
booleanbuildReport(Document document, java.lang.Object[] dataSources, java.lang.String[] dataSourceNames)
Populates the specified template document with data from the specified sources making it a ready report.
booleanequals(java.lang.Object obj)
 

    • Constructor Detail

      • ReportingEngine

        public ReportingEngine()
        Initializes a new instance of this class.
    • Property Getters/Setters Detail

      • getKnownTypes

        public KnownTypeSet getKnownTypes()
        
        Gets an unordered set (i.e. a collection of unique items) containing java.lang.Class objects which fully or partially qualified names can be used within report templates processed by this engine instance to invoke the corresponding types' static members, perform type casts, etc.
      • getOptions/setOptions

        public int getOptions() / public void setOptions(int value)
        
        Gets or sets a set of flags controlling behavior of this ReportingEngine instance while building a report. The value of the property is ReportBuildOptions integer constant.
      • getUseReflectionOptimization/setUseReflectionOptimization

        public static boolean getUseReflectionOptimization() / public static void setUseReflectionOptimization(boolean value)
        
        Gets or sets a value indicating whether invocations of custom type members performed via reflection API are optimized using dynamic class generation or not. The default value is true. There are some scenarios where it is preferrable to disable this optimization. For example, if you are dealing with small collections of data items all the time, then an overhead of dynamic class generation can be more noticeable than an overhead of direct reflection API calls.
    • Method Detail

      • buildReport

        public boolean buildReport(Document document, java.lang.Object dataSource)
                           throws java.lang.Exception
        Populates the specified template document with data from the specified source making it a ready report.

        Using this overload you can reference the data source's members in the template document, but you cannot reference the data source object itself. You should use the buildReport(com.aspose.words.Document,java.lang.Object,java.lang.String) overload to achieve this.

        A data source object can be of one of the following types:

        • XmlDataSource
        • JsonDataSource
        • CsvDataSource
        • com.aspose.words.net.System.Data.DataSet
        • com.aspose.words.net.System.Data.DataTable
        • com.aspose.words.net.System.Data.DataRow
        • com.aspose.words.net.System.Data.IDataReader
        • com.aspose.words.net.System.Data.IDataRecord
        • com.aspose.words.net.System.Data.DataView
        • com.aspose.words.net.System.Data.DataRowView
        • Any other arbitrary Java type

        For information on how to work with data sources of different types in template documents, see template syntax reference (https://docs.aspose.com/display/wordsjava/Template+Syntax).

        Parameters:
        document - A template document to be populated with data.
        dataSource - A data source object.
        Returns:
        A flag indicating whether parsing of the template document was successful. The returned flag makes sense only if a value of the Options property includes the ReportBuildOptions.INLINE_ERROR_MESSAGES option.
      • buildReport

        public boolean buildReport(Document document, java.lang.Object dataSource, java.lang.String dataSourceName)
                           throws java.lang.Exception
        Populates the specified template document with data from the specified source making it a ready report.

        Using this overload you can reference the data source's members and the data source object itself in the template. If you are not going to reference the data source object itself, you can omit dataSourceName passing null or use the buildReport(com.aspose.words.Document,java.lang.Object) overload.

        A data source object can be of one of the following types:

        • XmlDataSource
        • JsonDataSource
        • CsvDataSource
        • com.aspose.words.net.System.Data.DataSet
        • com.aspose.words.net.System.Data.DataTable
        • com.aspose.words.net.System.Data.DataRow
        • com.aspose.words.net.System.Data.IDataReader
        • com.aspose.words.net.System.Data.IDataRecord
        • com.aspose.words.net.System.Data.DataView
        • com.aspose.words.net.System.Data.DataRowView
        • Any other arbitrary Java type

        For information on how to work with data sources of different types in template documents, see template syntax reference (https://docs.aspose.com/display/wordsjava/Template+Syntax).

        Parameters:
        document - A template document to be populated with data.
        dataSource - A data source object.
        dataSourceName - A name to reference the data source object in the template.
        Returns:
        A flag indicating whether parsing of the template document was successful. The returned flag makes sense only if a value of the Options property includes the ReportBuildOptions.INLINE_ERROR_MESSAGES option.
      • buildReport

        public boolean buildReport(Document document, java.lang.Object[] dataSources, java.lang.String[] dataSourceNames)
                           throws java.lang.Exception
        Populates the specified template document with data from the specified sources making it a ready report.

        Using this overload you can reference multiple data source objects and their members in the template. The name of the first data source can be omitted (i.e. be an empty string or null) if you are going to reference the data source's members but not the data source object itself. Names of the other data sources must be specified and unique.

        If you are going to use a single data source, consider using of buildReport(com.aspose.words.Document,java.lang.Object) and buildReport(com.aspose.words.Document,java.lang.Object,java.lang.String) overloads instead.

        A data source object can be of one of the following types:

        • XmlDataSource
        • JsonDataSource
        • CsvDataSource
        • com.aspose.words.net.System.Data.DataSet
        • com.aspose.words.net.System.Data.DataTable
        • com.aspose.words.net.System.Data.DataRow
        • com.aspose.words.net.System.Data.IDataReader
        • com.aspose.words.net.System.Data.IDataRecord
        • com.aspose.words.net.System.Data.DataView
        • com.aspose.words.net.System.Data.DataRowView
        • Any other arbitrary Java type

        For information on how to work with data sources of different types in template documents, see template syntax reference (https://docs.aspose.com/display/wordsjava/Template+Syntax).

        Parameters:
        document - A template document to be populated with data.
        dataSources - An array of data source objects.
        dataSourceNames - An array of names to reference the data source objects within the template.
        Returns:
        A flag indicating whether parsing of the template document was successful. The returned flag makes sense only if a value of the Options property includes the ReportBuildOptions.INLINE_ERROR_MESSAGES option.
      • equals

        public boolean equals(java.lang.Object obj)