I am using strut2-JSP to generate a report.In that report I am trying to skip displaying some rows in the table that has a specific “groupName” but need to include the information of that row while calculating the total in the column or in the row. ![My report roughly looks like the table below][1]
Group Name |Net Total
Multi_species category | $300
Multi_species category | $400
Multi_species category Subtotal | $700
But I have to display it as below:
Group Name |Net Total
Multi_species category Subtotal | $700
For example:I am trying to get rid of the row that has group name “Multi_species category” but like to keep the rows (“Multi_species category subTotal”) that calculating totals. Tried with an “if” condition inside the table that did not work . Please let me know what I am doing wrong. Here is my example code to generate this table :
<display:table id="reportTable"
name="tableData"
requestURI=""
cellspacing="0px"
export="true"
class="displaytagTable">
<display:setProperty name="decorator.media.pdf"
value="expenditures.decorator.ItextTotalSpeciesDecorator"/>
<c:if test="${ !( groupName == \"Multi_species category\") }">
<display:column title="Group Name" property="groupName" group="1"/>
<display:column title="Net Total" property="total" class="alignRight"
decorator="expenditures.decorator.DollarDecorator"
total="true"/>
</c:if>
</display:table>
Please let me know if more information is required.
Thanks in advance
Additionally, I am getting error at the line :
<c:if test="${ !( groupName == \"Multi_species category\") }">
– how should I compare string here?
I finally resolved this issue by adding a class to every column in that specific row and removed the parent of the columns. here is the link for the example:
How to remove a row from a table using JQuery
Thanks for trying to help me though.