Microsoft Office 2000 supports Hypertext Markup Language (HTML) as a native file format. Allowing Microsoft Excel to save and open HTML files as spreadsheets with all the document formatting preserved. The document can be formatted through a combination of HTML, XML and Cascading Style Sheets (CSS).
The format of the excel output from JIRA can be modified by editing the template file searchrequest-excel-header.vm (located within src/etc/java/templates/plugins/searchrequestviews/ of your JIRA home folder). Editing this file is essentially editing a HTML template file with tables and styles.
By default the template file searchrequest-excel-header.vm should contain:
The above formats the default excel output to have the page orientation as landscape, and multi-lined text will be kept within one cell.
Further examples are provided below.
Microsoft Office HTML and XML Reference
Microsoft Office HTML and XML reference contains a thorough listing of available styles and details on how to use them. The reference manual is available for download from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoffxml/html/ofxml2k.asp
Example 1 - Customising Page Setup
Excel uses CSS and @page definitions to store some page setup settings and XML to store others. Below is a sample to setup the page with the following document format respectively.
- Set page orientation as landscape (default is portrait)
- Set the top, right, bottom and left margins as .75in .25in .75in .25in respectively
- Set header margin as .5in
- Set footer margin as .4in
- Set a custom footer displaying page number, date and time all centered.
Example 2 - Customising Cell Formatting
Both CSS and HTML are used to customise the cells. A global style that is applied to all table cells can be applied using TD definition.
The above applies the following styles to all table cells respectively:
- Sets the number format of all table cells as general
- Horizontally aligns the text in the cell to the left
- Vertically aligns the text in the cell to the middle
- Set the text color to be red