1 2 3 Previous Next 38 Replies Latest reply on Oct 23, 2007 7:16 AM by pmuir

    Excel support in Seam: any interest?

    mjek2

      Hi all,

      after looking at Seam PDF integration I started to play with a similar approach to generate Excel reports (first attempts look good).
      I know, it's actually not on the Seam roadmap right now but if there is any interest out there, I think it should be possible to make it work similar to Seam PDF. Thoughts?

      Regards,
      Mike

        • 1. Re: Excel support in Seam: any interest?
          gavin.king

          Yes, its interesting. :-)

          • 2. Re: Excel support in Seam: any interest?
            mjek2

            Hi Gavin,

            nice to hear ;)
            I've experimented with JExcel API (http://jexcelapi.sourceforge.net/). My first xhtml pages look like:

            <x:workbook xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:s="http://jboss.com/products/seam/taglib"
             xmlns:x="http://jboss.com/products/seam/xls">
            
             <x:sheet name="test1">
             <x:label row="0" column="0" text="header1"/>
             <x:label row="0" column="1" text="header2"/>
             <x:label row="1" column="0" text="value1"/>
             <x:label row="1" column="1" text="value2"/>
             </x:sheet>
             <x:sheet name="test2"/>
             <x:sheet name="test3"/>
            </x:workbook>
            

            It should be also easy to generate tables similar to Seam-PDF, various fonts, images, formulas, charts (limited).
            I also think that classes from org.jboss.seam.pdf (not from org.jboss.seam.pdf.ui) could be reused for the Excel stuff (we just need to add DocType.XLS("xls", "application/msexcel") to org.jboss.seam.pdf .DocumentData. Furthermore some basic and non PDF-specific functionality (processing facets etc.) could be probably reused as well.
            If it sounds feasible I could go on and add a Seam-XLS package with some examples.

            • 3. Re: Excel support in Seam: any interest?
              gavin.king

              Go for it, I'm pretty sure I would accept a contribution like this - as long as the code is nice ;-)

              • 4. Re: Excel support in Seam: any interest?
                mjek2

                cool, I'll do it! What steps do I have to follow if I want to contribute (or is there any how-to-contribute-wiki-page)?
                btw I'll be on vacation in SF area in the next 2 weeks (I'm not sure whether I catch the Seam&Hibernate meetup, but hey, now I know what to do during my 12-hours-flight ;)

                • 5. Re: Excel support in Seam: any interest?
                  monkeyden

                  I've been devising an application for some time now. One of my requirements is to have Excel as an output filetype. The moment I saw the PDF generation feature I thought of this requirement. I would definitely use it if it looks anything like the PDF code.

                  • 6. Re: Excel support in Seam: any interest?
                    mjek2

                    well, except for different/excel-specific tags, my feeling is that for the user it should be pretty much the same (i.e. minimum/no specific config, dynamic lists/tables etc.)

                    • 7. Re: Excel support in Seam: any interest?
                      monkeyden

                      exactly, I meant with the same ease of use.

                      • 8. Re: Excel support in Seam: any interest?
                        gavin.king

                        Create an issue in JIRA.

                        Attach any new files you write to it, along with diff format patches to any files you change.

                        And make sure you include an example application, based along the lines of the PDF example, so that we can see that it works ;-)

                        Cheers.

                        • 9. Re: Excel support in Seam: any interest?

                          I think Excel support is a great idea. How about something like this

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

                          I never used it, but I think that it lets you use a special data table tag that will export the data automatically. It is not JSF.

                          This could allow for general data tables to be exported without having to write another page to generate the file.

                          Is it possible to make this work with any JSF DataTable without having to code a special page for every list of data I want to be exported to Excel?

                          • 10. Re: Excel support in Seam: any interest?

                            Yes,
                            I've used displayTag and it's been great and I've always missed a similar for JSF. So how about creating s:dataTable which extends h:dataTable and adds support for
                            1) Exporting to CSV,XML,Excel,PDF
                            2) Sorting
                            3) Paging

                            I'd like to use those features from some of the already available JSF libraries like http://facestutorials.icefaces.org/tutorial/dataTable-tutorial.html , but unfortunately it's just too difficult and complex to use those 3rd party JSF stuff which you don't have full control of.

                            Anyone has any information whether next version of h:dataTable will add support for exporting, sorting or paging?

                            Maybe do both, x:worksheet etc just like in SeamPDF and then using that create s:dataTable for simple Excel export support. Then you could x: for more complex worksheets etc.

                            +1 for SeamX (x:)

                            Btw, does JExcel also work in non-windows OSes?

                            • 11. Re: Excel support in Seam: any interest?

                               


                              So how about creating s:dataTable which extends h:dataTable and adds support for
                              1) Exporting to CSV,XML,Excel,PDF
                              2) Sorting
                              3) Paging


                              Well, this is definitly not the way I would go. (As a matter of fact tomahawk has done some of the stuff but last time I looked at it it was chaotic).

                              What I would wish is a tag lib which really produces genuine excel files - including formulas, cell types, number formats. It would be ideal if one could use an original excel file as a "template". Then one would add pivot tables and nice little graphs to the tamplate, the user could specify some filters and aggragation levels and then the pivot data would be copied to the excel file.

                              This would make a LOT of controllers very, very happy.

                              Regards

                              Felix

                              • 12. Re: Excel support in Seam: any interest?
                                gavin.king

                                I agree with Felix.

                                • 13. Re: Excel support in Seam: any interest?
                                  spambob

                                  While this certainly sounds interesting I was wondering why you guys want to use MS Excel instead of OpenDocument file format (http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office#technical) ?

                                  Sure MS Office is widely spread but ODF is an international industry standard that is supported by a wide variety of applications (like OpenOffice) and doesn't lock you in with a file format thats just a pain in the ass if one doesn't use it with MS Office on MS Windows.

                                  So how about using ODF (which can be imported into MS Office too if it has to be) ?

                                  • 14. Re: Excel support in Seam: any interest?
                                    jazir1979

                                    I do love the idea of the PDF templating using facelets in Seam for doing up quick documents and e-mails -- but the idea of adding Excel support then leads to the plethora of other output formats that you can think of.. and does all that fluff (and re-inventing of the wheel) really belong in Seam?

                                    I think most people who need a large variety of output formats will settle on a more full-featured reporting framework anyway. So rather than putting Excel support into Seam, I think tools for integrating JasperReports or BIRT with Seam JSF pages would be much more helpful. Especially for customers who already may have a significant investment in jasper reports and want to now render them via a Seam web app?

                                    Thoughts?
                                    Daniel.



                                    1 2 3 Previous Next