meetjeetendra Posted January 9, 2008 Share Posted January 9, 2008 Hi I am facing one problem.I am creating a pdf using I-reports through java.I used the following code.Code:jasperPrint=JasperFillManager.fillReport(jasperReport,mymap,connection);Here mymap contains request time parameters(Date1,Date2) which i will be using in my select query to fetch those records which lies between Date1 and Date2.My question is how to create parameters in I-reports and retrieve values from Date1 and Date2.And how to set this retrieved values in my select query. Please, can any one help me on this. thanks in advance.Ji2... Link to comment Share on other sites More sharing options...
vinays84 Posted January 9, 2008 Share Posted January 9, 2008 In your report, right click in the document structure window and click add then parameters. Name the parameters as you wish and set their class type to be java.util.Date. These will now be filled when you call jasperprint. Your query can access them by using, for example, WHERE table.datefield BETWEEN $P{date1} and $P{date2} if your parameters were named 'date1' and 'date2'. Link to comment Share on other sites More sharing options...
meetjeetendra Posted January 10, 2008 Author Share Posted January 10, 2008 Thanks a lot vinay... It worked... Link to comment Share on other sites More sharing options...
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