csilva2001 Posted September 14, 2007 Share Posted September 14, 2007 <variable name="SUM_TBLRECEITA_VALOR_1" class="java.lang.Double" resetType="Report" calculation="Sum"> <variableExpression><![CDATA[$F{TBLRECEITA_VALOR}]]></variableExpression> </variable> Hi! to all. In my report a variable Calculation Type:-Sum. In report I get 2 lines:line 1 = 750line 2 = 1170 but in my database I have:goup1 = 750group2 = 420 I try put resetType="Group" but I recei a error message:unknow reset group for variable.. Can you help me, please? An embrace,CarloSilva Link to comment Share on other sites More sharing options...
svenn Posted September 14, 2007 Share Posted September 14, 2007 Do you have a group band defined in your report? Reset type group will only reset a value if a specific group is defined. What band are you printing the total in? Link to comment Share on other sites More sharing options...
csilva2001 Posted September 16, 2007 Author Share Posted September 16, 2007 Hi. Thanks for response. I´m printing in detail band.How I define a band? Do you want I put .xml report here? Thanks again,CArloSilva Link to comment Share on other sites More sharing options...
nitin403 Posted September 17, 2007 Share Posted September 17, 2007 Hi!I use iReport to create my Report files.Create group e.g.abcd.In group expression of group keep the field name( the One which holds the values of 750 and 420)then try again.If that doesn't helps, then show/give me a sample of your database and the desire output then I might be able to give some clear solution. The error you got was because you have not difine any group.Try using iReport, you will be able to create faster and easily. Link to comment Share on other sites More sharing options...
csilva2001 Posted September 17, 2007 Author Share Posted September 17, 2007 Hi nitin403.My problem is in problem.jpg.Please, try help me. TBL1ID--------1----2---3------4-----5PRODUCT---2----1---1------2-----3PRICE-----25---32--55----30----20 TBL2ID-----------------------1------- 2---------3PRODUCT_NAME------MOUSE----PENCIL-----BOOK I WANT: MOUSE ------ 87,00 PENCIL------ 55,00 BOOK-------- 20,00 I hoop you understand. An embrace,Thanks Link to comment Share on other sites More sharing options...
nitin403 Posted September 17, 2007 Share Posted September 17, 2007 Are you using iReport? From what I see , this is not possible without using a group, also I don't know how are you using two table. First sort the datasource by "PRODUCT".Create a group called Product_Name.In group Footer keep the PRODUCT_NAME and a variable total describe previously keep its reset type to group and Reset group to PRODUCT.Hope that will help.Just for information, what type of datasource are you using. Link to comment Share on other sites More sharing options...
csilva2001 Posted September 18, 2007 Author Share Posted September 18, 2007 PERFECT!!!!!!!Thanks again.I use derby DB.An embrace. Link to comment Share on other sites More sharing options...
csilva2001 Posted September 18, 2007 Author Share Posted September 18, 2007 HI, nitin403.Is it possible get a SUM of: MOUSE ------ 87,00PENCIL------ 55,00BOOK-------- 20,00 TOTAL: 162,00? I need create other group? Pleas, how I do this TOTAL? Thanks Link to comment Share on other sites More sharing options...
nitin403 Posted September 18, 2007 Share Posted September 18, 2007 Hi! csilva2001Create another variable. Lets say "PRODUCT_TOTAL". The variable Expression keep "PRICE". Check the datatype of "$F{PRICE}" if it is string, then keep "new BigDecimal($F{PRICE})" //Assuming field name of PRICE as PRICE Keep calculation type as "sum" Reset Type as Report. And Increment Type as "none" I hope this will help. P.S. I don't know derby DB. Link to comment Share on other sites More sharing options...
csilva2001 Posted September 19, 2007 Author Share Posted September 19, 2007 Hi nitin403.This time, no works. I create a new variable as you tell me. Bust the result is different of correct sun.Some new idea? Note: derby is the JAVA DB. An embrace Link to comment Share on other sites More sharing options...
nitin403 Posted September 19, 2007 Share Posted September 19, 2007 I don't get why it is not working. Just send your jrxml file I will see why it is not working. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now