Hydrologic Modeling System HEC-HMS



Similar documents
Hydrologic Modeling using HEC-HMS

Data Integration through XML/XSLT. Presenter: Xin Gu

An XML Based Data Exchange Model for Power System Studies

Chapter 19: XML. Working with XML. About XML

Smart Connection 9 Element Labels

XSLT Mapping in SAP PI 7.1

Eventia Log Parsing Editor 1.0 Administration Guide

New Perspectives on Creating Web Pages with HTML. Considerations for Text and Graphical Tables. A Graphical Table. Using Fixed-Width Fonts

Validating XML Data with an XML Schema

An Oracle White Paper May Creating Custom PDF Reports with Oracle Application Express and the APEX Listener

Working With Templates in Web Publisher. Contributed by Paul O Mahony Developer Program

ultimo theme Update Guide Copyright Infortis All rights reserved

About XML in InDesign

Composite.Community.Newsletter - User Guide

XSL Elements. xsl:copy-of

Urban Planet Website Content Management System. Step-by-Step Instructions

Brocade Network Advisor: CLI Configuration Manager

Example. Represent this as XML

Developing XML Solutions with JavaServer Pages Technology

Creating Accessible PDF Documents with Adobe Acrobat 7.0 A Guide for Publishing PDF Documents for Use by People with Disabilities

Building A Very Simple Web Site

Trns port Payroll XML File Import Guide. Prepared by the Minnesota Department of Transportation (Mn/DOT)

The document may be freely distributed in its entirety, either digitally or in printed format, to all EPiServer Mail users.

HEC-DSS Add-In Excel Data Exchange for Excel

IBM. Implementing SMTP and POP3 Scenarios with WebSphere Business Integration Connect. Author: Ronan Dalton

Building A Very Simple Website

OUTLOOK WEB APP (OWA): MAIL

Create a Google Site in DonsApp

Decreases the magnification of your chart. Changes the magnification of the displayed chart.

IBM Unica emessage Version 8 Release 6 February 13, User's Guide

LabVIEW Report Generation Toolkit for Microsoft Office User Guide

Hydrologic Modeling System HEC-HMS

Cache Configuration Reference

Merging Labels, Letters, and Envelopes Word 2013

Microsoft Word 2010 Tutorial

NETWRIX CHANGE NOTIFIER

Terms and Definitions for CMS Administrators, Architects, and Developers

Sharpdesk V3.5. Push Installation Guide for system administrator Version

SELF SERVICE RESET PASSWORD MANAGEMENT CREATING CUSTOM REPORTS GUIDE

Importing and Exporting With SPSS for Windows 17 TUT 117

Call Center Reports Customization Guide

Composite.Community.Newsletter - User Guide

Tagging an Existing PDF in Adobe Acrobat 8

Work with the MiniBase App

HTML. A computer network is a collection of computers linked through cables or wireless means.

Application Developer Guide

Create a Web Page with Dreamweaver

Avaya Network Configuration Manager User Guide

Bitrix Site Manager 4.1. User Guide

SelectSurvey.NET Developers Manual

for Sage 100 ERP Business Insights Overview Document

IBM Operational Decision Manager Version 8 Release 5. Getting Started with Business Rules

ART 379 Web Design. HTML, XHTML & CSS: Introduction, 1-2

