vs00500773 Posted May 8, 2018 Share Posted May 8, 2018 Here is the SQL query resultset.Project Name, Amount, Cost Type, Month DeptA 1000 Capital Jan A101A 2000 Operating Jan A101A 3000 Captial Jan A102A 4000 Operating Jan A102 Here is the expected resport outpt:Project A Jan Captial OperatingA101 1000 2000A102 3000 4000I have created Group Header for Project, Dept, Month, Cost Type but the records are getting duplicated. Example. I get FOUR records in the detailed section I even, tried in the header section to display the values Any help is greated appreciated Thanks Link to comment Share on other sites More sharing options...
riodavid Posted May 10, 2018 Share Posted May 10, 2018 Not sure if it will work, but try footer section. Link to comment Share on other sites More sharing options...
Ankur Gupta Posted May 10, 2018 Share Posted May 10, 2018 Hey, You should use the crosstab element to produce the desired output.Where you need to define following-Dataset - Main Report Dataset/ Defined Dataset(Whichever produces the data)Column - Month, Cost TypeRow - DeptMeasures - Amount (Select No Calculation)Creating this element would definitely give you the desired result.Also remember not to put the crosstab in the detail section it should reside in Summary Section.Hope that this helpsThanks Ankur Link to comment Share on other sites More sharing options...
vs00500773 Posted May 11, 2018 Author Share Posted May 11, 2018 Thanks Ankur for the prompt response. I have 12 month columns and i get the below error message when I select 'Fit columns to crosstab element' net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRRuntimeException: Not enough space to render the crosstab. at com.jaspersoft.studio.editor.preview.view.control.ReportControler.fillReport(ReportControler.java:548) at com.jaspersoft.studio.editor.preview.view.control.ReportControler.access$20(ReportControler.java:523) at com.jaspersoft.studio.editor.preview.view.control.ReportControler$5.run(ReportControler.java:404) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)Caused by: net.sf.jasperreports.engine.JRRuntimeException: Not enough space to render the crosstab. at net.sf.jasperreports.engine.fill.JRFillCrosstab$CrosstabFiller.fillVerticalCrosstab(JRFillCrosstab.java:1527) at net.sf.jasperreports.engine.fill.JRFillCrosstab$CrosstabFiller.fill(JRFillCrosstab.java:1470) at net.sf.jasperreports.engine.fill.JRFillCrosstab.prepare(JRFillCrosstab.java:805) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:537) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:411) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:386) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummaryNoLastFooterSamePage(JRVerticalFiller.java:1067) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummary(JRVerticalFiller.java:1026) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportEnd(JRVerticalFiller.java:287) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:122) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:586) at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:123) at java.lang.Thread.run(Thread.java:745) 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