Jump to content
We've recently updated our Privacy Statement, available here ×

Problem in displaying Data in Summary Band


shreelu11

Recommended Posts

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

 

Regards

Sreelekha

[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

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

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

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

 

Regards

Sreelekha

Link to comment
Share on other sites

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

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

ya you can assgin field value to variable based upon the condition

such 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}:null

i think this may help you

Link to comment
Share on other sites

ya you can assgin field value to variable based upon the condition

such 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}:null

i think this may help you

Link to comment
Share on other sites

Hi

Thanks 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..

 

Regards

Sreelekha

Link to comment
Share on other sites

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 none

in variable expression

type 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

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...