Jump to content

counter variables


samed

Recommended Posts

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi Samed,

 

Add a new variable and set:

 

 

Calculation Type = Sum

Variable Class Type = Integer

 

 

In the variable expression put your cirteria e.g.

 

 

($F{YEAR}.equals("1997"))?new Integer(1):new Integer(0)

 

 

The above example will add 1 for each row in the group where the year = 1997.

 

Add this variable to your report group footer.

 

Sean

Link to comment
Share on other sites

Hi Saen,

 

Many thanks for your help.

 

I tried also the code ($F{StateID}.intValue()==0)?new Integer($V{myCount}.intValue()+1):new Integer($V{myCount}.intValue())

Calculation Type = count

 

Best regards

samed

Link to comment
Share on other sites

Hi Saen,

Do you have any idea about this problem?

I have created 3 nested reports. The main report includes subreport1 which includes subreport2. When I run my Main Report with JRViewer it works and everything is ok but when I put my reports on the jasper server I noticed that the server could not find the last Report so I become the following error message:

 

net.sf.jasperreports.engine.JRRuntimeException:

net.sf.jasperreports.engine.JRException: Could not load object from location: subreport2.jasper

 

My question is: is it possible for the Jasperserver to recognize more than two level nested reports?

 

thanks

Link to comment
Share on other sites

Hi Samed,

 

Yes, JasperServer can recognise 2 nested reports, I have used this before. I think the problem you have may be related to the file/name of the resource you have uploaded. I notice in the error you have that JasperServer is looking for subreport2.jasper. When working with JasperServer you need to uploade .jrxml files (not .jasper files which are what you use with iReports). You need to modify the subreport1.jrxml file subreport element to use subreport2.jrxml.

 

 

Hope this helps.

 

 

Regards

 

 

Sean

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