1 2 3 Previous Next 38 Replies Latest reply on Oct 23, 2007 7:16 AM by pmuir Go to original post
      • 15. Re: Excel support in Seam: any interest?
        gavin.king

         

        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?


        It's not like this stuff needs to be deeply integrated into the Seam core, its just an add-on jar, no big deal. That doesn't count as bloat, IMO.

        I think most people who need a large variety of output formats will settle on a more full-featured reporting framework anyway.


        The trouble is that reporting tools like these are kindof a world unto themselves, and its difficult to seamlessly integrate their capabilities into the flow and look and feel of your application. Plus its a totally alien programming model to learn. (Usually, done by some "reporting guy" on the project.) I think its highly useful to have some limited set of reporting capabilities available in the web framework.

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

          Hi all,

          thank you very much for all your feedback. The number of posts shows that many people would like to have excel integration.


          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.

          Very interesting idea, and I think it would be possible with JExcel (but needs some additional config, e.g. where to store templates to use)

          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.

          I can only partially agree with it: sure, excel is proprietary, but it's a de-facto standard, whether we like it or not (and yes, I use OpenOffice too ;). And AFAIK OpenDocument file format is rather complex (and JExcel is rather simple and hence can be integrated faster). But in future one could certainly think about ODF as well.

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

          JExcel generates xls file format (not csv), so if your browser can handle application/msexcel MIME type it should work in non-windows as well.

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

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

          Interesting, but at first sight it seems to me to be more export than reporting functionality, i.e. it exports the exact content of your dataTable. OTOH reporting is something dynamic, report data can be produced by some business logic components without a need to be rendered as a dataTable. But I will look at this more detailed, thank you for the link!

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

            @Gavin: I'll try to enhance my x-taglib now in order to create some non-trivial example (e.g. something like Seam PDF example). Then I'll create a JIRA issue and submit it there, ok?

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

              Just one more note about templates: actually it should be possible to load them as application resources (or even from a URL?) i.e. without additional configuration.

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

                ok ;)

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

                   

                  "mjek2" wrote:
                  ... I can only partially agree with it: sure, excel is proprietary, but it's a de-facto standard, whether we like it or not (and yes, I use OpenOffice too ;). And AFAIK OpenDocument file format is rather complex (and JExcel is rather simple and hence can be integrated faster). But in future one could certainly think about ODF as well. ...

                  Sorry, I misunderstood you! I'm fine with "good old excel", I just thought you mean the new MS xml format - which spec is about 4000 pages so ODF (~700 pages) seems rather small.
                  I just had a look at the ODF spec and the tables part doesn't seem this much complex - so if you could keep it in mind it should be quite painless to integrate it as soon as some nice java library is available. ;)

                  Anyway: thanks for the effort & good luck

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

                    Fair enough -- it's very true that these tools are a world unto themselves and require a fair investment in building the report designs. If Seam can provide some of this stuff without requiring a reporting framework, then that's great.

                    In my experience in the enterprise java space, our teams have never had the luxury of a "reporting guy" and we've always had to just make things work either doing our own custom thing (ouch!) or using Jasper Reports (I've found BIRT is not yet ready for prime time).

                    Jasper is not so hard to integrate into a web app, I have it working now with a custom JSF component that lets you input parameters and preview the report, keeping a JasperPrint object in its state so you can then export to any output type over the web at the click of an h:commandButton, without re-running the report query and rendering phases.

                    Jasper supports inline EJB3 QL queries now, although I still find that the only truly flexible way is to run the query in your code and provide a custom JRAbstractBeanDataSource implementation (as outline for Hibernate in http://www.hibernate.org/79.html).

                    I suppose both approaches (more output options in Seam, and some integration with Jasper) would add value, I'm just trying to give another perspective :)

                    great work on all this stuff guys!
                    Daniel.

                    "gavin.king@jboss.com" wrote:
                    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?


                    It's not like this stuff needs to be deeply integrated into the Seam core, its just an add-on jar, no big deal. That doesn't count as bloat, IMO.

                    I think most people who need a large variety of output formats will settle on a more full-featured reporting framework anyway.


                    The trouble is that reporting tools like these are kindof a world unto themselves, and its difficult to seamlessly integrate their capabilities into the flow and look and feel of your application. Plus its a totally alien programming model to learn. (Usually, done by some "reporting guy" on the project.) I think its highly useful to have some limited set of reporting capabilities available in the web framework.


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

                      Just to clarify: Jasper is fine for reporting. That's it. You define the design of a report and then the numbers and some formating is converted to Excel.

                      But in my company (and I guess everywhere else, too) people do not want simple preformated reports. They want to be able to work with the data, analyze, move columns around. This is not really possible in Jasper.

                      I think there are at least three huge advantages in having that taglib:

                      1.) Currently we use odbc datasources in Excel documents a lot. But this means that we pass database passwords around which is not really nice. And there is no really flexible way to specify filters on queries within excel documents.

                      2.) We are deling with the 65000 Row limit every day - even less for Pivot tables. If Excel is withdrawing data directly we usually have to get them at the lowest level so they can be aggregated by Excel pivot.

                      If I had a taglib we could just ask the user what aggregation he wants and then he would download a file with just the data he needs.

                      3.) If the templating thing would work then I could offload the design and creation of reports to the controllers themselves. They would just send me a version of there Excel file exactly as they would like to see it and tell me which data they want to be copied in there. No time wasted on "beautifying" things.

                      @mjek2: If there is anything I can contribute I would be glad to do so. I have some expreience with JExcelApi. Have you some code to share?

                      Regards

                      Felix

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

                        Felix,

                        I have already some code and would be glad to share it with you. As soon as I return from vacation (in about 2 weeks) I can share it. I also think that if templates work we should handle them as first priority.

                        Regards,
                        Mike

                        • 24. Re: Excel support in Seam: any interest?
                          krica

                          Mike,

                          This would be a most welcome feature! Almost every application we build has extensive reporting requirements, and these are *always* Excel reports. Not OpenOffice and not CrystalReport but Excel straight from the app.

                          • 25. Re: Excel support in Seam: any interest?
                            awhitford

                            I'd like to add my two cents...

                            First off, I agree that a displaytag equivalent is a great idea! Sometimes a simple solution is the best. And I too have searched for a JSF equivalent to displaytag. I would love to see Seam (or one of the Faces sister projects) provide something like this.

                            As far as creating true Excel sheets (similar to creating PDF), that would also be a nice feature. But the simpler displaytag case whereby a user can export a grid into Excel is a higher priority for me that I would expect to use more frequently.

                            For what it is worth, I have been using a simple strategy for several years now to create an Excel file: simply create an HTML page and specify the content type to be "application/vnd.ms-excel". In ColdFusion, there is a cfcontent tag:

                            <cfcontent type="application/vnd.ms-excel">
                            And Java/JSP has a similar mechanism (see javax.servlet.ServletResponse.setContentType). The neat thing about the HTML import is that a lot of formatting is maintained. I've even managed to build formulas and Pivot Tables via HTML.


                            • 26. Re: Excel support in Seam: any interest?
                              premheiko

                              Hi all,

                              I followed these steps, but it did not work. It comes a empty HTML page and no Error in the log file .

                              "mjek2" wrote:
                              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.


                              can someone help me ??

                              where can I Seam-XLS package find ?

                              thx.

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

                                Hi,

                                so what is the current status of this excel-export feature. Is it working already and included in any Seam-release?

                                I´m going to propose Seam for a new project now and I know that it´ll be of great benefit if I can tell them, that excel-export is no problem with Seam (would I would like to do).

                                Any update on this topic would be highly appriciated.

                                Thomas

                                • 28. Re: Excel support in Seam: any interest?
                                  gvl

                                  I quite like the idea proposed by the jXLS project (http://jxls.sourceforge.net). That is to have excel templates that already have the formats and formulas defined and just replace data into predefined areas.

                                  This I am already using with Seam for very simple excel reports.
                                  --
                                  George

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

                                    Tanks for posting that link!

                                    It looks definitly like a project that is worthwhile to check out.

                                    Regards

                                    Felix