kykedrew9 Posted August 10, 2010 Share Posted August 10, 2010 I am new in using ireport. I have a problem in using crosstab.I want to have a sample report which contains this example:FRUITS Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Totalapple 0 0 0 3 0 0 0 0 0 0 0 5 8bannana 0 0 0 8 0 0 0 0 0 0 0 10 18Total 0 0 0 11 0 0 0 0 0 0 0 15 26 but i'm always ending up with this one:FRUITS Apr Dec Totalapple 3 5 8bannana 8 10 18Total 11 15 26I want to display other months even if their count is 0. what will i do? thank you Link to comment Share on other sites More sharing options...
jasperforum Posted August 11, 2010 Share Posted August 11, 2010 the cross tab displays the zero's also . did you check the query? Link to comment Share on other sites More sharing options...
kykedrew9 Posted August 12, 2010 Author Share Posted August 12, 2010 thanks for the reply :)My query isSELECT fruit.fruit_name, sales.sale_date, fruit.fruit_idFROM fruit,salesWHERE fruit.fruit_id=sales.fruit_idzero will be displayed by the crosstab if there is one fruit sold in that particular month, but if there is no sales in that month it will not be displayed.my row in crosstab is fruit.fruit_namemy column is sales.sales_date --this is grouped by monthmy detail_field is fruit.fruit_id. so it counts the fruit_id in the table for each monthsif the ata in sales table is:fruit_id sales_date 1 Jan 1 Feb 1 Mar 1 Apr 1 May 1 Jun 1 Jul 1 Aug 1 Sept 1 Oct 1 Nov 1 Dec 2 Jul 2 Aug 2 Sept crosstabs will print this: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Decapple 1 1 1 1 1 1 1 1 1 1 1 1banana 0 0 0 0 0 0 2 2 2 0 0 0but if thedata in sales table isfruit_id sales_date 1 Apr 1 May 1 Aug 1 Sept 1 Oct 1 Nov 1 Dec 2 Jul 2 Aug 2 Septcrosstabs will print this: Apr May Jul Aug Sep Oct Nov Decapple 1 1 1 1 1 1 1 1 banana 0 0 1 1 1 0 0 0 it's not printing other months like jan, feb and others i want to print all the months even if there is no sales in that monththank you 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