HTMLReportGenerator
Allows users to create a basic web report of vertically-stacked elements using the geometry and selected attributes from features. HTML output is stored in the html_content attribute for easily writing out to an HTML page using the HTML writer. Supported elements include Text, Tables, Charts (Bar, Line, and Pie), Maps featuring a variety of basemap providers (Esri Leaflet, Mapbox Leaflet, and Google Maps). Styling uses Twitter bootstrap CSS. The output of this transformer links to libraries and CSS files hosted via CDN (Content Delivery Network), so outputs require Internet connectivity to render certain features such as maps and charts.
This output of this transformer is designed to be fed into the HTMLLayouter for the creation of pages with more sophisticated bootstrap grid layouts.
Input Ports
All input is supplied through a single port. Multiple features can be used to create a single output feature storing a single output HTML page in the html_content attribute.
Output Ports
This transformer supports Group By and outputs a single feature per group (or simply a single feature if Group By is not used) containing a single HTML page in the html_content attribute. All input attributes (other than the Group By attributes) and geometries will be lost on the output feature.
Parameters
Group Processing
If the Group By parameter is set to a set of attributes, one HTML page per group will be produced.
Process At End (Blocking): This is the default behavior. Processing will only occur in this transformer once all input is present.
Process When Group Changes (Advanced): This transformer will process input groups in order. Changes of the value of the Group By parameter on the input stream will trigger processing on the currently accumulating group. This may improve overall speed (particularly with multiple, equally-sized groups), but could cause undesired behavior if input groups are not truly ordered.
There are two typical reasons for using Process When Group Changes (Advanced) . The first is incoming data that is intended to be processed in groups (and is already so ordered). In this case, the structure dictates Group By usage - not performance considerations.
The second possible reason is potential performance gains.
Performance gains are most likely when the data is already sorted (or read using a SQL ORDER BY statement) since less work is required of FME. If the data needs ordering, it can be sorted in the workspace (though the added processing overhead may negate any gains).
Sorting becomes more difficult according to the number of data streams. Multiple streams of data could be almost impossible to sort into the correct order, since all features matching a Group By value need to arrive before any features (of any feature type or dataset) belonging to the next group. In this case, using Group By with Process At End (Blocking) may be the equivalent and simpler approach.
Note: Multiple feature types and features from multiple datasets will not generally naturally occur in the correct order.
As with many scenarios, testing different approaches in your workspace with your data is the only definitive way to identify performance gains.
Page Settings
This attribute allows users to specify an HTML title for the output page. This is the title that will appear on the tab in a browser.
Page Contents
This section allows users to add, order, and remove page elements from the list. The output page will display the elements in the order that they are specified in this list. Available elements include Chart (Bar), Chart (Line), Chart (Pie), Header, Image, List, Map (Esri Leaflet), Map (Google), Map (Mapbox Leaflet), Separator, and Table.
The configuration for each element will be set up in the corresponding Content Settings box to the right.
Content Settings
Each element specified in the page contents settings can have input settings specified in the content settings. The options depend on the element type. Options for each type of element are described below:
This element creates a basic responsive bar chart using the chart.js library. This page element expects multiple input features and combines the data from these features into a single chart. Each input feature will create a new bar along the x axis of the chart.
This optional text field allows you to place an x axis label on the chart.
This mandatory attribute field controls the values that will appear under each bar along the x-axis.
This optional text field allows you to place an y axis label on the chart.
This table allows the user to specify multiple different data series for their bar chart. In the Data Attribute column the user should select a numeric attribute that will be plotted as the count data (or the bar height) for a given feature. The Color field allows the user to specify a unique color for each data series.
This element creates a basic responsive line chart using the chart.js library. This page element expects multiple input features and combines the data from these features into a single chart. Each input feature will create a new point along the x axis of the chart.
This optional text field allows you to place an x axis label on the chart.
This mandatory attribute field controls the values that will appear under each bar along the x-axis. Note that datapoints will always be evenly spaced along the x axis. If you require the flexibility to have non-uniformly spaced x axis values, consider using the ChartGenerator transformer to generate a static chart image that can be added to the page as an “Image” element.
This optional text field allows you to place an y axis label on the chart.
This table allows the user to specify multiple different data series for their line chart. In the Data Attribute column the user should select a numeric attribute that will be plotted as the y axis data (or the point height) for a given feature. The Color field allows the user to specify a unique color for each data series.
This element creates a basic responsive pie chart using the chart.js library. This page element expects multiple input features and combines the data from these features into a single chart. Each input feature will create a slice in the pie chart.
This mandatory attribute field controls the labels for each slice of the pie chart, that will be used in both the tooltip and chart legend.
This value of this numeric attribute will determine the size of a given slice. Slices will be weighted according to the value of this attribute.
Here a color scheme can be specified for the pie chart. Options include Red to White, Blue to White, Red to Green, Rainbow, Pastel and Dark.
Allows the user to enter text either as a header or paragraph form.
Required parameter that allows the user to enter text to appear in the page.
This allows the user to set the header level of the text. If set to None, the text will be added at regular paragraph (<p> tag) size.
Optional parameter that allows the user to specify the id attribute for this header or paragraph element. If left blank, no id attribute will be set.
Allows the user to specify the alignment of the text on the page. Options include Left, Right, Center and Justified.
Allows the user to specify a color for the text.
This element allows the user to either link to or embed an image in their page.
This setting allows the user to choose whether they want to link to an image using a URL or a relative path or to embed the actual content of the image within their page. Note that the latter option may bloat the size of the HTML page considerably for larger images.
This option is only enabled when the Attachment Method is set to Link. It allows the user to specify an image via a relative path or external URL.
This option is only enabled when the Attachment Method is set to Embed. It allows the user to specify an image on the disk to embed within the page. This parameter expects a valid path to a png or jpeg file. If setting this path from an attribute, the user must ensure that the image exists on disk at the time the features hit this transfomer. In the event you wish to use an image dynamically created as part of a workflow, consider using the FeatureWriter transformer before this transformer to write this image to disk and use it within the report within a single workspace.
This optional parameter allows one to specify text that will be displayed in the event the image fails to load.
Allows the user to create a list of text from an attribute.
The attribute that will be used to populate the list values one entry per feature.
This option specifies whether the list will be marked with bullets, letters, numbers, roman numerals or nothing.
Allows the user to set a color for the list text.
This attribute can only be set if List Item Markers is set to None. In the event this is set, bootstrap style badges will be set on the right-hand side of the list.
This element allows the user to create a simple webmap featuring the geometries of input features as a layer.
Note: The tiles used to generate embedded maps may be subject to usage limitations and other restrictions. Please review the terms of use.
This optional parameter allows the user to specify an attribute value used to label each feature on the map within a tooltip.
This option allows the user to specify a color for the layer.
This option allows the user to select from the list of available Esri Basemaps. Options include: Street, Terrain, Satellite, Gray, Dark Gray, Shaded Relief, Topographic, and National Geographic.
This parameter allows the user to specify a list of comma delimited ArcGIS Online feature layer URLs, that will be displayed as additional layers on the map.
This element allows the user to create a simple webmap featuring the geometries of input features as a layer. Note that this transformer only supports a single Google map per page. To create a web page with multiple Google maps, you must create multiple pages (using Group By or multiple HTMLReportGenerator transformers) and then reassemble these into a single page using the HTMLLayouter transformer.
Note: The tiles used to generate embedded maps may be subject to usage limitations and other restrictions. Please review the terms of use.
This optional parameter allows the user to specify an attribute value used to label each feature on the map within a tooltip.
This option allows the user to specify a color for the layer.
This optional field allows the user to specify their Google Maps API Access token. Note that this is not required to create a simple Google Maps webmap.
This element allows the user to create a simple webmap featuring the geometries of input features as a layer. Note this page element requires the user to create or possess a Mapbox account to obtain a Mapbox access token. Visit http://www.mapbox.com to create a free account.
Note: The tiles used to generate embedded maps may be subject to usage limitations and other restrictions. Please review the terms of use.
This optional parameter allows the user to specify an attribute value used to label each feature on the map within a tooltip.
This option allows the user to specify a color for the layer.
This mandatory field allows the user to specify their Mapbox API Access token. This token is required for the basemap to render correctly.
This allows the user to input the map id of a map created with their Mapbox account. The default is set to mapbox.streets as this map should be present on all accounts.
Allows the user to set a separator element or <hr> tag.
This integer parameter controls the width of the separator.
This element creates a basic HTML table featuring data from attributes.
Allows the user to choose between several bootstrap table styles including: Striped, Bordered and Condensed. The Default style is Bordered.
This table allows the user to configure the columns of the output HTML table. The ‘Column Contents’ column must be set to an attribute value. These values will appear as the rows of the column. The ‘Column Name’ field allows the user to specify a name for each column.
Allows the user to enter custom HTML.
Raw HTML-formatted text that will be inserted into the output page. The user should ensure that the text is valid HTML.
This button at the bottom of the transformer allows the user to view a preview of the page they are creating in their default browser. Clicking this button will show a preview of the rough layout of the page. Preview generation may not work while some parameters are in the invalid state. The final page will in many cases look different as the preview is unaware of the actual values that will be sent in at run-time.
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.
Defining Values
There are several ways to define a value for use in a Transformer. The simplest is to simply type in a value or string, which can include functions of various types such as attribute references, math and string functions, and workspace parameters. There are a number of tools and shortcuts that can assist in constructing values, generally available from the drop-down context menu adjacent to the value field.
Using the Text Editor
The Text Editor provides a convenient way to construct text strings (including regular expressions) from various data sources, such as attributes, parameters, and constants, where the result is used directly inside a parameter.
Using the Arithmetic Editor
The Arithmetic Editor provides a convenient way to construct math expressions from various data sources, such as attributes, parameters, and feature functions, where the result is used directly inside a parameter.
Conditional Values
Set values depending on one or more test conditions that either pass or fail.
Parameter Condition Definition Dialog
Content
Expressions and strings can include a number of functions, characters, parameters, and more.
When setting values - whether entered directly in a parameter or constructed using one of the editors - strings and expressions containing String, Math, Date/Time or FME Feature Functions will have those functions evaluated. Therefore, the names of these functions (in the form @<function_name>) should not be used as literal string values.
These functions manipulate and format strings. | |
Special Characters |
A set of control characters is available in the Text Editor. |
Math functions are available in both editors. | |
Date/Time Functions | Date and time functions are available in the Text Editor. |
These operators are available in the Arithmetic Editor. | |
These return primarily feature-specific values. | |
FME and workspace-specific parameters may be used. | |
Creating and Modifying User Parameters | Create your own editable parameters. |
Dialog Options - Tables
Transformers with table-style parameters have additional tools for populating and manipulating values.
Row Reordering
|
Enabled once you have clicked on a row item. Choices include:
|
Cut, Copy, and Paste
|
Enabled once you have clicked on a row item. Choices include:
Cut, copy, and paste may be used within a transformer, or between transformers. |
Filter
|
Start typing a string, and the matrix will only display rows matching those characters. Searches all columns. This only affects the display of attributes within the transformer - it does not alter which attributes are output. |
Import
|
Import populates the table with a set of new attributes read from a dataset. Specific application varies between transformers. |
Reset/Refresh
|
Generally resets the table to its initial state, and may provide additional options to remove invalid entries. Behavior varies between transformers. |
Note: Not all tools are available in all transformers.
FME Community
The FME Community is the place for demos, how-tos, articles, FAQs, and more. Get answers to your questions, learn from other users, and suggest, vote, and comment on new features.
Search for samples and information about this transformer on the FME Community.