-
15. Re: Excel for Seam preview
chris.simons May 28, 2008 3:51 PM (in response to nickarls)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 May 28, 2008 8:36 PM (in response to 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 Jun 2, 2008 7:22 PM (in response to nickarls)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 Jun 2, 2008 9:45 PM (in response to 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 Jun 3, 2008 2:49 AM (in response to nickarls)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 Jun 3, 2008 10:41 AM (in response to nickarls)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 Jun 3, 2008 11:32 AM (in response to nickarls)Yes the autodetect for types is still quite crude, I'll play around with it some more...
-
22. Re: Excel for Seam preview
danielc.roth Jun 3, 2008 10:25 PM (in response to nickarls)I knew I missed some types :)
-
23. Re: Excel for Seam preview
nickarls Jun 4, 2008 8:30 AM (in response to 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 Jun 5, 2008 10:47 PM (in response to nickarls)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 Jun 6, 2008 7:28 AM (in response to nickarls)Aah, silly handling of null data, a new version can be found here
-
26. Re: Excel for Seam preview
nickarls Jun 8, 2008 9:51 PM (in response to 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 Jun 11, 2008 9:46 AM (in response to nickarls)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 Jun 12, 2008 9:22 PM (in response to nickarls)I didn't see a link to the JIRA so I am posting it here.
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 Jun 13, 2008 8:47 AM (in response to 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).