1 2 3 4 Previous Next 96 Replies Latest reply on Jan 26, 2011 6:32 AM by carsi Go to original post
      • 15. Re: Excel for Seam preview

        Sweet.  Looks really good - thanks for keeping everyone up to speed with what you're working on.


        Have you gotten any word on when this functionality might be included in the Seam distribution?  Maybe 2.1GA?


        I've been meaning to work with your preview functionality but have since been focusing on deploying our Seam app on OC4J 10.1.3.3.  Once that is figured out ( if I ever do ) I will be implementing your Excel features first thing.

        • 16. Re: Excel for Seam preview
          nickarls

          The JIRA has it targetted for 2.1BETA1. Of course it may change. Or the Seam Gods might throw out the code altogether once they have a look at it ;-)

          • 17. Re: Excel for Seam preview
            oneilltg

            Hello,
            I'm having trouble getting jboss and seam setup to use the excel libraries. I apologize if this is a lame question...


            I put jboss-seam-excel.jar into my jboss lib.
            I put jxl.jar into a place that causes it to get included in my WAR. I start up jboss, no problem. Then
            I try to go to my login page, and I can't get there. I get an underlying exception of:


            Caused by: java.lang.NoClassDefFoundError: org/jboss/seam/navigation/Pages


                 at org.jboss.seam.excel.DocumentStorePhaseListener.beforePhase(DocumentStorePhaseListener.java:30)


                 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)


                 at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)



            I'm  using jboss 4.2 and seam 2.0.1GA



            Any advice on how to get this running?


            Thanks,
            Tom

            • 18. Re: Excel for Seam preview
              nickarls

              Hmm, sounds like a classloading issue. Tried putting jboss-seam-excel.jar, jboss-seam-ui.jar and jxl.jar into the WEB-INF\lib directory?

              • 19. Re: Excel for Seam preview
                oneilltg

                That solved it, though I now have the jboss-seam-excel jar file in both my jboss lib and my war file. I'll worry about that later though.


                I'm creating spreadsheets (from my java code) with basic formatting. Very easy, and very nice. The examples in Write.java are great! Tomorrow I'll try to create spreadsheets via xhtml.


                Thanks,
                Tom

                • 20. Re: Excel for Seam preview
                  jazzmann

                  Hi,


                  this is just what i needed to code XLS output in our seam app.



                  I tried to use data of type Short or an Enumeration


                  package de.bafz.aveq.types;
                  
                  public enum PlotStatus {
                      Marker,
                      Project,
                      ...
                  }



                  This won't work. The errors are i.e.


                  java.lang.ClassCastException: java.lang.Short



                  Now i'm using a Wrapper to convert it to Integer and it works


                  <e:cell value="#{projectmethodologyBacking.shortIntegerWrapper(plot.id.lane)}" />



                  It would be nice to use Shorts, enums and so on as simple as Strings or Integers.


                  Have a nice day
                  Alexander

                  • 21. Re: Excel for Seam preview
                    nickarls

                    Yes the autodetect for types is still quite crude, I'll play around with it some more...

                    • 22. Re: Excel for Seam preview

                      I knew I missed some types :)

                      • 23. Re: Excel for Seam preview
                        nickarls

                        It was more my mistaking of using cast to String instead of o.toString() that prevented sensible default behaviour.


                        The new version can be downloaded here.


                        It should support Boolean, Byte, Short, Character, String, Long, Float, Double, BigDecimal, BigInteger, enum and Object plus their primitive counterparts, where applicable.


                        The new version also supports direct export of datatables based on component ID. Custom css supported:


                             <h:form id="f">
                                  <h:dataTable value="#{personList.personList}" var="person" id="t" 
                                       style="xlsFontName : Times New Roman; xlsFontSize.header : 12; xlsFontSize.data : 10; 
                                       xlsBackgroundColor.foo : red; xlsAlignment.bar : centre; xlsColumnWidths:*,800">
                                       <h:column>
                                            <f:facet name="header">
                                                 <h:outputText value="First name"/>
                                            </f:facet>
                                            <h:outputText value="#{person.firstName}"/>
                                       </h:column>
                                       <h:column style="xlsWidth : 400;">
                                            <f:facet name="header">
                                                 <h:outputText value="Last name"/>
                                            </f:facet>
                                            <h:outputText value="#{person.lastName}"/>
                                       </h:column>
                                       <h:column>
                                            <f:facet name="header">
                                                 <h:outputText value="Age" style="xlsTemplates : bar"/>
                                            </f:facet>
                                            <h:outputText value="#{person.age}" style="xlsTemplates : foo;"/>
                                       </h:column>
                                  </h:dataTable>
                                  <h:commandLink value="X" action="#{org.jboss.seam.excel.excelExporter.export('f:t')}"/>
                             </h:form>
                        



                        (and currently that example covers the entire documentation on the subject) ;-)

                        • 24. Re: Excel for Seam preview
                          jgilbert

                          Awesome! I was giving it a spin and got the exception below.


                          It works fine with type="csv" but not when I switch to jxl.


                          Any ideas?




                          Caused by java.lang.NullPointerException with message: "" 
                          org.jboss.seam.excel.jxl.JXLExcelFactory.createCell(JXLExcelFactory.java:604)
                          org.jboss.seam.excel.jxl.JXLExcelWorkbook.addCell(JXLExcelWorkbook.java:260)
                          org.jboss.seam.excel.jxl.JXLExcelWorkbook.addItem(JXLExcelWorkbook.java:501)
                          org.jboss.seam.excel.ui.UIColumn.encodeBegin(UIColumn.java:136)


                          • 25. Re: Excel for Seam preview
                            nickarls

                            Aah, silly handling of null data, a new version can be found here

                            • 26. Re: Excel for Seam preview
                              nickarls

                              Actually, there might be off-by-ones after null data. This version should be better. Bad test data didn't reveal it :-/

                              • 27. Re: Excel for Seam preview
                                jazzmann

                                Now, it works fine with the newest one.


                                Thanks a lot.
                                Alexander



                                Nicklas Karlsson wrote on Jun 08, 2008 21:51:


                                Actually, there might be off-by-ones after null data. This version should be better. Bad test data didn't reveal it :-/

                                • 28. Re: Excel for Seam preview
                                  www.supernovasoftware.com

                                  I didn't see a link to the JIRA so I am posting it here.


                                  JBSEAM-2896


                                  I noticed this is marked fix for 2.1.0.BETA1.


                                  Does this mean that is will be totally incompatible with the 2.0 branch?

                                  • 29. Re: Excel for Seam preview
                                    nickarls

                                    We've developed it against 2.0 so at least it's working now.


                                    Of course, there might be some breakage later on if the DocumentStore delivery mechanism is changed at some point but keeping it compatible shouldn't be that hard(tm).

                                    1 2 3 4 Previous Next