Skip to main content

SQLXML Report

This generator allows generating custom database driven MS Word documents and reports from a template document using generic Xomega document generation engine.

It may be useful for producing both project-specific technical documentation from structured data stored in the database, as well as generic reports, such as inventories, price lists, etc.

The generated document is based on a customizable Word template that you can update to change the look and feel, the static content, and the way dynamic content is added.

Generator inputs‚Äč

The input data comes from an SQLXML query that you supply in the generator's properties. The XML elements and attributes returned by that query can be used in the document template to select the data that needs to be displayed in each Content Control.

Generator outputs‚Äč

This generator creates a Microsoft Word document with the formatted data at the specified path.

Configuration‚Äč

The following sections describe configuration parameters used by the generator.

Generator parameters‚Äč

The following table lists configuration parameters that are set as the generator’s properties.

ParameterValue ExampleDescription
Generator NameSQLXML ReportThe name of the current configuration of the generator that will appear in the model project and the build output.
Folder NameDocumentationFolder path to the generator inside the Model project. The folders are separated by a backslash (\).
Include In BuildFalseA flag indicating whether or not running this generator should be included in building of the model project.
Document Template..\Templates\ReportTemplate.docxPath to the MS Word document that will be used as a template for the generated document.
Output
Output Path../Docs/SqlXmlReport.docxRelative path where to output the generated document.
Database
DatabaseSQL ServerDatabase type of the target database. Currently only SQL Server (sqlsrv) is supported. Value 'Use Project Settings' takes this value from the corresponding property of the model project.
Database Version11.0The version of the target database. Value 'Use Project Settings' takes this value from the corresponding property of the model project.
Database CaseCamelCaseThe database case for the database objects' names: UPPER_CASE, lower_case or CamelCase. Value 'Use Project Settings' takes this value from the corresponding property of the model project.
Database ConnectionUse Project SettingsDatabase connection string for the target database. Edited via a Database Connection Configuration dialog, which also sets the other Database parameters of the generator, and allows saving all this configuration for the entire project. Value 'Use Project Settings' takes this value from the corresponding property of the model project.
Sql QuerySELECT ... FOR XML ..., TYPE, ROOT('root')SQL query that returns rooted typed XML using FOR XML, TYPE and ROOT directives.
Parameters
TitleSQLXML ReportTitle to use for the generated document.
SubjectCustom report generated from SQL XMLSubject (subtitle) to use for the generated document.
Creator[User]Creator (author) of the generated document. Value [User] indicates the user of the current Xomega license.
Company[Company]Company to use for the generated document. Value [Company] indicates the company of the current Xomega license.

Model configuration‚Äč

The generator doesn't use any other global configurations in the model.

Common configurations‚Äč

You can have multiple configurations of this generator to create multiple types of DB data driven reports with using different SQL queries for the data, different document templates and generator's parameters.

How to use the generator‚Äč

The sections below provide some details on how to work with the generator.

Running the generator‚Äč

To run this generator you need to select it in the model project, and then select Generate menu from either the context menu or the top-level Project menu.

caution

After you generate the document, you may need to open it and refresh all fields there, such as the table of contents, by selecting all text (Ctrl+A) and pressing F9.

Customizing the output‚Äč

danger

You should never edit the generated document directly to avoid losing your changes when you rerun the generator.

Instead, you should update the MS Word template that is used to create the document, or make changes in the data or generator's parameters.

Cleaning generator‚Äôs output‚Äč

The generator doesn't support a Clean operation, since the entire document is regenerated when you rerun the generator.