Jump to content
We've recently updated our Privacy Statement, available here ×

swarm357

Members
  • Posts

    14
  • Joined

  • Last visited

swarm357's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. Hi All, I just finished wrestling with putting together a report with 4 sub reports. Some key things I found where: 1. make sure all your subreports have the proper height subreport height (max height allowed) = master report height - master report page header band height - master report page footer band height - master report top margin - master report bottom marge 2. if you have an image in the master report header/footer band make sure you have the right "Scale Image" setting. I had the image in my page header set to 'scale image' = 'retain shape' which apparently cause the page header to be larger that the size I allotted it (100px). Once I change the 'scale image' setting to 'fill frame' that solved my issue. feel free to experiment with the other possible 'scale image' setting. 3. In the master report summary band space your subreports with page breaks between like below. please note that the subreports dont need to have actual height spelled out in the master report, but I found it easer to make the widths correspond exactly. · subreport1 (top = 0, height = 30) · page break (top = 31, height = 1) · subreport2 (top = 32, height = 30) · page break (top = 63, height = 1) · etc ...
  2. I have discovered that when i make a new report master report from scratch and add the subreport then my new master report works just as it should. What might be causing an already existing (complex) report to not accept an addition of a component that requires a data source expression value? i just ran into this same issue when i tried to change the data source for some charts in the summary section of my master report. I was trying to have them use a new sub dataset which contains the exact same fields as the master dataset.
  3. Hey all, Im working on a MacBook Pro with Mountain Lion and the 5.0.1 version of Jaspersoft iReport Designer .... i have tried to work around this on my pc as well with the same result (iReport 5.0.1 as well on pc) I have read through many other questions/answers in the answer section and im rather stumped with my current issue. I have a master report (Standard Report 1) that i am adding a subreport into. The subreport is valid/works when i preview it. In the master report I have set the subreport data source expression to: ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource("/page/view2/row") which i Know works b/c i used the exact same expression with a different valid string for the dataSource method in 7 other reports. Standard Report 2 subreport jrxml snippet - this is a report which is currently working $P{nullText}$P{chartThreeName}$P{chartOneName}$P{chartTwoName}$P{nullText}((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource("/page/view1/row")$P{SUBREPORT_DIR} + "standard_report_2_chart_subreport_dev.jasper"Here is the snippet of my Standard Report 1 - which is Not working ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource("/page/view2/row") $P{SUBREPORT_DIR} + "standard_report_1_subreport_dev.jasper" note that the dataSourceExpressions are EXACTLY the same minus the slightly different string in the dataSource method However, when i try to run the master report (Standard Report 1) i see the following: Error filling print... Error evaluating expression : Source text : ''net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource'"/page/view2/row") net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : ''net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource'"/page/view2/row") at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:203) .... etc .... my question is why are my leading parentheses being, apparently, converted to single quote characters ????? Has anyone else run into this issue? Or found a solution/workaround? Thanks for you help in advance!
  4. i have comparable data, but when i implement your solution mennei my y-axis magically gets multiplied by 100 so instead of having a y-axis showing 5%, 10%, 15%, etc ... i have 500%, 1000%, 1500%, etc ... any ideas why this might be occurring? Thanks
  5. my jrxml appear to have not been added ... line 225 is the first instance of the "/conditionalStyle" node in one of my styles
  6. Im using iReport 5.0.0, jasperreports 4.7.1 and eclispe indigo. My objective is to use iReports to create the jrxml files and then use some java to populate my reports with the data that my clients will provide me at run time. When i try to use my ReportGenRunner.java class to execute my ReportGenerator.run() method i get the follow exception: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:calculator_Report1_1355934859559_852911: 225: unexpected char: '' @ line 225, column 24.1 error at net.sf.jasperreports.compilers.JRGroovyCompiler.compileUnits(JRGroovyCompiler.java:113)at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:201)at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:240)at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:496)at com.ahsrcm.mobidash.jasper.java.reports.ReportGenerator.run(ReportGenerator.java:83)at com.ahsrcm.mobidash.jasper.java.reports.runners.ReportGenRunner.main(ReportGenRunner.java:36)Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:calculator_Report1_1355934859559_852911: 225: unexpected char: '' @ line 225, column 24.1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:296)at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:143)at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:113)at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:125)at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:337)at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:99)at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:71)at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:236)at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:158)at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:814)at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:511)at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:487)at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:464)at net.sf.jasperreports.compilers.JRGroovyCompiler.compileUnits(JRGroovyCompiler.java:109)... 5 moreI have been reading various related forums about what might cause this exception to be thrown and i have made changes to all my reports expressions so that any time a field/parameter/variables are converted into int or double primitive types. The thing that is really confusing me is that line 225, column 24 does not contain an experssion in my jrxml. It is the end of one of my conditional style nodes. i have included the section of my jrxml that contains line 225 ...214 215 216 217 218 219 220 221 222 223 new java.lang.Boolean($V{REPORT_COUNT}.intValue()%2 == 1 && $F{ESIBOV__sum}.doubleValue() < 0.0)224 225 226 227 new java.lang.Boolean($V{REPORT_COUNT}.intValue()%2 == 0 && $F{ESIBOV__sum}.doubleValue() < 0.0)228 229 230 231 new java.lang.Boolean($V{REPORT_COUNT}.intValue()%2 == 0)232 233 234 ...here is the method (run() ) that is where i try to use java to compile my report. the variables with '_' before them are my variables that i initalize in my ReportGenerator.java constructor. Note: i do make changes to the jrxml using the java api, however my changes are not anywhere near where the exception is being throw. the report im running this code on has no subreports and i have triple checked that my images are in the right location and that the path string i use to find them are valid. public void run() {_logger.debug("pdf will be at: " + _pdfFileLoc);try{JasperDesign design = JRXmlLoader.load(_jrxmlLoc);JRDesignQuery query = new JRDesignQuery();String initialMaseterQuery = design.getQuery().getText();query.setText(_xPathQuery);design.setQuery(query); // sets all subreports data sources to the same as the master reportfor ( JRBand jrb : design.getAllBands()) { for (JRChild jrc : jrb.getChildren()) {if (jrc instanceof JRDesignSubreport) {JRDesignSubreport jrds = (JRDesignSubreport)jrc; String initialQuery = jrds.getDataSourceExpression().getText();if ( initialMaseterQuery == initialQuery) {JRDesignExpression jrde = new JRDesignExpression("((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource(" + _xPathQuery + ")");jrds.setDataSourceExpression(jrde);_logger.warn("JRDesignSubreport now has datasource expression: " + jrde.getText());} else {throw new RuntimeException("subreport has different query than master report ... implement me!");}} else if (jrc instanceof JRDesignImage) {JRDesignImage image = (JRDesignImage) jrc; JRDesignExpression jre = new JRDesignExpression(_imageDir + "\" + getImageName(image));image.setExpression(jre);_logger.debug("image's new expression=" + image.getExpression().getText());}}} _logger.debug("compiling JasperReport");JasperReport report = JasperCompileManager.compileReport(design); JRXmlDataSource dataSource = new JRXmlDataSource(_xmlDataLoc); _logger.debug("filling JasperPrint");JasperPrint print = JasperFillManager.fillReport(report, _parms, dataSource);JasperExportManager.exportReportToPdfFile(print, _pdfFileLoc + pdfName() ); } catch (JRException jre) { jre.printStackTrace();}} I have tired to use the depeciated JRJdtCompiler in place of JasperCompileManager and that did not work.Does anyone have any ideas as to why this exception is being thrown where it is? has anyone else had a similiar issue with trying to compile jrxml that they have generated using iReport? Thanks in advance or your input/solutions!
  7. A shorter way to do cjasper's solution is something like this: public class MyCustomizer implements JRChartCustomizer { @Override public void customize(JFreeChart chart, JRChart jasperChart) { NumberAxis numAxis = (NumberAxis) chart.getCategoryPlot().getRangeAxis(); numAxis.setNumberFormatOverride(new DecimalFormat("#,##0")); } }
  8. Nevermind ... i found another way to work around this issue. i ended up using some java to customize my chart. It looks something like this: public class MyCustomizer implements JRChartCustomizer { @Override public void customize(JFreeChart chart, JRChart jasperChart) { NumberAxis numAxis = (NumberAxis) chart.getCategoryPlot().getRangeAxis(); numAxis.setNumberFormatOverride(new DecimalFormat("#,##0")); } } Thanks
  9. Changed Assigned User from @User_306070 to @anonymous Hey,I have tried your workaround, but for some reason it cause iReports to see the report template as invalid after i add the lines here is a snippet of the relevant section of my xml after i added your suggested xml.... $V{chargeMax} ...After i save and then go back to the design view i get the following message in a popup window:Error loading the report template Message: net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException; lineNumber: 656; columnNumber: 50; cvc-complex-type.2.4.d: Invalid content was found starting with element 'valueAxisFormat'. No child element is expected at this point.Level: SEVEREStack Trace:org.xml.sax.SAXParseException; lineNumber: 656; columnNumber: 50; cvc-complex-type.2.4.d: Invalid content was found starting with element 'valueAxisFormat'. No child element is expected at this point. net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:247) net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:230) net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:218) com.jaspersoft.ireport.designer.JrxmlLoader.reloadJasperDesign(JrxmlLoader.java:87) com.jaspersoft.ireport.designer.JrxmlVisualView.run(JrxmlVisualView.java:505) org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) ...Any idea why this happens? Any suggestions?Thank you for your response!
  10. It would seem that the data query button in the main panel (as described in my inital bug report) works fine until you try and get at the data query in Report Inspector right click dropdown.
×
×
  • Create New...