Skip to main content
RSS feed Subscribe to feed

 

Skip Navigation LinksHome  Extending the Spotfire Platform  Creating Extensions to the Spotfire Platform  Creating a Tool  How to Create an Export Tool  Export Tool Feature: Configurable Border Widths Between Page Parts

©Spotfire 2011

Export Tool Feature: Configurable Border Widths Between Page Parts

Carefully define the correct borders and coordinates.

The AreaWithBorder help class is used to generate all areas. The visualizations, for instance, get the correct areas as follows:

AreaWithBorder visualCanvas = new AreaWithBorder(
    settings.VisualCanvasBorder,
    visualBounds.Left, visualBounds.Top,
    visualBounds.Width, visualBounds.Height);
sb.AppendLine(visualCanvas.GetAbsolutePositionedDiv("visualCanvas"));
...
visualHeading = new AreaWithBorder(
    settings.VisualHeadingBorder, 
    0, 0, visualCanvas.InnerWidth, settings.VisualHeadingHeight);
sb.Append(visualHeading.GetAbsolutePositionedDiv("visualHeading"));
sb.AppendFormat("<h3>{0}</h3>", visual.Title);
sb.AppendLine("</div>"); // end of visualHeading.
...
AreaWithBorder visualArea = new AreaWithBorder(settings.VisualAreaBorder,
    0, visualHeading.OuterHeight,
    visualCanvas.InnerWidth, 
    visualCanvas.InnerHeight - visualHeading.OuterHeight); 
sb.Append(visualArea.GetAbsolutePositionedDiv("visualArea"));
...
sb.AppendLine("</div>"); // end of visualArea.
sb.AppendLine("</div>"); // end of visualCanvas.

The border widths are stored as constants in HTMLPrintToolSettings. Some of them can easily be derived from the settings dialog if needed.