Jump to content
Changes to the Jaspersoft community edition download ×

By Group report running total that starts with 0


michaela.camson

Recommended Posts

Hi everyone;

I've posted this question a week ago yet still unsolve. So i'm trying to post again hope to get more answers. 

My Problem is about how to set the variable first Group Total Column equals to 0. 0 should be fix it should be display as the first Group Total and the second Group Total will just be 0 + the sum of the 1st principal of the items.  

Sample: 

Items                Principal

a.                               10

b.                                 2

Sub Total                   0

c.                                 4

d.                                6

Sub Total                 12

e.                                15

Sub Total                  22

Please Help! ! !

Thank you for the help in advance

Michaela

 

 

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Hi Michaela, After some struggle I realized it is complicated to get the data the way you have described. But In teh attached report I have cretaed most probable two types of total fields. 1) Items Principal a. 10 b. 2 Sub Total 0 c. 4 d. 6 Sub Total 10 e. 15 Sub Total 25 OR 2) Items Principal a. 10 b. 2 Sub Total 12 c. 4 d. 6 Sub Total 22 e. 15 Sub Total 37 Please find attached report.

Link to comment
Share on other sites

Hi thank you so much for the answer.

 

But it didn't work for me i added 3 variable the Group No, TotalAdd , and the Variable 1. I followed your steps but then the answer came out to be the whole total of the sum of principal and it didn't starts with zero.

 

What Do you think the problem is?

 

Thanks for the help, Any help is greatly appreciated.

 

Michaela

Link to comment
Share on other sites

    Hi Rajesh,

 

Thank you so much for responding. And thank you so much for the help..

Anyway this is the variable I made...  

<variable name="NetProceed1" class="java.lang.Long" resetType="Group" resetGroup="Loan Date" calculation="Sum">

<variableExpression><![CDATA[$F{Net Proceed}]]></variableExpression>
</variable>
<variable name="Variable_1" class="java.lang.Long" resetType="Group" resetGroup="Loan Date" calculation="Sum">
<variableExpression><![CDATA[$V{NetProceed1}.intValue()]]></variableExpression>
<initialValueExpression><![CDATA[0.00]]></initialValueExpression>
</variable>
<variable name="GroupNo" class="java.lang.Integer" resetType="Group" resetGroup="Loan Date" calculation="Count">
<variableExpression><![CDATA[$F{Loan Date}]]></variableExpression>
<initialValueExpression><![CDATA[0.00]]></initialValueExpression>
</variable>
<variable name="Variable_2" class="java.lang.Integer" resetType="Group" resetGroup="Loan Date" calculation="Sum">
<variableExpression><![CDATA[iF(EQUALS($V{GroupNo},1),0,$V{NetProceed1}.intValue())]]></variableExpression>
</variable>
<group name="Loan Date">
<groupExpression><![CDATA[$F{Loan Date}]]></groupExpression>
</group>
</subDataset>
<queryString language="SQL">
 
 
Link to comment
Share on other sites

And then in Subtotal

 

NetProceed1 = 40 690.00 This One is correct that value is the sum of the first group.

Variable_1 = 704, 066.00

Variable_2 = 702,836.00

Group No = 34 the group number is counting the items and not the group...

 

 

What do you think is the Problem?

 

Thanks A lot for the help.. It is greatly appreciated

 

Best regards,

Michaela

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...