Jasper Reports - Generating PDF 417 barcodes using Barcode4j - jasper-reports

We are currently using Jasper Reports to generate PDF 417 barcodes using Barcode4j.
We are using Barcode component for the same. If we set CodeExpression property to "CASE-SEPARATOR%$DEFKCNBSMEDPB%$CASEGPE0000115%$LOBDBAN%$CUSTG00012345" it throws following runtime exception.
Error filling print... net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : "CASE-SEPARATOR%$DEFKCNBSMEDPB%$CASEGPE0000115%$LOBDBAN%$CUSTG00012345"
net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : "CASE-SEPARATOR%$DEFKCNBSMEDPB%$CASEGPE0000115%$LOBDBAN%$CUSTG00012345"
at net.sf.jasperreports.components.barcode4j.BarcodeEvaluator.evaluateExpression(BarcodeEvaluator.java:72) at net.sf.jasperreports.components.barcode4j.BarcodeEvaluator.evaluateBaseBarcode(BarcodeEvaluator.java:53) at net.sf.jasperreports.components.barcode4j.BarcodeEvaluator.evaluatePDF417(BarcodeEvaluator.java:145) at net.sf.jasperreports.components.barcode4j.AbstractBarcodeEvaluator.visitPDF417(AbstractBarcodeEvaluator.java:424)
If we remove $ character from above code expression value it works fine.
Has anyone got idea how to generate PDF417 barcodes having $ characted in Message using Jasper reports/Barcode 4J. Thanks

We are able to generate barcode in png format by directly using Barcode4J API. It seems that there is a bug in jasper reports which does not allow $ character in barcode messgae while generating PDF 417 barcode.

Related

Unable to convert XLS file to DRL file

We are trying to convert XLS file to DRL file using Drool.net in C#. It is throwing error java.lang.RuntimeException: 'Script template is null - check for missing script definition.'. I am using basic sample template, but this error is kept on coming.
Sample rules table
Sample code
Please help us to resolve this issue.
Sample tried code
We are expecting this code to return text in DRL format.

Why do I get current expression is not valid using JRDataSource?

I am trying to use List into the jasper report using JasperSoft Studio, but while defining dataset the JRDataSource expression is showing as invalid even after casting REPORT_DATA_SOURCE to the JRXmlDataSource(find image below).
Expression
((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/Header/FileName")
Error
The current expression is not valid. Please verify it!
The error is looking so weird and I am not able understand it what is wrong here.
Do not worry about it, this is a bug in the IDE.
If you can't close the expression editor, edit the expression manually in the xml view.

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

An HTML5 chart based on the second dataset is erroring

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"