emrizwan Posted March 22, 2015 Posted March 22, 2015 Hi,I want to create a report with below format opening bal: 50DatePaind InPaid OutBalance01/01/15100 15002/01/15 4011003/01/15200 310Please can you help on how a report with such a format can be created using ireport?thanks
hozawa Posted March 23, 2015 Posted March 23, 2015 One way is to put the opening balance in a sub-report.
Solution rajesh.sirsikar Posted March 23, 2015 Solution Posted March 23, 2015 Hi emrizwan.Raul from this community had teh same issuehttp://community.jaspersoft.com/questions/844022/variable-initial-value-and-re-use-same-variableI have answered that in my blog herehttp://www.rajeshsirsikar.com/creating-running-total-in-jaspersoft-studio/Check and vote
rajesh.sirsikar Posted March 23, 2015 Posted March 23, 2015 Hi emrizwan. Check my comment below. Follow the steps in my blog and you will get what you need.If you find teh answer helpful. Upvote teh answer so taht otehr can get benifits.Thanks,rajesh
emrizwan Posted April 1, 2015 Author Posted April 1, 2015 Hi Rajesh, The data type of my columns are Decimal so I am using following expression in step 3 of your post. IF(DECIMAL_VALUE($F{txn_cr})==0,-DECIMAL_VALUE($F{txn_dr}),DECIMAL_VALUE($F{txn_cr})) when I run the report it throws below error Error filling print... Error evaluating expression : Source text : IF(DECIMAL_VALUE($F{txn_cr})==0,-DECIMAL_VALUE($F{txn_dr}),DECIMAL_VALUE($F{txn_cr})) net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : IF(DECIMAL_VALUE($F{txn_cr})==0,-DECIMAL_VALUE($F{txn_dr}),DECIMAL_VALUE($F{txn_cr})) at net.sf.jasperreports.engine.fill.JREvaluator.evaluateEstimated(JREvaluator.java:259) at net.sf.jasperreports.engine.fill.JRCalculator.evaluateEstimated(JRCalculator.java:580) Please can you advise? thanks
rajesh.sirsikar Posted April 2, 2015 Posted April 2, 2015 HI Emrizwan, I have used Integer_Values() function because my data from the datasource was in string and to perform my math calculation i had to convert it in to integer. But in your case, since it is decimal you need not add "Decimal_Value" (On top of it, I don't think there is any expression called Decimal_Value)..So just put your expression as follows IF($F{txn_cr})==0,-$F{txn_dr},$F{txn_cr}) Thanks, Rajesh S
calculate.machine Posted April 22, 2015 Posted April 22, 2015 To calculate the opening balance according to the amount of deposit and withdraw, you need to use the inter-row calculation which can be handled through Jasper expression. But the code is complicated and difficult to write. You can use esProc to work with Jasper and thus make this simpler. The esProc code is as follows:A1=file("D:\data.csv").import@t(;",")A2=result (t=43,A1.derive(t=t+Inputs-Outputs:Balance))See code explanation from http://blog.raqsoft.com/?p=3540 .
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