class ReportCreatorHtml

Report creator for an HTML report.

The report creator contains the necessary information and data to create an HTML report based on a given template.

The report creator object must be given a repository and a template file name upon creation. Additional settings such as a reference repository, generic snapshots indices and media type in the generated report are also available.

After applying the necessary settings, the report is created using generate() specifying the name of the generated report.

For some scenarios it can be convenient to create a report using images instead of 3D models. For instance if the receiver is not able to go online for the Ceetron Cloud or just a report where the 3D interaction is not needed. Instead of having to create a new template using images, set setUse3dPlugin(false) and all 3D model objects in the template will be replaced with snapshot if these are available within the VTFx file. Default is to use the 3D model for VTFx snapshots.

Generic snapshots will default unroll for all snapshots with matching type in the repository. If only a sub-set of these should be used, you can specify this using setGenericSnapshotIndices().

Note! In PowerPoint and Word, the VTFx file is embedded into the .pptx/.docx file. But for HTML reports, we put the VTFx in the cloud using Ceetron Cloud (https://cloud.ceetron.com) and reference this in the report. To enable the cloud integration, the user need to specify the url to the VTFx model in the Snapshot object using Snapshot::setCloudViewerUrl() instead of (or in addition to) Snapshot::setModelVtfx(). See Ceetron Cloud - add a Send-To-Cloud button to your app for how to upload the VTFx to cloud. The QtReposityoryManager and WinFormsReport examples provided in the distribution has example code for this.

See also


Public Functions

ReportCreatorHtml(Repository *repository, const Str &templateFile)

Creates a report creator for an HTML document based on the given repository and template file.

bool generate(const Str &reportFile) const

Generates a report and save it to the file name given by reportFile.

Returns true if the report was successfully created. Returns false if an error occurred.

bool validate(Str *summary) const

Validates the template and creates a summery of the compatibility between the template and the repository.

void setReferenceRepository(Repository *repository)

Sets a reference repository to be used for this report generation.

void setGenericSnapshotIndices(const std::vector<unsigned int> &indices)

Sets the array of indices used for generic snapshots.

void setUse3dPlugin(bool use)

Sets whether the report should use the 3D plugin/cloud integration.

Setting use to false will replace all VTFx tagged objects in the template with images.

Public Static Functions

static bool summarize(const Str &templateFile, Str *summary)

Summarizes the content of the template file.