How to export JIRA report to multiple worksheets of excel?

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

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
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

302 views 0 1
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you