Excel file in Jira Timesheet plugin is not getting downloaded in right way ?

Hi ,

In Jira Timesheet gadget and report plugin , excel downloaded from report is carrying the name "ConfigureReport!excelView.jspa" instead of excel file name.

Is it fixed or the bug is still there ?

Regards,

Dipti Ranjan Behera

3 answers

1 accepted

This is just a 4 LOC thing and it is taking so much time to fix .

You can always try fixing it yourself if you know where the problem is - probably /jira/secure/views/browser/report-excel.jsp

@Boris,

The problem is not in the report-excel.jsp but in timesheetreport java class.

In method : 'generateReportExcel()' of above report class , the excel file name can be set.

So no solution in that case :(

in that method , the report response we can set 'content-disposition' header parameter with the excel file name.

Content-Disposition: attachment; filename="fname.ext"

Hi @Dipti,

How do you think excel file name can be set in generateReportExcel()? I will do this.

Thank you.

@andriy,

Please use this method :

public String generateReportExcel(ProjectActionSupport action, Map params) throws Exception {
		validate(action, params);
		
		//call to process the report logic with selected paramters
		Map velocityParams = processRequest(action, params);
		StringBuilder contentDispositionValue = new StringBuilder(50);
		
		//Appending xls file extension with the report name
		contentDispositionValue.append("attachment;filename=\"");
		contentDispositionValue.append(getDescriptor().getName()).append(".xls\";");
		
		HttpServletResponse response = ActionContext.getResponse();
		response.addHeader("content-disposition", contentDispositionValue.toString());
		
		//Associating processed report data with excel VM context
		return descriptor.getHtml("excel", velocityParams);
	}

Cool, thank you a lot from me and many others missing this, I've commited the fix for next update: 8366f85

Version 2.7.9 with the fix is released.

@Boris,

The problem is not in the report-excel.jsp but in timesheetreport java class.

In method : 'generateReportExcel()' of above report class , the excel file name can be set.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,888 views 12 18
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot