[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3948) Excel attachment should be more user-friendly to create

Zoltan Tiringer (JIRA) jira-events at lists.jboss.org
Wed Feb 11 01:56:44 EST 2009

Excel attachment should be more user-friendly to create

                 Key: JBSEAM-3948
                 URL: https://jira.jboss.org/jira/browse/JBSEAM-3948
             Project: Seam
          Issue Type: Feature Request
          Components: Excel
    Affects Versions: 2.1.1.GA
            Reporter: Zoltan Tiringer

Excel attachments should be easy to create with syntax similar to that of PDF. I would like a syntax like this to work:
<m:attachment fileName="people.xls"><ui:include src="/mail-xls.xhtml" /> </m:attachment>
Workaround exists (thanks, Daniel): Define exportKey in <e:workbook> and then look it up from context after rendering excel content, then render mail content: 
                        DocumentData excelData = (DocumentData) Contexts.getEventContext().get("excelKey");

In mail definition the looked up DocumentData has to be referenced in the value property: <m:attachment fileName="people.xls" value="#{excelData}" contentType="application/vnd.ms-excel"/>

For testing purposes I attach a template that uses the Person class from the mail example:
<html xmlns="http://www.w3.org/1999/xhtml"

<e:workbook type="jxl">
    <e:worksheet name="People" value="#{people}" var="p">
            <f:facet name="left">
                The date is #date# and the time is #time#
        <e:column style="xls-column-autosize: true">
            <f:facet name="header">
                <e:cell value="First name" style="xls-font: red bold 10 Verdana"/>
            <e:cell value="#{p.firstname}" />
        <e:column style="xls-column-autosize: true">
            <f:facet name="header">
                <e:cell value="Last name" style="xls-font: red bold 10 Verdana"/>
            <e:cell value="#{p.lastname}" forceType="text"/>
        <e:column style="xls-column-autosize: true">
            <f:facet name="header">
                <e:cell value="Email" style="xls-font: red bold 10 Verdana"/>
            <e:cell value="#{p.address}"/>

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list