[jasperreports-questions] Jasper report execution in java with parametrized query at run time

2010-03-25 Thread Abhijit Kamatkar
Hello,

I have been working on Jasper Reports. I have created few reports using
ireport and I was able to export these reports within java. Of course these
reports were simple. Now I want to get deeper in Jasper reports. I want to
know how one can execute jasper report in java with parametrized query at
run time. Has anyone worked on similar module? Do we need to create any .xml
at runtime for this? Right now the Jrxml file contains the query which was
written in the context while designing the report. Now, I want to run the
query dynamically. I am looking forward for your suggestions and advices.
Thank you in advance.

Best regards.
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
jasperreports-questions mailing list
jasperreports-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions


Re: [jasperreports-questions] Jasper report execution in java with parametrized query at run time

2010-03-25 Thread Rajesh Pandian M
On Thu, Mar 25, 2010 at 12:50 PM, Abhijit Kamatkar 
abhijitkamat...@gmail.com wrote:

 Hello,

 I have been working on Jasper Reports. I have created few reports using
 ireport and I was able to export these reports within java. Of course these
 reports were simple. Now I want to get deeper in Jasper reports. I want to
 know how one can execute jasper report in java with parametrized query at
 run time. Has anyone worked on similar module? Do we need to create any .xml
 at runtime for this?

Right now the Jrxml file contains the query which was written in the context
 while designing the report. Now, I want to run the query dynamically. I am
 looking forward for your suggestions and advices. Thank you in advance.


AFAIK it not necessary to create an xml file.
there are two options,
1. have the query executed before going to jrxml file and get the resultset
instance, wrap it with jrresultsetdatasource. then create report
2. have the query in jrxml file itself. and just pass the Hash Map instance
of all the parametrized[dynamic] values to jrxml

-- 
Rajesh Pandian M
http://mrprajesh.blogspot.com/
http://twitter.com/mrprajesh
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
jasperreports-questions mailing list
jasperreports-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions