-
1. Re: export to pdf or excel from rich:dataTable
nickarls Aug 6, 2008 9:02 PM (in response to infinity2heaven) -
2. Re: export to pdf or excel from rich:dataTable
infinity2heaven Aug 7, 2008 12:19 AM (in response to infinity2heaven)1) i downloaded your seam-excel jar, jxl jar.
2) my page is as follows<h:form id="searchForm"> <a4j:outputPanel id="searchResults"> <h:panelGrid styelClass="panelLayout"> <rich:dataTable id="searchResultsTable" rows="10" columnClasses="col" value="#{fundsQuery.resultList}" var="fund" sortMode="single" rowKeyVar="row"> <!-- removed for brevity --> <rich:column> </rich:column> </rich:dataTable> <h:commandLink value="Export" action="#{org.jboss.seam.excel.excelExporter.export('searchForm:searchResultsTable')}"/> </h:panelGrid> </a4j:outputPanel> </h:form>
On click of export, I get the following error
18:13:39,187 INFO [STDOUT] H: null 18:13:39,187 INFO [STDOUT] V: null 18:13:39,187 WARN [JXLTemplates] Could not find cell template global, try 18:13:39,187 WARN [JXLTemplates] Could not find cell template data, try 18:13:39,187 WARN [JXLTemplates] Could not find cell template global, try 18:13:39,187 WARN [JXLTemplates] Could not find cell template data, try 18:13:39,187 WARN [JXLTemplates] Could not find cell template global, try 18:13:39,187 WARN [JXLTemplates] Could not find cell template data, try ... ... <same message 200 times>
and ie popup says
Cannot open file
Any hints?
-
3. Re: export to pdf or excel from rich:dataTable
nickarls Aug 7, 2008 7:49 AM (in response to infinity2heaven)Ignore the warning, it's a bug.
It looks like it can't hook up to the document store that serves the document. What is the URL it can't find? EAR or WAR deployment? What jboss-seam-* libraries do you include and where? Anything extra in components.xml?
-
4. Re: export to pdf or excel from rich:dataTable
danielc.roth Aug 7, 2008 9:11 AM (in response to infinity2heaven)Priya M : Try using an ordinary h:dataTable and see if that works. I'm not entirely sure rich:dataTable will work...
-
5. Re: export to pdf or excel from rich:dataTable
nickarls Aug 7, 2008 9:20 AM (in response to infinity2heaven)Should work. Catfight!
-
6. Re: export to pdf or excel from rich:dataTable
danielc.roth Aug 7, 2008 9:37 AM (in response to infinity2heaven)Cool. I just haven't found the parsing of the UIColumnGroup and UISubTable :-)
-
7. Re: export to pdf or excel from rich:dataTable
nickarls Aug 7, 2008 9:42 AM (in response to infinity2heaven)I'll open a feature JIRA and assign it to you. You can put the code in org.jboss.seam.excel.export.kitchensink. ;-)
-
8. Re: export to pdf or excel from rich:dataTable
danielc.roth Aug 7, 2008 9:43 AM (in response to infinity2heaven)Also please try without the ajax-stuff :-)
-
9. Re: export to pdf or excel from rich:dataTable
danielc.roth Aug 7, 2008 10:33 AM (in response to infinity2heaven)I have just tried something similar to what you have above, and it works. If you see any immediate differences, please post them.
xhtml
<h:form id="excelExport"> <a4j:commandButton value="Search" reRender="searchResults" action="#{excelTest.search}" /> <a4j:commandButton value="Clear" reRender="searchResults" action="#{excelTest.clear}" /> <a4j:outputPanel id="searchResults"> <rich:dataTable value="#{excelTest.result}" var="person" id="excelTable" columnClasses="left, right"> <rich:column> <f:facet name="header">Name</f:facet> <h:outputText value="#{person.name} #{person.lastName}"></h:outputText> </rich:column> <rich:column> <f:facet name="header">Age</f:facet> <h:outputText value="#{person.age}"></h:outputText> </rich:column> </rich:dataTable> <h:commandLink value="Export table" action="#{org.jboss.seam.excel.excelExporter.export('excelExport:excelTable')}" /> </a4j:outputPanel> </h:form>
javabean
@Name("excelTest") @Scope(ScopeType.SESSION) public class ExcelTest { private List<Person> people = new LinkedList<Person>(); public List<Person> getPeople() { List<Person> ret = new LinkedList<Person>(); for (int i = 0; i < 10; i++) { ret.add(new Person(i, "Janne_" + i, "Andersson" + i)); } return ret; } public List<Person> getResult() { return people; } public void search() { this.people = getPeople(); } public void clear() { this.people = new LinkedList<Person>(); } }
-
10. Re: export to pdf or excel from rich:dataTable
infinity2heaven Aug 7, 2008 5:11 PM (in response to infinity2heaven)I didn't test it in all browsers. The code works in firefox (3.x) but not in IE 6 or IE 7.
Now this really sucks.I'm wondering -- has this anything to do my app being SS: (https) as IE behaves differently for secure sites
-
11. Re: export to pdf or excel from rich:dataTable
nickarls Aug 7, 2008 9:24 PM (in response to infinity2heaven) -
12. Re: export to pdf or excel from rich:dataTable
infinity2heaven Aug 7, 2008 9:35 PM (in response to infinity2heaven)I dont see any relevance to your questions and the problem in hand. Perhaps you could suggest what could probably be wrong, since you wrote the code.
As for my webapp, I've restricted access to http (even if user access http, port 8080), it redirects to https, port 8443
-
13. Re: export to pdf or excel from rich:dataTable
infinity2heaven Aug 7, 2008 9:38 PM (in response to infinity2heaven)AS mentioned earlier, the code does work in firefox. I think you have an incredible component being developed for Seam 2.1. Just need to get the fine details sorted out with browser compatibilities
-
14. Re: export to pdf or excel from rich:dataTable
nickarls Aug 7, 2008 9:42 PM (in response to infinity2heaven)The generated excel data is presented by a redirect to a DocumentStore (same one which is used by pdf generation). I'm trying to determine if something goes wrong in the redirect.