An HTML5 chart based on the second dataset is erroring - jasper-reports

An HTML5 chart based on the second dataset is throwing error. The chart type is stacked column chart. Basing two charts on the same dataset works and gives exactly the same chart (as expected).
Subsequently pointing one of the charts to the second dataset gives an error:
Error displaying report page. See the console for details.
But there are no details in the console.
The sub dataset in the chart has been set and the connection expression has been set to Use Connection Expression.
I am using iReport 5.1.0
Any help will be appreciated.
More details from today's debugging: Choosing PDF preview dumps the following error to the output:
Compiling to file... H:\QED\Design Specs\JasperReports5\New Reports\report6.jasper
Compilation running time: 1,170!
Filling report...
Locale: English (United States)
Time zone: Default
Setting up the file resolver... 
Report fill running time: 249! (pages generated: 3)
Exporting PDF (using iText) to file... H:\QED\Design Specs\JasperReports5\New Reports\report6.pdf!
Error exporting print... org.apache.batik.bridge.BridgeException: null:-1 The attribute "y" of the element <text> is invalid
net.sf.jasperreports.engine.JRRuntimeException: org.apache.batik.bridge.BridgeException: null:-1 The attribute "y" of the element <text> is invalid 
at com.jaspersoft.jasperreports.highcharts.charts.ChartPdfHandler.exportElement(ChartPdfHandler.java:45)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportGenericElement(JRPdfExporter.java:2750)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:868)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:820)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:697)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:419)
at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:1174)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Caused by: org.apache.batik.bridge.BridgeException: null:-1 The attribute "y" of the element <text> is invalid
at org.apache.batik.bridge.SVGTextElementBridge.getLocation(SVGTextElementBridge.java:253)
at org.apache.batik.bridge.SVGTextElementBridge.createGraphicsNode(SVGTextElementBridge.java:209)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:213)
at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:219)
at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)
at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:82)
at net.sf.jasperreports.renderers.BatikRenderer.ensureSvg(BatikRenderer.java:224)
at net.sf.jasperreports.renderers.BatikRenderer.ensureSvg(BatikRenderer.java:239)
at net.sf.jasperreports.renderers.BatikRenderer.getDimension(BatikRenderer.java:157)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportImage(JRPdfExporter.java:1436)
at com.jaspersoft.jasperreports.highcharts.charts.ChartPdfHandler.exportElement(ChartPdfHandler.java:43)
... 8 more 
Export running time: 1,233!
Executing: rundll32 SHELL32.DLL,ShellExec_RunDLL "H:\QED\Design Specs\JasperReports5\New Reports\report6.pdf"

Related

Simulated ECG data from CSV

I'm trying to simulate my Movsense 2.0.0 based project in Visual Studio 2017 and I want to supply ECG data from a CSV file.
According to documentation I put in my solution's root folder an ecg.csv file that looks like this
LoopingTimestamp:120000
Timestamp,/Meas/ECG/125
57540,-130
57548,-17
57556,348
57564,-83
57572,-829
57580,212
57588,3881
57596,8108
57604,10067
57612,9471
...
but all I get are debug console errors saying
SimulatorDataSource::getData. Unknown columnName: /Meas/ECG/{RequiredSampleRate}
Is my CSV file wrongly formatted or is there a problem with the simulator?
I have no problems simulating other sensors' data (like HR) with a CSV file.
If you look at the simulator debug output you see what is the column name it tries to load. From the log:
09:49:16 initFromCSVFile. file not found: ecg.csv
09:49:16 cwd: C:\Users\lipponep\dev\Projects\movesense\_build-simu
09:49:16 SimulatorDataSource::addColumn: /Meas/ECG/{RequiredSampleRate}
So the actual column name is not "/Meas/ECG/125" but
"/Meas/ECG/{RequiredSampleRate}" (<= do not fill in the sample rate)
Full disclosure: I work for the Movesense team

BIRT (Eclipse BIRT) - Date format in Runtime and Designer version differ

I'm using Eclispse BIRT version 4.7.0 to run reports in various formats,
My report has a date field in the following format: 'DD/MM/YYYY/'
When I run the report through the Eclipse BIRT Designer application, with the WebViewer, or to PDF for example, the date comes printed in the expected format, for example it prints '05/07/2006'
But when I run the report using the Runtime Engine (via command line) it prints the same date value like this: 'Jul, 5, 2006'
Does anyone know why this is happening and how to solve it?
Thank you!

Jaspersoft float number pattern