Making Content Editable. Create re-usable templates with total control over the sections you can (and more importantly can't) change.

9 CREATING REPORTS WITH REPORT WIZARD AND REPORT DESIGNER

DocuShare User Guide

Configuring Active Directory with AD FS and SAML for Brainloop Secure Dataroom Setup Guide

Command-Line Tool for View Manager View Manager 4.0

Mail Merge Creating Mailing Labels 3/23/2011

ORACLE USER PRODUCTIVITY KIT USAGE TRACKING ADMINISTRATION & REPORTING RELEASE 3.6 PART NO. E

Novell ZENworks 10 Configuration Management SP3

Overview of DatadiagramML

Import and Output XML Files with SAS Yi Zhao Merck Sharp & Dohme Corp, Upper Gwynedd, Pennsylvania

Tutorial 5. Working with Web Tables

Hydrologic Modeling System HEC-HMS

Printing Bar Code and RFID Labels from Oracle

Menus and Toolbars: Using and customizing those common to all OpenOffice.org components

STATISTICAL SOFTWARE PACKAGE

Novell ZENworks Asset Management 7.5

Embed BA into Web Applications

BI Publisher in Oracle EBS R12: What it is, its evolution, and how to use it. Presented by: Bob Bullman, BizTech

WebSphere Business Monitor V7.0 Business space dashboards

Toad for Oracle 8.6 SQL Tuning

CRM Outlook Plugin Installation

REDUCING THE COST OF GROUND SYSTEM DEVELOPMENT AND MISSION OPERATIONS USING AUTOMATED XML TECHNOLOGIES. Jesse Wright Jet Propulsion Laboratory,

Ad Hoc Reporting. Usage and Customization

How to Schedule Report Execution and Mailing

Microsoft Word 2013 Tutorial

My IC Customizer: Descriptors of Skins and Webapps for third party User Guide

Microsoft Business Contact Manager Version 2.0 New to Product. Module 4: Importing and Exporting Data

Command Line Tool for View Manager View Manager 3.0

Microsoft Excel: Pivot Tables

Using Style Sheets for Consistency

FileMaker Server 10 Help

SQL Server 2005 Reporting Services (SSRS)

CDOT Monumentation Sheets

Configuring Web services

5.1 Features Denver CO 80202

Guide to PDF Publishing

LabVIEW Report Generation Toolkit for Microsoft Office

Software Package Document exchange (SPDX ) Tools. Version 1.2. Copyright The Linux Foundation. All other rights are expressly reserved.

Business Portal for Microsoft Dynamics GP User s Guide Release 5.1

Informatica PowerCenter Express (Version 9.5.1) Getting Started Guide

Introduction to XML Applications

Microsoft Excel Basics

One-Way ANOVA using SPSS SPSS ANOVA procedures found in the Compare Means analyses. Specifically, we demonstrate

Transcription:

Hydrologic Engineering Center Hydrologic Modeling System HEC-HMS Developing Reports Using Extensible Stylesheet Language December 2007 Approved for Public Release Distribution Unlimited

Hydrologic Modeling System HEC-HMS, Release Notes 2007. This Hydrologic Engineering Center (HEC) documentation was developed with U.S. Federal Government resources and is therefore in the public domain. It may be used, copied, distributed, or redistributed freely. However, it is requested that HEC be given appropriate acknowledgment in any subsequent use of this work. Use of the software described by this document is controlled by certain terms and conditions. The user must acknowledge and agree to be bound by the terms and conditions of usage before the software can be installed or used. For reference, a copy of the terms and conditions of usage are included in the User's Manual, Appendix D so that they may be examined before obtaining the software. This document contains references to product names that are trademarks or registered trademarks of their respective owners. Use of specific product names does not imply official or unofficial endorsement. Product names are used solely for the purpose of identifying products available in the public market place. 2

Introduction What is a Stylesheet? Version 3.1.0 of the Hydrologic Modeling System (HEC-HMS) added a new reporting capability. The capability has previously not been documented in the User's Manual or discussed in other documentation available for the program. Consequently it has been difficult for users to determine how this basic capability for producing formatted reports can be used. The reports can be generated for basin model data or for simulation run results. This document describes how the reporting tool works and how to create reports. A complete sample report is included as an example. Work is currently under way to replace the current capability with a superior capability. The Extensible Stylesheet Language (XSL) is designed to take a document in the Extensible Markup Language (XML) and transform it into a new type of document. A set of XSL instructions can be put in a file document and this is often called simply a "stylesheet." A XML document containing data is the input. A specialized processor takes the XML input data and uses the instructions in the stylesheet to create a new output file. The output file could be an XML file where the data has been formatted or modified in some way. The modifications are controlled by the instructions contained in the stylesheet. Alternately, the stylesheet could convert the XML data to some other format. One very common output format is Hyper Text Markup Language (HTML). The HTML language is by far the most common format for information displayed on the internet. Basin Model Created by User Within HEC-HMS XSL Stylesheet Created by User Using External Tools User Makes A Report Select a Basin Model Select a Stylesheet XML Data Source Temporary Copy of Basin Model Converted to XML Report Generation Internal Report Engine Combines XML and XSL Report Viewer Completed HTML Report in HEC-HMS Interface Figure 1. The user selects a basin model and stylesheet to create a report. HEC- HMS creates a copy of the basin model and converts it to XML format. An internal report engine takes the XML file and combines it with the stylesheet to create the formatted report. The report is displayed in a viewer. The process is similar for creating reports for simulation runs. 1

Creating a Stylesheet Use of stylesheets to produce reports within HEC-HMS is more limited than the very general capabilities of the stylesheet technology. The HEC-HMS program can produce a XML file containing all of the data in a basin model or all of the summary data in a simulation run. The XML file is created automatically and does not require any input from the user. The stylesheet must provide instructions for transforming the XML file into a HTML file. The HTML file is then displayed and can be printed. This process is shown in Figure 1. The most common use of reports is to create tables of parameter data from the basin model report, or tables of summary statistics from elements in a simulation run. Usually there will be one row in the table for each element. The parameter data or summary statistics will be shown in columns after the element name. Other layout choices could be made but are usually more difficult to implement. The stylesheet must be designed by the user to work with either the basin model data or simulation run summary data. The data from the original sources is automatically converted to temporary XML files by HEC-HMS. The conversion process does not require any input from the user. The XML files organize data in "tag" and "value" pairs. For example, the block of data for a subbasin begins with the tag "Subbasin" and is followed by a value, which is the subbasin name. Parameter data is included similarly. For example, the time to peak for a Snyder unit hydrograph has the tag of "snydertp" and the associated value is given in hours. In general the tag names are the same as what is used in the basin model file. (There is one file in the project directory for each basin model and the files all have the extension BASIN.) Tags are also nested. A subbasin element has certain tag-value pairs for general element data. There is also a tag-value pair for the loss rate method. Nested below the loss rate tag-value pair are additional tag-value pairs for each of the parameters in the loss rate method. The same nesting also is used for transform and baseflow data within the subbasin element. You will need a text editor in order to create a stylesheet. Within the text editor you must type the XSL instructions that will build the report. The only type of report that can be displayed within HEC-HMS is one using HTML formatting. Therefore, the XSL instructions must transform the input data from XML to HTML. Enter all the instructions you need to produce the report and save the file with the XSL extension. The stylesheet is then ready to test and use within HEC-HMS. Example Basin Model Report The example report for a basin model is designed to work with the Castro Valley example project that is distributed with HEC-HMS. It creates a table report showing the unit hydrograph parameters for the subbasins. The contents of the stylesheet are shown in Figure 2. The first two lines of the stylesheet are always the same regardless of its purpose. The main block that begins on the third line describes the table that will be constructed. If the basin model were called "Current," then the title of the table would be "Basin Model Current." The next portion configures the table columns for the subbasin name and Snyder unit graph parameters. Following next is the selection of each subbasin in the basin model, and extraction of the appropriate data for the unit graph parameters. At the end of the main block is a footer giving the date the data was last updated. Three additional, smaller blocks follow the main block. Each of these small blocks is used to format a cell in the table. 2

<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:hms="http://www.hec.usace.army.mil/software/hec-hms" > <xsl:template match="/hms:basin"> <p><b>basin Model "<xsl:value-of select="/basin/@name"/>"</b></p> <table border="1"> <tr> <th>subbasin</th> <th>snyder Tp</th> <th>snyder Cp</th> </tr> <xsl:for-each select="/basin/subbasin"> <tr> <xsl:apply-templates select="."/> <xsl:apply-templates select="./transform/snydertp"/> <xsl:apply-templates select="child::transform/snydercp"/> </tr> </xsl:for-each> </table> <p>current on date <xsl:value-of select="/basin/header/lastmodifieddate"/></p> <xsl:template match="subbasin"> <td><xsl:value-of select="@name"/></td> <xsl:template match="snydertp"> <td><xsl:value-of select="."/></td> <xsl:template match="snydercp"> <td><xsl:value-of select="."/></td> </xsl:stylesheet> Figure 2. Sample stylesheet for creating a report of Snyder unit hydrographs. The contents of the stylesheet shown in Figure 2 are very similar to HTML encoding. In fact they are essentially the same except that the stylesheet also includes XSL commands for finding and formatting data. The stylesheet interpreter included in the reporting engine internal to HEC-HMS makes a copy of the stylesheet. It then executes the XSL formatting commands and substitutes the results into the copy. The result is a HTML formatted document that can be viewed in a very simple web browser included within HEC-HMS. The browser only supports HTML Version 3.2 published in 1997. Virtually any HTML code can be included in the stylesheet as long as it conforms to the Version 3.2 standard. The results of using the stylesheet with the Castro Valley sample project are shown in Figure 3. 3

Figure 3. Sample basin model report as displayed in HEC-HMS. Generating a Report A report can be generated for any basin model or simulation run. The basin model report can include any of the data stored in the basin model file with a BASIN extension. A simulation run report can include any of the information from the summary table data for every element in the basin model. The following steps are used to obtain a report: 1. Create a stylesheet. You can use a text editor to create a file with the XSL extension. You can start by including the contents shown in Figure 2 as a starting point for your stylesheet. 2. Customize the stylesheet. You can customize it for data other than the Snyder transform by inspecting the basin model file. The data tags used in the basin model file are also used in creating the report. 3. Start HEC-HMS. Run the program to use the stylesheet. 4. Create a report. Go to the Tools menu and select the Reports menu, and then the Basin Model menu command. The selection window shown in Figure 4 will open. 5. Choose a basin model and stylesheet. Select the basin model which will be shown in the report. Also select the stylesheet you created in Steps 1 and 2. Press the View Report button to view the finished report, as shown in Figure 3. 4

The program will extract the data from the selected basin model and combine it with the stylesheet. The result will be a HTML document that is displayed in the interface. As shown in Figure 3, you can save the report as an HTML file or send it to a printer. Figure 4. Selecting a basin model and stylesheet to create a report. 5