Re: [jasperreports-questions] running many queries in a report?

2006-04-25 Thread Manfred Moser
Sorry for not answering yesterday. Raffi details what I suggested in good 
detail. The rest should be no problem with the API and the guide.


manfred

 S, Mohamed Raffi (Mohamed) wrote:

Check out the Custom DataSource section, if there is any.
Basically you need to implement the JRDataSource and do your stuff in there
and return a collection of Maps.
Jasper Engine will use that for the report rendering.
Don't forget to declare Fields and Parameters as required.

Regards,
Raffi
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Dan Adams
Sent: Monday, April 24, 2006 11:49 PM
To: [EMAIL PROTECTED]
Cc: jasperreports-questions@lists.sourceforge.net
Subject: Re: [jasperreports-questions] running many queries in a report?


Sorry, If I'm kind of new to this, but could you elaborate on getting
the datasource to run the queries and put them in parameters? I have the
jasper ebook and have read through it so I can reference that if need
be.

On Mon, 2006-04-24 at 11:03 -0700, Manfred Moser wrote:

Dan Adams wrote:

I have a report I want to do that, while it runs one main query, needs
to run many other small queries where it really only cares about getting
one result from the query (such as a count or average). How is this done
without creating a ton of subreports that don't print anything and just
return a result?

You can just set parameters with these values. Just get your data source
to run 
all the queries and put the results in different parameters. If you use 
subreports or not is a different issue.


manfred






--
Manfred Moser - [EMAIL PROTECTED]
CardioComm Solutions Inc.
201-3060 Cedar Hill Rd.
Victoria  BC V8T 3J5 Canada
Phone: (250) 744 1822 Ext. 230
Fax: (250) 744-1866
http://www.cardiocomm.com



---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
jasperreports-questions mailing list
jasperreports-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions


RE: [jasperreports-questions] running many queries in a report?

2006-04-25 Thread Dan Adams
I'm sorry, could you elaborate on that a bit? Or point me to an example?
Thanks for your help.

On Tue, 2006-04-25 at 10:19 +0530, S, Mohamed Raffi (Mohamed) wrote:
 Check out the Custom DataSource section, if there is any.
 Basically you need to implement the JRDataSource and do your stuff in there
 and return a collection of Maps.
 Jasper Engine will use that for the report rendering.
 Don't forget to declare Fields and Parameters as required.
 
 Regards,
 Raffi
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of
 Dan Adams
 Sent: Monday, April 24, 2006 11:49 PM
 To: [EMAIL PROTECTED]
 Cc: jasperreports-questions@lists.sourceforge.net
 Subject: Re: [jasperreports-questions] running many queries in a report?
 
 
 Sorry, If I'm kind of new to this, but could you elaborate on getting
 the datasource to run the queries and put them in parameters? I have the
 jasper ebook and have read through it so I can reference that if need
 be.
 
 On Mon, 2006-04-24 at 11:03 -0700, Manfred Moser wrote:
  Dan Adams wrote:
   I have a report I want to do that, while it runs one main query, needs
   to run many other small queries where it really only cares about getting
   one result from the query (such as a count or average). How is this done
   without creating a ton of subreports that don't print anything and just
   return a result?
  
  You can just set parameters with these values. Just get your data source
 to run 
  all the queries and put the results in different parameters. If you use 
  subreports or not is a different issue.
  
  manfred
  
  
  
-- 
Dan Adams
Software Engineer
Interactive Factory
617.235.5857



---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
jasperreports-questions mailing list
jasperreports-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions


Re: [jasperreports-questions] running many queries in a report?

2006-04-25 Thread Manfred Moser

At some stage in the code you will fill the report eg. with

JasperFillManager.fillReport(jr, reportParameters,   
dataSource);

All you have to make sure is that the reportParameters contains all the values 
from your queries in a Map.


Eg. with totalCount 100

and that your jrxml references the parameter with $P{totalCount}. Use a text 
field in iReport but change from $F to $P ...


Test it out with a hardcoded Map first and then fill the map from your data.

Manfred


Dan Adams wrote:

I'm sorry, could you elaborate on that a bit? Or point me to an example?
Thanks for your help.

On Tue, 2006-04-25 at 10:19 +0530, S, Mohamed Raffi (Mohamed) wrote:

Check out the Custom DataSource section, if there is any.
Basically you need to implement the JRDataSource and do your stuff in there
and return a collection of Maps.
Jasper Engine will use that for the report rendering.
Don't forget to declare Fields and Parameters as required.

Regards,
Raffi
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Dan Adams
Sent: Monday, April 24, 2006 11:49 PM
To: [EMAIL PROTECTED]
Cc: jasperreports-questions@lists.sourceforge.net
Subject: Re: [jasperreports-questions] running many queries in a report?


Sorry, If I'm kind of new to this, but could you elaborate on getting
the datasource to run the queries and put them in parameters? I have the
jasper ebook and have read through it so I can reference that if need
be.

On Mon, 2006-04-24 at 11:03 -0700, Manfred Moser wrote:

Dan Adams wrote:

I have a report I want to do that, while it runs one main query, needs
to run many other small queries where it really only cares about getting
one result from the query (such as a count or average). How is this done
without creating a ton of subreports that don't print anything and just
return a result?

You can just set parameters with these values. Just get your data source
to run 
all the queries and put the results in different parameters. If you use 
subreports or not is a different issue.


manfred






