shreelu11 Posted September 29, 2007 Share Posted September 29, 2007 hi I have payment type field and amount field which is displayed in detail band. I have a variable for Sub total in Group band .My problem is that i have to calculate Total Cash and Total Credit separately in summary band..which i am not able to do it.....Any suggestions will be helpful Please refer to attached file for refrence RegardsSreelekha [file name=Monthly_Sales_Summary_By_Payment_Mode.pdf size=1815]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/Monthly_Sales_Summary_By_Payment_Mode.pdf[/file]Post edited by: shreelu11, at: 2007/09/29 11:42 Link to comment Share on other sites More sharing options...
svenn Posted October 1, 2007 Share Posted October 1, 2007 You need four vaiables to do this 1. Total cash group which would be a sum of cash reset at your group. 2. Total credit group which would be a sum of your credits reset at your group. 3. Total cash report which would be a sum of cash reset at report. 4. Total credit report which would be a sum of your credits reset at report. Link to comment Share on other sites More sharing options...
shreelu11 Posted October 3, 2007 Author Share Posted October 3, 2007 hi I tried your suggestions but the total cash variable reset at group gets reset for every record as records are grouped by payment date. ie for a particular date cash and credit payments are displayed. it will display for the no. of days the user pefers. At last in the summary band i have to calculate the total cash and total credit how do i do this.... Any suggestions will be helpful RegardsSreelekha Link to comment Share on other sites More sharing options...
burasami Posted October 4, 2007 Share Posted October 4, 2007 create a variable for total credit as Grand_Total_Credit as set calculation type as sum.. set reset type and increment as none..display the Grand_total_credit on summary band and right click text field and select properties-->text field tab.. in default its now.. you select as band.. do the same for total cash.. i think this may work Link to comment Share on other sites More sharing options...
shreelu11 Posted October 5, 2007 Author Share Posted October 5, 2007 hi I tried your suggestion but it din't work ... I like to know if it is possible to have two report queries one for the detail band and another for summary band. or is it possible to assign field value to a variable only if some condition is true. Regards,Sreelekha.Post edited by: shreelu11, at: 2007/10/05 08:48 Link to comment Share on other sites More sharing options...
burasami Posted October 5, 2007 Share Posted October 5, 2007 i think you can't have two queries in same report. but you can have as sub report. sorry i don't know about assign a field vaule based upon condition.. i will try this and tell you.. if you found out please inform Link to comment Share on other sites More sharing options...
burasami Posted October 6, 2007 Share Posted October 6, 2007 ya you can assgin field value to variable based upon the conditionsuch as create a variable and set your data type..set calculation type as nothing,set reset type and increment type as none..In vaiable expression write as follows$F{Field_name}.doubleValue()>100?$F{Field_Value}:nulli think this may help you Link to comment Share on other sites More sharing options...
burasami Posted October 6, 2007 Share Posted October 6, 2007 ya you can assgin field value to variable based upon the conditionsuch as create a variable and set your data type..set calculation type as nothing,set reset type and increment type as none..In vaiable expression write as follows$F{Field_name}.doubleValue()>100?$F{Field_Value}:nulli think this may help you Link to comment Share on other sites More sharing options...
shreelu11 Posted October 8, 2007 Author Share Posted October 8, 2007 HiThanks for your suggestions.but nothing seems to be working out for my senario.I designed a sub report which displays Paytype Description and Total amount in the detail band using report query.I placed my sub report in the summary band of my master report but i got error while filling the report . Code:Error filling print... Error loading object from file : E:Program FilesJavaJboss-Eclipse-1.6.0workspacePOSsrcwebrootreportsMonthly SummaryMothlySalesSummaryByPaymode_sub.jrxml net.sf.jasperreports.engine.JRException: Error loading object from file : E:Program FilesJavaJboss-Eclipse-1.6.0workspacePOSsrcwebrootreportsMonthly SummaryMothlySalesSummaryByPaymode_sub.jrxml at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:92) at net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java:257) at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:303) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:274) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:400) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummarySamePage(JRVerticalFiller.java:818) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummary(JRVerticalFiller.java:752) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportEnd(JRVerticalFiller.java:240) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:116) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:751) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:679) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:601) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:517) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:773) at java.lang.Thread.run(Unknown Source) Caused by: java.io.StreamCorruptedException: invalid stream header at java.io.ObjectInputStream.readStreamHeader(Unknown Source) at java.io.ObjectInputStream.<init>(Unknown Source) at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:87) ... 15 more Print was not filled. Try using an EmptyDataSource... When compiled with empty DataSource i got the same error. i don't know what to do .. I also tried checking the field Paytype Description which is displayed in detail band of my master report.If it is Cash then i want to assign the field Amount to variable total_cash. so sum of total_cash will give me grand total of cash.I don't know if this is possible Any suggestions will help.. RegardsSreelekha Link to comment Share on other sites More sharing options...
burasami Posted October 9, 2007 Share Posted October 9, 2007 i think your sub report path is problem..you should give the path without space or blank..i have noted that space between "E:Program Files"and "Monthly Summary" so try to give path without space..create a variable called "total_cash".. set calculation type as nothing.. set reset type and increment as nonein variable expressiontype as$F{paytype}.equals("Cash")?$F{field_amount}:null note:try string "Cash" may be case senstive or it should be equal to paytype whether it may be upper or lower case 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