Field Values
The Report component also has a concept called “Field Values”. Each snapshot has a field value table that contains a number of field value key names and corresponding values, for instance database name, result name, min/max value and so on. If a field value tag is found in a document template, it will be replaced with the matching value from the correct snapshot when the report is created.
Tag Syntax
The syntax of the field value tag is SIT1_$MYFIELDVALUE where MYFIELDVALUE is the field value name. When the Report component encounters this tag in the text, it will go to snapshot 1 in the repository and search its field value table for a field value named MYFIELDVALUE. If a match is found, it will take the corresponding value and replace the field value in the text.
Example in Word
Text found in MS Word: “The result “N/A” has min value N/A and max value N/A.”
In Design Mode, content controls will show the selected field values:
The generated text in the report will be: “The result “Stress” has the min value 0 and max value 42.”
Field Values Generator
For convenience, the Report component offers a Field Values generator (cee::rep::FieldValuesGenerator) which populates a set of field values from an UnstructModel.
cee::PtrRef<cee::rep::Snapshot> snapshot = new cee::rep::Snapshot(cee::rep::Snapshot::OBJECT_VTFX);
snapshot->setTitle("My VTFx Model Title");
std::map<cee::Str, cee::Str> fieldValues = cee::rep::FieldValuesGenerator::getFieldValuesFromModel(m_unstructModel.get());
snapshot->setFieldValues(fieldValues);
The following field values are set:
Field value name |
DATABASE_NAME
DATABASE_PATH
DATABASE_TITLE
DATABASE_DESCRIPTION
DATABASE_NUM_STATES
DATABASE_NUM_SCALARS
DATABASE_NUM_VECTORS
DATABASE_NUM_DISPLACEMENTS
DATABASE_TYPE
CASE_NUM_PARTS
CASE_BOUNDING_BOX_MIN
CASE_BOUNDING_BOX_MAX
FRAME_BOUNDING_BOX_MIN
FRAME_BOUNDING_BOX_MAX
FRAME_NUM_ELEMENTS
FRAME_NUM_NODES
FRAME_TIMESTEP
FRAME_TIMESTEP_REF_VALUE
SCALAR_RESULT_NAME
SCALAR_RESULT_ID
SCALAR_RESULT_MAPPING
SCALAR_RESULT_MIN
SCALAR_RESULT_MAX
VECTOR?_RESULT_NAME
VECTOR?_RESULT_ID
VECTOR?_RESULT_MAPPING
VECTOR?_RESULT_MIN
VECTOR?_RESULT_MAX
DISPLACEMENT_RESULT_NAME
DISPLACEMENT_RESULT_ID
CUTPLANE?_POSITION
CUTPLANE?_NORMAL
CUTPLANE?_SCALAR_NAME
ISOSURFACE?_ISO_VALUE
ISOSURFACE?_ISO_SCALAR_NAME
ISOSURFACE?_MAP_SCALAR_NAME
ISOSURFACE?_MAP_VECTOR_NAME
ISOVOLUME?_ISO_VALUE_MIN
ISOVOLUME?_ISO_VALUE_MAX
ISOVOLUME?_ISO_SCALAR_NAME
ISOVOLUME?_MAP_SCALAR_NAME
ISOVOLUME?_MAP_VECTOR_NAME
|
Note the ? in the field values keys. This applies to cutting planes, isovolumes, isosurfaces and vectors which there can be more that one of for the model at the same time. These will be replaced with the correct index found in the model.