How to export JIRA report to multiple worksheets of excel?

Shantonu Hossain December 2, 2013

I am using JIRA report plugin to create a custom report where I want to export the report to excel file with multiple worksheets. I am able to export with single worksheet but can't export to multiple worksheets.

Here's my code for exporting to excel file:

public String generateReportExcel(ProjectActionSupport action, Map params) throws Exception 
    {
        this.validate(action, params);
        final StringBuilder contentDispositionValue = new StringBuilder();
        contentDispositionValue.append("attachment;filename=\"");
        contentDispositionValue.append(this.excelFileName).append(".xls\";");
        ActionContext.getResponse().addHeader("content-disposition", contentDispositionValue.toString());
        return descriptor.getHtml("excel", getVelocityParams(action, params));
    }

And my .vm fle for the report looks like this:

<table id="myTable" border="1" cellpadding="3"
cellspacing="1" width="100%">
	<tr class ="rowNormal">
		<td>Project</td>
		<td>$project<</td>
	</tr>
	<tr class ="rowNormal">
		<td>Version</td>
		<td>$version</td>
	</tr>
</table

I want to create a excel report with two worksheets where the $project variable is in one worksheet and the $version is in another. Does anyone have any idea?

Thanks in advance!

-Shantonu


1 answer

0 votes
Midori
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 21, 2014

Use the Better Excel Plugin and you can create Excel templates that contain any number of worksheets, and fill those with data. See this example with three worksheets, pivot table, pivot chart and real tabular data:

jira-excel-worksheets.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events