Advanced Customization > Business Logic Customization > Report Generation > Customization Details > Customizing the Report Output Format > Stylesheets Provided
  
Stylesheets Provided
One technique for customizing the output format is to modify one of the XSLT stylesheets that are provided in <Windchill>/codebase/templates/reports/. These stylesheets are described in detail in the following table.
* 
Within fields that specify an XSLT stylesheet in the Windchill UI, you must enter file paths that are relative to <Windchill>/codebase/. For example, excel97WebQuery.xsl must be referenced as "templates/reports/excel97WebQuery.xsl"
XSLT Stylesheet
Standard Format Name
Description
identity.xsl
XML
Performs the identity transformation on the XML query results; that is, it outputs the XML input.
csvFormat.xsl
CSV (Comma Separated Variable)
Produces comma-separated-values format (useful for reading into spreadsheets, and so forth).
tsvFormat.xsl
TSV (Tab Separated Variable)
Produces tab-separated-values format (useful for reading into spreadsheets, and so forth).
simpleHtmlForm at.xsl
HTML
Produces a simple HTML format. Unlike the other HTML formats provided, this format does no extra formatting on numeric columns.
htmlWithSorting .xsl
HTML (with sorting)
Similar to simpleHtmlFormat.xsl except that sorting is provided through hyperlinks on the column headers.
htmlWithMerging .xsl
HTML (with merging)
Similar to simpleHtmlFormat.xsl except that vertically duplicated cells are merged under certain conditions. This is a time-consuming transformation compared to the others provided.
sortedHtmlAsXM L.xsl
Produces the same results as htmlWithSorting.xsl except that the output is well-formed XML rather than traditional HTML, and the results contain additional non-HTML attributes. This is to facilitate application of further XSLT transforms (for example, mergeHTMLCells.xsl) to the result.
mergeHTMLCell s.xsl
Merges cells in HTML (which must be well-formed XML) similar to htmlWithMerging.xsl. Additionally, the input must have extra attributes annotations. This stylesheet is not intended for use directly on the query result XML. Instead, when applied to the results of sortedHtmlAsXML.xsl, the overall effect is to produce HTML with both sorting and merging.
msw2000ls.xsl
Microsoft Word 2000 HTML (Landscape)
Produces a simple HTML format containing Microsoft Word 2000 metadata. When the result is dropped onto Microsoft Word 2000, the originally specified margins, table borders, and so on are preserved. Also, decimal tab stops are specified on floating point data columns. The result has landscape page orientation.
msw2000p.xsl
Microsoft Word 2000 HTML (Portrait)
Same as msw2000ls.xsl except the result has portrait page orientation.
xslfo.xsl
PDF
Produces XSL Formatting Objects, an XML-based standard for high-precision page layout (see http://www.w3.org/TR/xsl). This is referred to as PDF format in standard format lists because the default is to post-process this format to dynamically produce PDFs. This is done through Apache FOP (see http://xml.apache.org/fop) and is controlled by the following user preference:
/wt/query/report/template/postprocmap/appl ication/xslfo+xml
This format is currently limited by the capabilities of FOP (for example, column widths must be provided rather than being computed from contents) and will improve in the future as FOP improves.
excel97WebQuer y.xsl
Produces a version of Excel Web Query (.iqy) format compatible with both Excel 97 and higher. This Excel format records the URL from which the spreadsheet data came, and can refresh the data from the URL periodically or on demand. For best results with Excel 2000, set the MIME type for Excel Web Query (IQY) files to be application/x-excel-web-query; on downland, this format is then automatically loaded into Excel 2000 only. With Excel 97, you must save the downloaded file and select it from within the Excel 97 'Run Web Query...' command.
excel2000WebQ uery.xsl
Produces a version of Excel Web Query (.iqy) format compatible only with the Excel version currently supported with Windchill. (For details about which third party products are supported, reference the Windchill Software Matrices.)
It uses a new feature in Excel Web queries to attempt to preserve the formatting in the spreadsheet rather than that in the HTML URL data source.
barChart.xsl
llineChart.xsl
pieChart.xsl
scatterChart.xsl
Produce various types of charts corresponding to their names. The first result column is assumed to contain labels and the rest are assumed to contain chart data. Output is initially produced as SVG (Scalable Vector Graphics), a standard XML-based vector graphics format (see http://www.w3.org/TR/svg). Because this format requires a client viewer (for exampe, Adobe's free SVG Viewer available at http://www.adobe.com/svg/viewer/install/main.html), the default is to post-process this format to rasterize the SVG into JPEG. SVG, JPEG, or PNG output formats can be selected by the following user preferences:
/wt/query/report/template/postprocmap/ima ge/svg+xml
/wt/query/report/template/postprocmap/svg Rasterizer/rasterFormat
includes/linker.xsl
Provides an XSLT template, generateURLHref, that is used by the provided HTML and XSL FO formats to produce hyperlinks to Windchill objects from XML result nodes that contain additional attribute information provided by the query layer when entire Windchill objects are selected. Object, version, e-mail, and content download links are currently supported.
includes/excelWe bQueryBase.xsl
The shared implementation behind excel97WebQuery.xsl and excel2000WebQuery.xsl. This stylesheet allows stylesheets which include it to specify the relative URL of an XSLT stylesheet that produces HTML tables. The produced Excel Web Query then obtains its data by executing the report (again) but using the specified HTML table format. Thus, by changing this HTML format, one can change the data that appears in Excel as a result of this Web query. Currently both excel97WebQuery.xsl and excel2000WebQuery.xsl use simpleHtmlFormat.xsl.
includes/chart.xsl
The shared implementation behind barChart.xsl, lineChart.xsl, pieChart.xsl, and scatterChart.xsl. This stylesheet works by using Apache Batik (see http://xml.apache.org/batik) on the server to capture JChart graphics as SVG and optionally rasterize them. Note that custom charts and graphics can easily be captured as well by implementing wt.query.template.Chartable interface and replacing "wt.query.template.ChartCreater" in this file with the name of the custom Chartable implementation.
includes/msw200 0.xsl
The shared implementation behind msw2000ls.xsl and msw2000p.xsl. The page size, margins, and orientation are all specified as inputs. This stylesheet is intended solely for inclusion from other stylesheets.
includes/htmlWit h SortingBase.xsl
The shared implementation behind htmlWithSorting.xsl and sortedHtmlAsXML.xsl. This stylesheet is intended solely for inclusion from other stylesheets.
includes/localize String.xsl
Provides an XSLT named template (that is, a macro) for localizing strings. The implementation uses an XSLT extension function to call back into Java to access Java resource bundles. This stylesheet is intended solely for inclusion from other stylesheets.
includes/urlEnco de.xsl
Provides an XSLT named template for URL encoding. The implementation uses an XSLT extension function to call WTURLEncoder.encode in Java. This stylesheet is intended solely for inclusion from other stylesheets.
Due to the template-based nature of XSLT, some modifications can be made to the provided stylesheets based almost solely on a knowledge of the intended output format (such as HTML). For example, the provided formats that use CSS1 stylesheets generate the references to these files using the following lines in the XSLT stylesheets:
<link rel="stylesheet" type="text/css"
href="{$windchill}/templates/reports/htmlFormat4Screen.css"
media="screen"/>

<link rel="stylesheet" type="text/css"
href="{$windchill}/templates/reports/htmlFormat4Print.css"
media="print"/>
The only part of these lines that is not strictly HTML is the portion within the { } braces which, though similar to JavaScript expression usage, is actually an XSLT XPath expression. In this case, the expression is referencing the variable windchill, which was previously assigned the URL of the Windchill codebase.