HTML Reports

BDM can generate HTML reports for deals in the current folder or for the current deal. There are no standard reports, but the HTML report manager can be used to create your own.

HTML report format drop-down

The available reports are shown on drop-downs in the Folder and Deal menus. They are listed in the order set in HTML Report Management, and this incorporates a single level of organization by prefixing the name with a category followed by | (the ‘pipe’ character, which is normally Shift-\ on UK keyboards). BDM automatically organizes reports into their categories. For instance, you might have a category called ‘Exercise’, with two reports called ‘Questions’ and ‘Answers’.

HTML Report Management

Report formats are managed from a separate window loaded from the HTML Report Management button on the Settings tab.

HTML report management form

There are options to edit, duplicate, delete or export the selected report format, and to create a new one or import one. You can also change the display order and generate test reports directly from the HTML management form, and these are always saved in a standard temporary location and opened.

The form shows a description for each report format, together with any additional HTML head code and internal CSS to append to the standard CSS used for all reports. These can all be edited after enabling their panels by double-clicking.

Editing an HTML Report Format

The selected HTML report format can be edited with the Edit button. This brings up the HTML report editing dialogue where you control the details of the report. You specify general report properties such as suit representation, and structural details of what elements of the deals are shown. You do not specify the precise style of how the elements will be rendered. That is expected to be defined in the CSS.

HTML report editor form

You can also generate test reports directly from the HTML report editor form, and these are always saved in a standard temporary location and opened.

HTML Report Format Structure

An HTML report format consists of a hierarchical tree of items, each with properties that the user can set in a property grid. A new report format is pre-populated with a single root Report item, containing a single child DealEnumerator item. The user adds child items to the DealEnumerator item. Most of the item types that can be added to a DealEnumerator correspond to properties of the deal, such as summary (title), dealer, contract. These cannot contain other items, but there is a generic Container item that can contain other items. Containers might be HTML div or table elements, but you can use then to specify any HTML structural elements.

There is only one Report item for a report format, but it can contain multiple DealEnumerator items, representing multiple iterations through the deals.

A child item is added by selecting its parent and clicking the item type on the left-hand menu. The menu only enables types that are valid children of the selected type. An item is deleted by selecting it and clicking the delete icon on the left menu. All the deleted item’s descendants are deleted as well. The delete icon is only enabled if it is valid to delete the selected item. An item is moved by dragging it to its new position amongst its siblings, or to a different Container. (If the Container is a sibling of the dragged item and you just want to change its order within the parent rather than moving it to the Container, you can use the shift key.)

HTML report editor tree context menu

You can also copy a node (including an individual item) and paste it into a container, using the tree’s context (right-click) menu.

HTML report editor property grid context menu

You can reset properties to their default value using the property grid’s context (right-click) menu.

The item properties are organized into categories:

  • Content: What content is output.
  • HTML: How HTML is used to code the content.
  • Layout: How output is laid out in the generated file. This does not affect how the content is rendered by browsers.
  • Formatting: General output properties, such as suit representation and output type.
  • Information: Other general report information, such as report name.

Common Properties

The following properties are common to all items:

  • Class: HTML class attribute for the primary output of the item, if any. (Strictly speaking, Class is not shown for CustomXml items.)
  • SingleLineOutput: Whether to output on a single line if the parent node does not.

