13 Replies Latest reply on Apr 24, 2008 10:29 AM by nickarls

    Excel support

    nickarls

      Since Seam already has PDF support through iText, would it be out of scope (or technically possible?) for the framework to have Excel support through JExcelAPI? Something that would make an Excel document out of e: tags and an 2D-Object-array.


      Is there any interest in such stuff?

        • 1. Re: Excel support

          There is always this thingy one could use in datatables:


          http://myfaces.apache.org/sandbox/excelexport.html


          However, copy/paste the seam email/pdf package and just do about the same shouldn't be that hard. I'll gladly develop something like that for seam, as soon as all my major deadlines (in March) are history :-)

          • 2. Re: Excel support
            nickarls

            Cool! How do you vision the structure? Something (simplified) like


            
              <e:workbook value="#{data}">
            
                <e:workbookSettings/>
            
                <e:worksheet name="First sheet"
            
                  <e:sheetSettings/>
            
                  <e:column>
            
                    <f:facet name="header"/>
            
                    <e:cell data=">
            
                      <e:cellFeatures/>
            
                      <e:cellFormat/>
            
                    </e:cell>
            
                  </e:column>
            
                  ...
            
                </e:worksheet>
            
              </e:workbook>
            
            



            ?

            • 3. Re: Excel support
              nickarls

              In any case, the structure is more fixed than PDF so I think it would be possible to expose more features.


              I'm somewhat familiar with JExcelAPI but haven't written a custom tag in my life so if you get as far as accessing the data, I might be able to help.

              • 4. Re: Excel support
                baz

                Here is my personal opinion for your question:


                It would be very, very nice and appreciated if a normal datatable could be exported to csv data.
                That should have priority, but i believe that such an behaviour should be implemented outside of seam (richfaces, or directly by the jsf ri)


                That is exactly was s:excelExport is doing.
                But i can not imagine any usecase where it is useful to have iText duplicated for Excel.



                In any case, before downloading the data we will have to present the data to the user, so that he can decide if he wants to get it.



                In the rare cases, where we only deliver the csv file we are dealing directly with the csv api. However, in this cases we could imagine to use such an extension if it exists.


                Ciao,

                Carsten

                • 5. Re: Excel support
                  pmuir

                  This comes up occasionally as a feature request, and whilst it's not on the priority list for us, if it came in as a community contribution, we would certainly find the time to review and commit it I think!

                  • 6. Re: Excel support
                    norman

                    I thought someone already opened a JIRA for this, but I guess not.  I agree with Pete, if someone wants to contribute the work, I'm sure we'd be happy to use it.

                    • 7. Re: Excel support

                      Btw, AFAIK, if you just change the content type to 'application/vnd.ms-excel' IE (since this is vendor specific) should be able to automatically import xhtml in excel. Would this work for you?

                      • 8. Re: Excel support
                        mono

                        Hi Niklas,


                        Another option to work with Excel files:
                        I have used Apache POI API to read content from a db query and then put it on an excel file. It works very good and is easy to use.
                        I think you can use it, calling a method from a command button.
                        I have some examples, and ther are more in the FAQ section in the project homepage.
                        May be this is more complicated than the myface's solution... i don't know... :)



                        • 9. Re: Excel support
                          nickarls

                          That it one option but my experience is that JExcelAPI is ahead when it comes to performance and memory usage and I have never seen any proof otherwise.

                          • 10. Re: Excel support
                            nickarls

                            I think that doing that would enable you to dump CSV straight into Excel too but I'm not fond of doing browser tricks (I got the idea that IE is not that popular around here).


                            And I don't think fonts, formatting etc would be available through that path. If it's going to be done it might as well be done as complete as possible.


                            One option could perhaps be writing it in OpenWorkbook or whatever the MS XML format was called but I'm not aware of any good libraries for it and last time I checked there was some licensing restrictions for writing them.

                            • 11. Re: Excel support

                              Well we had pretty good results with jspx+struts....

                              • 12. Re: Excel support
                                nickarls

                                In the absence of PM:s on this forum:


                                Daniel, kan du maila mig på nickarls*gmail.com så kan vi bolla med lite idéer?

                                • 13. Re: Excel support
                                  nickarls