Im using Jaspersoft Studio to design my reports and JasperReports Server to publish them for my php web application.
In one of my reports it contains some float numbers displayed in the format 103.12 but i want it to be displayed like this: 103,12 and when it reaches 5 digits like this 50 000,14.
After some reading i tried to set the local to french but nothing changed.
And when i change the pattern in the jasperstudio to # ###,00 i get this :
and for the old pattern #,###.00 that comes by default in the jasperstudio i get this :
Analysis
We dealt with this as well. The locale which is being set in the JasperReports server login page is just for the admin UI, not for the report generation.
Solution
If you want to have a different locale set on your server, you need to set it in the JasperReports server config in /jasperreport-path/apache-tomcat/bin/setenv.sh (add it into one of those JAVA_OPTS):
-Duser.language=FR -Duser.country=FR
Now all locale-specific settings will be correctly configured and putting #,###.00 as a pattern for the field will be translated to your locale format by default in the server. So for the french format would be displayed like this: 1 000,12.

JSON schema validation failed: resource: String does not match pattern:^/[^/~!#\$%^|\s`#&*()\-+={}\[\]:;"'<>,?/\|\\]+(/[^/~!#\

I'm trying to embed Jasper Reports into APEX App. I'm able to gather reports from samples (samples on JasperCommunity website), however, when I'm trying to get created by me and colleagues reports - every time I have the same error:
JSON schema validation failed: resource: String does not match pattern: ^/[^/~!#\$%^|\s#&*()\-+={}\[\]:;"'<>,?/\|\\]+(/[^/~!#\$%^|\s#&()-+={}[]:;"'<>,?/\|\]+)$.
In other words I can't get any of our reports apart from the samples (e.g. /public/Samples/Reports/03._Store_Segment_Performance_Report"). I think the case is that the path to the Report is wrong, but I've tried all possible and impossible options and none of them works. Anyone any ideas please ?! Thanks
P.S. APEX 4.2.6, JasperServer 6.0. And finally, I can get samples Reports ONLY under the JasperAdmin user, simple User always got an error - 'Access Denied'. Why ?!?!?!
Sorted.
If anyone interested - when specify the actual path, in Jasper: right click on Report(or Dashboard, AdHocView etc.) and copy the path from it. As it differs from when you point mouse on it (e.g. adding the underscores etc.), and paste this actual path into your javascript code into HTML section in your web app. Thanks

Jasper Reports Logic Conditions not executing from Netbeans: "Function IF not found" error

I'm using Jaspersoft Studio to design my reports and then executing them from Netbeans.
I have a subreport that passes a return value to the main report and that gets added to a value in the main report to make the grand total amount.
In the main report I populate a text field with the 2 values and in the text fields Expression I add them together to make the grand total.
Variable from Main Report - $V{SubTotal2}
Variable from Sub report - $V{SubTotal1}
The problem I'm having is this...
When I write the expression as $V{SubTotal1} + $V{SubTotal2} it works succesfully when executing the report in Netbeans.
But, I need to check if Subtotal2 is not null so I need to add an IF statement in there, which looks like this -
IF($V{SubTotal1}==null,0.00,$V{SubTotal1}) + $V{SubTotal2}
When using the 'Preview' option in JasperSoft Studio it works fine and I can view the report, but when executing it through netbeans I get the following error
Error evaluating expression :
Source text : IF($V{SubTotal1}==null,0.00,$V{SubTotal1}) + $V{SubTotal2}
net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :
Source text : IF($V{SubTotal1}==null,0.00,$V{SubTotal1}) + $V{SubTotal2}
at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:244)
at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:591)
at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:559)
at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:1016)
at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:504)
at net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:488)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:259)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:456)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2057)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupFooter(JRVerticalFiller.java:943)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupFooters(JRVerticalFiller.java:809)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportEnd(JRVerticalFiller.java:317)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:158)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:939)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:852)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:87)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:276)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:745)
at nmtbatchservice.jasperreporting.JasperReportGenerator.generateReport(JasperReportGenerator.java:53)
at nmtwebservice.reporting.BillIssuerReport.generateReport(BillIssuerReport.java:178)
at nmtbatchservice.NMTBatchService2.main(NMTBatchService2.java:155)
Caused by: net.sf.jasperreports.engine.JRRuntimeException: Function IF not found
at net.sf.jasperreports.compilers.GroovyEvaluator.functionCall(GroovyEvaluator.java:73)
Any ideas? As I said - it works through Jasper Studio but not when I use netbeans.
Problem solved - I need to have the jasperreports-functions-5.2.0.jar to my project in Netbeans. Just a note, that Jar also requires Joda.org library http://joda-time.sourceforge.net/installation.html