You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by eugenebalt <eu...@yahoo.com> on 2011/07/29 18:03:47 UTC

Re: How to Integrate Wicket with Apache POI

It's very easy.

1) In your HTML:

# Export to Spreadsheet 

2) In your Java:

add(new DownloadLink("link", generateExcelFile());


The DownloadLink is a provided Wicket class. Note that generateExcelFile()
must return a File object. If the file already exists, you just read it. If
you need to create a spreadsheet in POI, I recommend something like this
utility method:

public void File generateExcelFile() {

   FileOutputStream fos = new FileOutputStream(new File("report.xls"));
   HSSFWorkbook wb = new HSSFWorkbook();
   
   //...

   wb.write(fos);
			
   fos.close();

}

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-Integrate-Wicket-with-Apache-POI-tp3704158p3704508.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to Integrate Wicket with Apache POI

Posted by eugenebalt <eu...@yahoo.com>.
Sorry; in the previous post, the HTML got rendered.

I meant to write,

1) In HTML:

a wicket:id="link" href="#"   (just create the standard HTML link)

2) In Java, use

add(new DownloadLink(link, file));



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-Integrate-Wicket-with-Apache-POI-tp3704158p3704512.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org