myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mrfarhankhan <mrfarhank...@yahoo.com>
Subject Re: Export datatable to excel problem with pagination
Date Wed, 05 Nov 2008 05:37:44 GMT

Actually i am using JSF 1.2, and downloaded the latest Tomahawk and sandbox
1.1.7 libs. But i did not find any exportActionListener component in the
sandbox. So ???

Farhan !


Cagatay Civici wrote:
> 
> Instead of this,
> 
> Try the exportActionListener, so you dont need to write any java code:)
> 
> http://myfaces.apache.org/sandbox/tlddoc/index.html
> 
> showDisplayedPageOnly attribute tunes the amount of data to be exported.
> 
> It also support pdf and excel exporting.
> 
> Cheers,
> 
> Cagatay
> 
> On Tue, Nov 4, 2008 at 2:05 PM, mrfarhankhan <mrfarhankhan@yahoo.com>
> wrote:
> 
>>
>> I am using the following code. Am i missing something ?
>>
>> <h:commandLink action="#{manageCountriesBB.exportHtmlTableToExcel}">
>>  <h:outputText value="Export table to Excel" />
>> </h:commandLink>
>>
>> public void exportHtmlTableToExcel() {
>>
>>                String filename = "test.xls";
>>
>>                // Setup the output
>>                String contentType = "application/vnd.ms-excel";
>>                FacesContext fc = FacesContext.getCurrentInstance();
>>                HttpServletResponse response = (HttpServletResponse) fc
>>                                .getExternalContext().getResponse();
>>                response.setHeader("Content-disposition", "attachment;
>> filename="
>>                                + filename);
>>                response.setContentType(contentType);
>>
>>                // Write the table back out
>>                try {
>>                        PrintWriter out = response.getWriter();
>>                        out.print(htmlBuffer);
>>                        out.close();
>>                } catch (IOException ex) {
>>                        spage.processException(ex);
>>                }
>>                fc.responseComplete();
>>        }
>>
>>
>>
>> ===================================================================
>>
>>
>> Cagatay Civici wrote:
>> >
>> > Are you using the export actionlistener?
>> >
>> > On Tue, Nov 4, 2008 at 9:33 AM, mrfarhankhan <mrfarhankhan@yahoo.com>
>> > wrote:
>> >
>> >>
>> >> Hi !
>> >>
>> >> I am following the following link to export my datatable to excel
>> >> http://wiki.apache.org/myfaces/Exporting_DataTable_To_MS-Excel
>> >>
>> >> The problem is that I am using pagination with the table but the excel
>> >> file
>> >> only contains the rows that are currently being displayed in the
>> >> datatable.
>> >> I want all the rows to be exported.
>> >>
>> >> Looking for a solution
>> >> Thanks in advance
>> >> Farhan !
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Export-datatable-to-excel-problem-with-pagination-tp20318897p20318897.html
>> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Export-datatable-to-excel-problem-with-pagination-tp20318897p20322901.html
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Export-datatable-to-excel-problem-with-pagination-tp20318897p20336432.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Mime
View raw message