Summarizing a field

0

Im having trouble creating a summary field in my report.  I have read through the guide and found some other post but none have resolved this for me.  I need this summary to either be a text field, or a seperate table however the table should only have 1 row with the summary data.  currently my summary table has multiples rows which is not right.

here is my report

This is what i get when i run it.  Take in mind this is just one page of the report there are multiples.  Also take in mind that the first table has multiples rows, and as you can see so does the second

table.  This is the issue.  My summary table (Account Total) should only be one row with the totals

I have 2 variables fueling this

  <variable name="TotalMinutes" class="java.lang.Integer" calculation="Sum">   <variableExpression><![CDATA[SUM($F{Minutes})]]></variableExpression>  </variable>  <variable name="TotalRates" class="java.lang.Double" calculation="Sum">   <variableExpression><![CDATA[SUM($F{Rate})]]></variableExpression>  </variable>

And here are those variables being assigned to their respective columns

     <jr:column width="100" uuid="49cf0069-c8bb-470a-a6ca-503765876094">      <jr:columnHeader style="Table_CH" height="30">       <staticText>        <reportElement x="0" y="0" width="100" height="30" uuid="f72ca0b9-653d-4711-9256-9dc666bb0fbb"/>        <box padding="2"/>        <textElement textAlignment="Center" verticalAlignment="Middle">         <font isBold="true"/>        </textElement>        <text><![CDATA[Minutes]]></text>       </staticText>      </jr:columnHeader>      <jr:detailCell style="Table_TD" height="30">       <textField isStretchWithOverflow="true" isBlankWhenNull="true">        <reportElement x="0" y="0" width="100" height="30" uuid="ed9bc872-2718-4a10-9b34-518affaa1e07"/>        <box padding="2"/>        <textElement textAlignment="Center" verticalAlignment="Middle"/>        <textFieldExpression><![CDATA[$V{TotalMinutes}]]></textFieldExpression>       </textField>      </jr:detailCell>     </jr:column>     <jr:column width="100" uuid="9dd38474-bdee-4b77-9a8c-bb19a7ad20ff">      <jr:columnHeader style="Table_CH" height="30">       <staticText>        <reportElement x="0" y="0" width="100" height="30" uuid="8d384cc3-21cd-4811-b785-b9e8376c086d"/>        <box padding="2"/>        <textElement textAlignment="Center" verticalAlignment="Middle">         <font isBold="true"/>        </textElement>        <text><![CDATA[Rate]]></text>       </staticText>      </jr:columnHeader>      <jr:detailCell style="Table_TD" height="30">       <textField isStretchWithOverflow="true" isBlankWhenNull="true">        <reportElement x="0" y="0" width="100" height="30" uuid="ca5b3e91-6a04-4c96-916c-9748ab42deeb"/>        <box padding="2"/>        <textElement textAlignment="Center" verticalAlignment="Middle"/>        <textFieldExpression><![CDATA[$V{TotalRates}]]></textFieldExpression>       </textField>      </jr:detailCell>     </jr:column>

I have tried changing the Increment Type to Report but that did not help (removed the summing it did and still made multiples rows in the table)

I also tried adding a text field then referencing the variables, but it does not have access to them (doesnt see them, out of scope appearently)

owen.gerig's picture
Joined: Aug 19 2014 - 9:59am
Last seen: 2 months 2 weeks ago

1 Answer:

0

The details band is processed for every row in your results. Your summary table needs to be moved to the Summary band. 

sfriedman's picture
Joined: Oct 22 2008 - 3:26am
Last seen: 6 years 3 months ago

Still the same results when moving this to the summary band

owen.gerig - 6 years 11 months ago
Feedback
randomness