dennistmh Posted January 24, 2007 Share Posted January 24, 2007 Hi, I am a newbie of ireport. May I know how can I create two variables for row number and rowcount within a group The idea is similar to below. Staff 1-------------------------1. 2007-01-01 82. 2007-01-02 83. 2007-01-03 8Total 3 Days 24 Staff 2-------------------------1. 2007-01-01 42. 2007-01-02 83. 2007-01-03 44. 2007-01-04 6Total 4 Days 22 Many Thanks,Dennis Link to comment Share on other sites More sharing options...
jmurray Posted January 30, 2007 Share Posted January 30, 2007 You don't need to create variables, it's already done for you. For each group there is a row counter variable called $V{yourgroupname_COUNT} You can use group row counter variables directly in a java.lang.Integer Text Field. Simply set the Text Field Expression to be $V{yourgroupname_COUNT}, set the Calculation Time to Now, and make sure the Textfield Expression Class is java.lang.Integer. Please note that the value of group row counter variables is zero (0) within any header context, so they are only effective within detail and footer sections. The value of a group row counter variable in a group footer will be the same as the last value in the detail section, as shown in your sample. .Post edited by: jmurray, at: 2007/01/30 01:04 Link to comment Share on other sites More sharing options...
dennistmh Posted January 30, 2007 Author Share Posted January 30, 2007 Really Thanks for the reply. May I know is there any variable for the "Row number" as well?? Thanks,Dennis Link to comment Share on other sites More sharing options...
jmurray Posted January 30, 2007 Share Posted January 30, 2007 It's the same variable, you just place it in a Text Field in the Detail band. It auto-increments with each row in the Detail band until the entire group is filled. Then it resets to zero and starts incrementing again with the first row in the next group Link to comment Share on other sites More sharing options...
dennistmh Posted January 31, 2007 Author Share Posted January 31, 2007 Great, Thanks so much. Link to comment Share on other sites More sharing options...
karucita Posted March 19, 2007 Share Posted March 19, 2007 :huh: i need your help... I have two subreports with a group each one, and i have to show only ten records of each one per page. So, i really don't know if i have to fix the detail band, or if i can use the Report_count variable. I'm using the version 1.3.0 of ireport, in your previous answer you said that this version contain an element "Force a New Page"... I´m looking for it, but i can't found it..:dry: please I need to know if it show only a determinate number of records per page.. :side: I hope that anyone can help me... :S Thanks.. Link to comment Share on other sites More sharing options...
jmurray Posted March 20, 2007 Share Posted March 20, 2007 You should really ask new questions in a new post. You might find what you're after here: http://www.jasperforge.org/index.php?option=com_mamblog&Itemid=109&task=show&action=view&id=246&Itemid=109 Link to comment Share on other sites More sharing options...
karucita Posted March 20, 2007 Share Posted March 20, 2007 thanks..!! I'm working with a Derby database, so I'm gonna look for a similar method as the trunc. If you know about it, please let me know.. =) thanks again Link to comment Share on other sites More sharing options...
jmurray Posted March 21, 2007 Share Posted March 21, 2007 check out the INTEGER, CEILING and FLOOR functions in the Derby Reference Manual http://db.apache.org/derby/docs/dev/ref/refderby.pdf 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