> I have a collection that contains the following data:
> EmpId   CourseId        Date_Taken      Assessment
> 1234    1               01/01/2000      PASS
> 1234    2               01/02/2001      PASS
> 1234    4               01/05/2002      PASS
> 1234    1               01/04/2003      PASS
> 1432    1               01/06/2002      PASS
> 1432    2               01/08/2004      PASS
> 1432    1               01/06/2004      PASS
> 
> I would like to display the data as follows:
> EmpID: 1234
> CourseID        Date_Taken      Assessment
> 1               01/01/2000      PASS
> 1               01/04/2003      PASS
> 2               01/02/2001      PASS
> 4               01/05/2002      PASS
> EmpID:1432
> 1               01/06/2002      PASS
> 1               01/06/2004      PASS
> 2               01/08/2004      PASS
> 

How about <logic:iterate/>
First you have to sort your collection on EmpID, then 

<bean:define id="id" value="0" />
<table border="1" style="border-collapse:collapse;" bordercolor="#336699">
<logic:iterate id="employee" name="employeeCollection">
        <logic:notEqual name="employee" property="id" value="<%=id%>">
        <tr><td colspan="3">
        EmpID: <bean:write name="employee" property="id" />
        </td></tr>
        <tr><td>CourseID</td><td>Date_Taken</td><td>Assessment</td></tr>
        <%id = 
String.valueOf(((Employee)pageContext.getAttribute("employee")).getId());%>
        </logic:notEqual>
        <logic:equal name="employee" property="id" value="<%=id%>">
                <tr><td><bean:write name="employee" property="courseId" /></td><td>
                <bean:write name="employee" property="dateTaken" /></td><td>
                <bean:write name="employee" property="assessment" /></td></tr>
        </logic:equal>
</logic:iterate>
</table>

Where employeeCollection has the collection of employees,

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to