--
Manfred Moser - [EMAIL PROTECTED]
CardioComm Solutions Inc.
201-3060 Cedar Hill Rd.
Victoria  BC V8T 3J5 Canada
Phone: (250) 744 1822 Ext. 230
Fax: (250) 744-1866
http://www.cardiocomm.com



---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
jasperreports-questions mailing list
jasperreports-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions


Re: [jasperreports-questions] running many queries in a report?

2006-04-25 Thread Dan Adams
Well, in my report I'm going to have one main list of rows which is no
big deal, but then for each row there are a couple other values that I
need to print where each value is the result a different query
(complicated ones with multiple joins and such). Would that still make
sense here? I understand about passing simple values as parameters but I
need to execute different queries based on values in each row. Would it
make sense to have my scriptlet execute queries and store the results
for each row? An example of one of the queries that needs to run would
be something like this:

SELECT COUNT(*)
FROM Factsheet fs, Site site, School school, StudentHit sh
WHERE sh.type = 'factsheet' AND sh.contentId = fs.id
AND sh.site_id = site.id
AND site.id = school.site_id
AND school.size = 1
AND site.id != 239


On Tue, 2006-04-25 at 08:40 -0700, Manfred Moser wrote:
 At some stage in the code you will fill the report eg. with
 
 JasperFillManager.fillReport(jr, reportParameters,   
 dataSource);
 
 All you have to make sure is that the reportParameters contains all the 
 values 
 from your queries in a Map.
 
 Eg. with totalCount 100
 
 and that your jrxml references the parameter with $P{totalCount}. Use a text 
 field in iReport but change from $F to $P ...
 
 Test it out with a hardcoded Map first and then fill the map from your data.
 
 Manfred
 
 
 Dan Adams wrote:
  I'm sorry, could you elaborate on that a bit? Or point me to an example?
  Thanks for your help.
  
  On Tue, 2006-04-25 at 10:19 +0530, S, Mohamed Raffi (Mohamed) wrote:
  Check out the Custom DataSource section, if there is any.
  Basically you need to implement the JRDataSource and do your stuff in there
  and return a collection of Maps.
  Jasper Engine will use that for the report rendering.
  Don't forget to declare Fields and Parameters as required.
 
  Regards,
  Raffi
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] Behalf Of
  Dan Adams
  Sent: Monday, April 24, 2006 11:49 PM
  To: [EMAIL PROTECTED]
  Cc: jasperreports-questions@lists.sourceforge.net
  Subject: Re: [jasperreports-questions] running many queries in a report?
 
 
  Sorry, If I'm kind of new to this, but could you elaborate on getting
  the datasource to run the queries and put them in parameters? I have the
  jasper ebook and have read through it so I can reference that if need
  be.
 
  On Mon, 2006-04-24 at 11:03 -0700, Manfred Moser wrote:
  Dan Adams wrote:
  I have a report I want to do that, while it runs one main query, needs
  to run many other small queries where it really only cares about getting
  one result from the query (such as a count or average). How is this done
  without creating a ton of subreports that don't print anything and just
  return a result?
  You can just set parameters with these values. Just get your data source
  to run 
  all the queries and put the results in different parameters. If you use 
  subreports or not is a different issue.
 
  manfred
 
 
 
 
 
-- 
Dan Adams
Software Engineer
Interactive Factory
617.235.5857



---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
jasperreports-questions mailing list
jasperreports-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions


Re: [jasperreports-questions] running many queries in a report?

2006-04-24 Thread Manfred Moser

Dan Adams wrote:

I have a report I want to do that, while it runs one main query, needs
to run many other small queries where it really only cares about getting
one result from the query (such as a count or average). How is this done
without creating a ton of subreports that don't print anything and just
return a result?


You can just set parameters with these values. Just get your data source to run 
all the queries and put the results in different parameters. If you use 
subreports or not is a different issue.


manfred





---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
jasperreports-questions mailing list
jasperreports-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions


RE: [jasperreports-questions] running many queries in a report?

2006-04-24 Thread S, Mohamed Raffi (Mohamed)
Check out the Custom DataSource section, if there is any.
Basically you need to implement the JRDataSource and do your stuff in there
and return a collection of Maps.
Jasper Engine will use that for the report rendering.
Don't forget to declare Fields and Parameters as required.

Regards,
Raffi
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Dan Adams
Sent: Monday, April 24, 2006 11:49 PM
To: [EMAIL PROTECTED]
Cc: jasperreports-questions@lists.sourceforge.net
Subject: Re: [jasperreports-questions] running many queries in a report?


Sorry, If I'm kind of new to this, but could you elaborate on getting
the datasource to run the queries and put them in parameters? I have the
jasper ebook and have read through it so I can reference that if need
be.

On Mon, 2006-04-24 at 11:03 -0700, Manfred Moser wrote:
 Dan Adams wrote:
  I have a report I want to do that, while it runs one main query, needs
  to run many other small queries where it really only cares about getting
  one result from the query (such as a count or average). How is this done
  without creating a ton of subreports that don't print anything and just
  return a result?
 
 You can just set parameters with these values. Just get your data source
to run 
 all the queries and put the results in different parameters. If you use 
 subreports or not is a different issue.
 
 manfred
 
 
 
-- 
Dan Adams
Software Engineer
Interactive Factory
617.235.5857



---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
jasperreports-questions mailing list
jasperreports-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
jasperreports-questions mailing list
jasperreports-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions