Jira Server plugin export data to a PDF or Excel file

Hi I am creating a Jira Server plugin (using the Atlassian SDK) and was wondering how to generate and export data to a PDF or Excel file? Similar to the ‘Export’ functionality seen on the Issue Viewer but where I can define the data within the files rather than just exporting issues. Any help or advice is greatly appreciated!

Hi Kishen,

With Jira Server plugin I did it similarly, generate html table that is served with application/vnd.ms-excel content-type.

But you may find libraries to generate native Excel, actually.

Thank you.

1 Like

Apache POI API and PDFbox API is 3rd-libraries for to do these. POI it self is hard to get work and it’s latest version will not work with Jira.

 <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.9</version>
            <scope>compile</scope>
        </dependency>
		<dependency>
           <groupId>org.apache.poi</groupId>
           <artifactId>poi-ooxml</artifactId>
           <version>3.9</version>
		   <scope>compile</scope>
        </dependency>
		<dependency>
           <groupId>org.apache.poi</groupId>
           <artifactId>poi-ooxml-schemas</artifactId>
           <version>3.9</version>
		   <scope>compile</scope>
        </dependency>
		<dependency>
           <groupId>org.apache.xmlbeans</groupId>
           <artifactId>xmlbeans</artifactId>
           <version>2.6.0</version>
	       <scope>compile</scope>
        </dependency>
<dependency>
	      <groupId>xml-apis</groupId>
	      <artifactId>xml-apis</artifactId>
	      <version>2.0.2</version>
		  <scope>compile</scope>
        </dependency>
		<dependency>
	       <groupId>xerces</groupId>
	       <artifactId>xercesImpl</artifactId>
	       <version>2.11.0</version>
		   <scope>compile</scope>
        </dependency>
		<dependency>
	       <groupId>stax</groupId>
	       <artifactId>stax-api</artifactId>
	       <version>1.0.1</version>
		   <scope>compile</scope>
        </dependency>
		<dependency>
     	  <groupId>org.apache.pdfbox</groupId>
          <artifactId>pdfbox</artifactId>
          <version>1.7.1</version>
		  <scope>compile</scope>
       </dependency>

And you must uncomment this line in atlassian-plugin.xml

  <!-- <component-import key="pluginController" interface="com.atlassian.plugin.PluginController"/> -->

Have you checked out these apps that do precisely what you’re trying to build?

  1. Better PDF Exporter
  2. Better Excel Exporter