Re: export to excel AjaxFallbackDefaultDataTable

2011-02-01 Thread fachhoch

Now I want to export the same table in PDF , I did the export to excel using
apache POI, Now I have to export the same table to PDF. Is there any libray
which serves export to various formats ? 

 

I saw display Tag  

http://displaytag.sourceforge.net/10/export.html

it provides  export to pdf , xml , excel  , I am looking for  a similar
solution  , is there any way I can use the display tag to export from wicket
datatable ?

Please suggest me what are the available options to provide export to
various formats from a wicket datatable ?

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/export-to-excel-AjaxFallbackDefaultDataTable-tp3225458p3252116.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: export to excel AjaxFallbackDefaultDataTable

2011-02-01 Thread jcgarciam

See http://itextpdf.com/

On Tue, Feb 1, 2011 at 1:21 PM, fachhoch [via Apache Wicket] 
ml-node+3252116-297151156-65...@n4.nabble.comml-node%2b3252116-297151156-65...@n4.nabble.com
 wrote:

 Now I want to export the same table in PDF , I did the export to excel
 using apache POI, Now I have to export the same table to PDF. Is there any
 libray which serves export to various formats ?



 I saw display Tag

 http://displaytag.sourceforge.net/10/export.html

 it provides  export to pdf , xml , excel  , I am looking for  a similar
 solution  , is there any way I can use the display tag to export from wicket
 datatable ?

 Please suggest me what are the available options to provide export to
 various formats from a wicket datatable ?


 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://apache-wicket.1842946.n4.nabble.com/export-to-excel-AjaxFallbackDefaultDataTable-tp3225458p3252116.html
  To start a new topic under Apache Wicket, email
 ml-node+1842946-398011874-65...@n4.nabble.comml-node%2b1842946-398011874-65...@n4.nabble.com
 To unsubscribe from Apache Wicket, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=1842946code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=.





-- 
Sincerely,
JC (http://www.linkedin.com/in/jcgarciam)
--Anyone who has never made a mistake has never tried anything new.--

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/export-to-excel-AjaxFallbackDefaultDataTable-tp3225458p3253047.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: export to excel AjaxFallbackDefaultDataTable

2011-01-20 Thread fachhoch

Thanks for your reply , I tried using apache poi call the data provider get
data and create excel .
It works fine no problems.To download this excel I am using fileresource,the
file I provide to this is a temp file my excel util creates this temp file, 
after download I want  to clear the temp file , please suggest me how to
clean  up the temp file? . 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/export-to-excel-AjaxFallbackDefaultDataTable-tp3225458p3227903.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: export to excel AjaxFallbackDefaultDataTable

2011-01-20 Thread James Carman
Are you using a DownloadLink?

http://wicket.apache.org/apidocs/1.4/org/apache/wicket/markup/html/link/DownloadLink.html#setDeleteAfterDownload%28boolean%29



On Thu, Jan 20, 2011 at 11:26 AM, fachhoch fachh...@gmail.com wrote:

 Thanks for your reply , I tried using apache poi call the data provider get
 data and create excel .
 It works fine no problems.To download this excel I am using fileresource,the
 file I provide to this is a temp file my excel util creates this temp file,
 after download I want  to clear the temp file , please suggest me how to
 clean  up the temp file? .
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/export-to-excel-AjaxFallbackDefaultDataTable-tp3225458p3227903.html
 Sent from the Users forum mailing list archive at Nabble.com.

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



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



export to excel AjaxFallbackDefaultDataTable

2011-01-19 Thread fachhoch

I found some code to export datatable to   excel

here is the code


add(new LinkVoid(export){
@Override
public void onClick() {
getRequestCycle().setRequestTarget(new
ComponentRequestTarget(abstractDataTablePanel.getDataTable()){
@Override
public void 
respond(RequestCycle requestCycle) {
DataTable  
dataTable=(DataTable)getComponent();
DataGridView 
dataGridView = (DataGridView)
dataTable.get(body:rows);
final int 
oldRowsPerPage = dataGridView.getRowsPerPage();

dataGridView.setRowsPerPage (Integer.MAX_VALUE);

super.respond(requestCycle);

dataGridView.setRowsPerPage(oldRowsPerPage);

}
});
WebResponse wr = (WebResponse) 
getResponse();
wr.setContentType(application/vnd.ms-excel;
charset=UTF-8); 
wr.setCharacterEncoding(UTF-8);
wr.setHeader(content-disposition,
attachment;filename=excel.xls);   
}
});



on clicking the link   export works. After the  file is downloaded If I
click on any   pagination link for next page I get this error 


  WicketMessage: org.apache.wicket.WicketRuntimeException: component
dataTableContainer:form:dataTable:dataTable:topToolbars:1:toolbar:span:navigator:navigation:5:pageLink
not found


Please suggest me .  

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/export-to-excel-AjaxFallbackDefaultDataTable-tp3225458p3225458.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: export to excel AjaxFallbackDefaultDataTable

2011-01-19 Thread Jeremy Thomerson
On Wed, Jan 19, 2011 at 5:07 PM, fachhoch fachh...@gmail.com wrote:


 I found some code to export datatable to   excel

 here is the code


add(new LinkVoid(export){
@Override
public void onClick() {

  getRequestCycle().setRequestTarget(new
 ComponentRequestTarget(abstractDataTablePanel.getDataTable()){
@Override
public void
 respond(RequestCycle requestCycle) {
DataTable
  dataTable=(DataTable)getComponent();
DataGridView
 dataGridView = (DataGridView)
 dataTable.get(body:rows);
final int
 oldRowsPerPage = dataGridView.getRowsPerPage();

  dataGridView.setRowsPerPage (Integer.MAX_VALUE);

  super.respond(requestCycle);

  dataGridView.setRowsPerPage(oldRowsPerPage);
}
});
WebResponse wr = (WebResponse)
 getResponse();
wr.setContentType(application/vnd.ms-excel;
 charset=UTF-8);
wr.setCharacterEncoding(UTF-8);
wr.setHeader(content-disposition,
 attachment;filename=excel.xls);
}
});



 on clicking the link   export works. After the  file is downloaded If I
 click on any   pagination link for next page I get this error


  WicketMessage: org.apache.wicket.WicketRuntimeException: component

 dataTableContainer:form:dataTable:dataTable:topToolbars:1:toolbar:span:navigator:navigation:5:pageLink
 not found


 Please suggest me .


This is a horrible hack of a way to get this to work.  You're exporting HTML
as Excel, potentially with additional HTML around it, etc  I suspect
that the error comes because you changed the server-side state of the data
view, and there are now no pagination links - because everything is on a
single page.  Although you set the rows per page back to the old value,
doing it after the respond probably means that your change was lost.

To do export to Excel correctly, I'd suggest creating a link that does it
and uses the data provider directly.  It can use the data provider to get an
iterator for all rows in the data set and iterate through them.  It might be
able to use the column components (labels) to render the cell content,
although I personally wouldn't try that.  I'd have an interface that extends
IColumn that has a method for rendering to Excel.  By doing this, you can
iterate through your rows and your columns (IColumn) and render directly to
Excel.  Use one of the java/excel libraries to create the file.

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*