The following properties are common to some items, but not all:

  • IsOptional: Only output the field for deals with Optional Output set.
  • EnclosingClass: HTML class attribute for the enclosing block, if used.
  • Heading: Optional heading text.
  • HeadingTag: HTML tag for the heading, if any.
  • HeadingClass: HTML class attribute for the heading, if any.
  • FormatString: A [C#] format string. Parameters are numbered from zero and are specific to the item type. They are defined in the sections below. Parameters are used in the format string with {n} where n is the parameter number. For instance, “{0}”.
  • SuppressTextTag: Output the field without the normal enclosing HTML text tag. Defined for simple single-line items only. Typically used in conjunction with surrounding CustomXml items to provide the HTML tag manually.
  • SingleNewLines: Specifies the treatment of single new-line in the text. Defined for multi-line items only. (Double new-line is always treated as a paragraph separator.)
    • UseParagraph: Single new-line is treated as a paragraph separator in the same way as double new-line.
    • UseBreak: Single new-line is treated as a line break (using <br>).

Report

The Report item is the root item. It cannot be deleted and there can only be one. It may contain only DealEnumerator items. Its properties relate to the whole report:

  • Name: The name of the HTML report format. This is what is displayed in lists.
  • OutputType: Type of output file.
    • htm: File with htm extension, containing full HTML output including internal CSS.
    • xml: File with xml extension, containing just the HTML you would paste into a webpage, without CSS.
    • txt: Same as xml, but with a txt file extension.
  • SuitRepresentation: Representation used for suits.
    • Filled: Filled symbols characters.
    • OutlineRed: Filled symbol characters for black suits and outline symbol characters for red suits.
    • Alpha: Alphabetic letters.
  • FilePerDeal: Output each deal to a separate file. This is ignored when generating test reports from the HTML management and design forms. It applies only when generating from the Folder menu drop-down.
  • SuppressCss: Suppress both standard and report-specific CSS output. Only applies when OutputType is htm. (Use when the CSS is in a file.)

DealEnumerator

Only the Report item can contain DealEnumertor items. They represents iterations through the deals (when generating for multiple deals). There may be more than one DealEnumertor, representing multiple iterations through the deals. You might iterate once to create an index, and again to output detail.

  • IndentedOutput: Whether to use hierarchical indention in the output file.
  • UseEnclosingBlocks: Whether to enclose each content item in an enclosing block.
  • SingleLineEnclosingBlocks: Whether to output any enclosing blocks on a single line if the parent node does not.
  • AddDealSeparator: Whether to separate deals with a blank line (for easy copy/paste).
  • DefaultHeadingTag: Default value for the HTML tag of field headers.

Board

The board number.

  • FormatString: Parameter 0 is the board number. For instance, “Board {0}”.

Summary

The title text.

  • FormatString: Parameter 0 is the entire title text.

Dealer

The dealer.

  • FormatString: Parameter 0 is the dealer (in full). For instance, “Dealer {0}”.

Vulnerability

The vulnerability.

  • FormatString: Parameter 0 is the vulnerability. For instance, “Vulnerability {0}”.

CardTable

A table representation of the cards. There is some control over which hands are displayed, and the table can optionally include HCPs.

  • AlwaysExclude: Specifies hand positions that are always excluded.
  • ShowAllHands: If true, then all hands are considered. If false, only hands set as shown for the deal are considered. Considered hands are then displayed if not excluded by AlwaysExclude.
  • ShowHcps: Specifies whether HCPs are shown. They are only ever shown if all hands are output.

Contract

The contract and declarer.

  • FormatString: Parameter 0 is the contract text. Parameter 1 is the declarer text. For instance, “Contract: {0} by {1}”
  • FullNameOfDeclarer: Specifies whether to use full text for the declarer (if used in the format string), or just a single character.

AuctionTable

A table showing the bidding for the deal.

Lead

The lead card.

  • FormatString: Parameter 0 is lead card. For instance, “Lead: {0}”.

LeadNote

The lead commentary.

Introduction

The introductory text.

Analysis

The analysis text.

Source

The source of the deal.

  • FormatString: Parameter 0 is the full source text.

MakableContracts

A table of the makable contracts and optionally the par results. The entire item is omitted for deals with incomplete hands. The par results are always omitted for deals with no vulnerability specified.

  • ShowTricks: Whether to show makable tricks or makable contract levels.
  • ShowOptimumResults: Whether to include par results. They are only displayed for deals with vulnerability specified.

Hand

The cards in the single specified hand. A heading paragraph can optionally be specified using a format string. Use an empty string to suppress the header.

  • TablePosition: The table position of the hand to display.
  • HeadingFormatString: Parameter 0 is the table position (in full). Parameter 1 is the HCP count. For instance, “{0} (HCP {1})”.

Container

A generic container that can contain other items. For instance, you could define an unordered list by specifying an ul container with descendant li Containers.

  • Tag: The HTML tag to use. This is displayed in the tree. The default is div.

CustomXml

Custom XML to be inserted in the output. For instance, you might add a link.

  • Xml: The custom XML to insert.