How to solve om.google.zxing.client.j2se.MatrixToImageWriter cannot be resolved to a type? - jaspersoft-studio

[To the person that closed my previous question, the links provided have nothing to do with my question]
I'm trying to create a QR code in JasperSoft Studio.
We have a report properly working on production containing a QR code. But after a new installation of JasperSoft Studio, we are unable to run the report.
While compiling the report we are getting the error : com.google.zxing.client.j2se.MatrixToImageWriter cannot be resolved to a type
Details :
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. com.google.zxing.client.j2se.MatrixToImageWriter cannot be resolved to a type
value = com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage( //$JR_EXPR_ID=38$
<---------------------------------------------->
2. com.google.zxing.client.j2se.MatrixToImageWriter cannot be resolved to a type
value = com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage( //$JR_EXPR_ID=38$
<---------------------------------------------->
3. com.google.zxing.client.j2se.MatrixToImageWriter cannot be resolved to a type
value = com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage( //$JR_EXPR_ID=38$
<---------------------------------------------->
3 errors
.
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:229)
at net.sf.jasperreports.eclipse.builder.JasperReportCompiler.compileReport(JasperReportCompiler.java:289)
at net.sf.jasperreports.eclipse.builder.JasperReportCompiler.compileReport(JasperReportCompiler.java:141)
at net.sf.jasperreports.eclipse.builder.JasperReportsBuilder.compileJRXML(JasperReportsBuilder.java:212)
at com.jaspersoft.studio.editor.action.CompileAction.actionCompile(CompileAction.java:154)
at com.jaspersoft.studio.editor.action.CompileAction$1.run(CompileAction.java:98)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
We have setup the Java Build Path and added Core and JavaSE jars but the report doesn't compile.
The QR code is inserted in the report using the following expression :
com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage(
new com.google.zxing.qrcode.QRCodeWriter().encode(
$F{QRCODE},
com.google.zxing.BarcodeFormat.QR_CODE, 400, 400
)
)
Does anyone know how to solve that please ?
Thanks.
Regards,
[To the person who is closing the question, the question is not about "something cannot be resolved to a type". The question is very specific. And of course I checked the links provided. It just has nothing to do with the question. Every missing type involves specific classes to be added. So sending me a link about : JasperReport org.w3c.tools.codec.Base64Decoder cannot be resolved to a type is just useless. Thank you in advance for your non contribution. You can let other people answer if they are willing to. The most similar question in SO is rather this one. But no answer could be provided]

Related

How to create a QR Code in JasperSoft Studio?

I'm trying to create a QR code in JasperSoft Studio.
We have a report properly working on production containing a QR code. But after a new installation of JasperSoft Studio, we are unable to run the report.
While compiling the report we are getting the error : com.google.zxing.client.j2se.MatrixToImageWriter cannot be resolved to a type
Details :
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. com.google.zxing.client.j2se.MatrixToImageWriter cannot be resolved to a type
value = com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage( //$JR_EXPR_ID=38$
<---------------------------------------------->
2. com.google.zxing.client.j2se.MatrixToImageWriter cannot be resolved to a type
value = com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage( //$JR_EXPR_ID=38$
<---------------------------------------------->
3. com.google.zxing.client.j2se.MatrixToImageWriter cannot be resolved to a type
value = com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage( //$JR_EXPR_ID=38$
<---------------------------------------------->
3 errors
.
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:229)
at net.sf.jasperreports.eclipse.builder.JasperReportCompiler.compileReport(JasperReportCompiler.java:289)
at net.sf.jasperreports.eclipse.builder.JasperReportCompiler.compileReport(JasperReportCompiler.java:141)
at net.sf.jasperreports.eclipse.builder.JasperReportsBuilder.compileJRXML(JasperReportsBuilder.java:212)
at com.jaspersoft.studio.editor.action.CompileAction.actionCompile(CompileAction.java:154)
at com.jaspersoft.studio.editor.action.CompileAction$1.run(CompileAction.java:98)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
We have setup the Java Build Path and added Core and JavaSE jars but the report doesn't compile.
The QR code is inserted in the report using the following expression :
com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage(
new com.google.zxing.qrcode.QRCodeWriter().encode(
$F{QRCODE},
com.google.zxing.BarcodeFormat.QR_CODE, 400, 400
)
)
Does anyone know how to solve that please ?
Thanks.
Regards,
[To the person who is closing the question, the question is not about "something cannot be resolved to a type". The question is very specific. And of course I checked the links provided. It just has nothing to do with the question. Every missing type involves specific classes to be added. So sending me a link about : JasperReport org.w3c.tools.codec.Base64Decoder cannot be resolved to a type is just useless. Thank you in advance for your non contribution. You can let other people answer if they are willing to. The most similar question in SO is rather this one. But no answer could be provided]

Jasper Reports: how to add own Functions to Expression Editor

I am using Jaspersoft Studio 6.6 and try to add own functions to the Expression Editor.
Therefore i follow the tutorial Jaspersoft Studio Expression Editor: how to extend it and contribute your own functions (part 2) - updated for version 5.5 (i was not able to find a more current version so i guess this one should be still correct)
All works fine but i had to replace the language of the generated report (SampleFunctionsReport.jrxml) from groovy to java to get rid of class not found exceptions
Finally the following Errors are remaining:
Description Resource Path Location Type
The method HELLO_WORLD_MSG() is undefined for the type SampleFunctions_1541665022158_603382 SampleFunctionsReport.jrxml /MyFunctions line 37 JRXML Problem
The method HELLO_WORLD_MSG() is undefined for the type SampleFunctions_1541665022158_603382 value = HELLO_WORLD_MSG( ); SampleFunctionsReport.jrxml /MyFunctions line 0 JRXML Problem
The method REPEAT_MSG(String, int, boolean) is undefined for the type SampleFunctions_1541665022158_603382 SampleFunctionsReport.jrxml /MyFunctions line 52 JRXML Problem
The method REPEAT_MSG(String, int, boolean) is undefined for the type SampleFunctions_1541665022158_603382 value = REPEAT_MSG("A message that will be probably repeated",5,true); SampleFunctionsReport.jrxml /MyFunctions line 0 JRXML Problem
I checked the points of the tutorial a couple of times...
can someone reproduce my problem?
What am i missing?
<import value="test.customfunctions.*"/>
this is the code from my jrxml, which is fine.
when i tried to enter the full class name - i got an error, that the package cannot be added.
today i tried the same again - and its working. even the resulting XML is identical!

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.

IntelliJ IDEA 15 Play 2.4 reverse routing method parameter "string cannot be applied to java.lang.String"

I use IntelliJ IDEA 15.0.4 to develop a Java Play! 2.4.4 application. Since a few months (I think it was because of an IntelliJ update, but not 100% sure) the following problem occurs:
Whenever I call a reverse route from a controller that takes a String as a parameter, the parameter is displayed as an error with the following message:
methodName (string) in ReverseMyController cannot be applied to (java.lang.String)
Here's a code example:
public Result myAction(String myId) {
// Do something...
// Redirect back to referrer
flash("success", "Action was a success");
if(!myId.isEmpty()) return redirect(controllers.routes.MyController.showItem(myId));
return redirect(controllers.routes.MyController.itemList(1));
}
In this example, the parameter myId passed to the method showItem would be error highlighted, like this.
I already tried fiddling with the Project Structure settings and searched Google, but to no avail. I hope somebody is able to help me with this, my OCD-self would really appreciate having a code base with no error hints again ;)
Accepted answer does not solve the problem that is why I am answering this old question.
I had the same problem with Play 2.5.4 and InteliJ 2016.1.3
I removed the type (String) from route declaration in routes file and InteliJ stopped highlighting it as error.
Change following:
GET /path/:string_arg controllers.MyController.myMethod(string_arg: String)
To
GET /path/:string_arg controllers.MyController.myMethod(string_arg)
and it works fine.
Yes, I meet the same issue as what you said. I think it is a bug of the IDEA 15.0.4, Have you tried to change to the older version before 15.0.4?

the system cannot find the path specified error on Crystal Reports ExportToDisk

I am using Crystal reports in my WPF application to generate reports, getting below error
"the system cannot find the path specified error" on ExportToDisk.
irptDocument = new ReportDocument();
rptDocument.InitReport += new EventHandler(this.OnReportDocInit);
irptDocument.Load(astrReportName);
irptDocument.SetDataSource(adtbResult);
irptDocument.ExportToDisk(ExportFormatType.PortableDocFormat,lstrReportFullName);
Path where to save as pdf is a valid path, still I am getting above error.
This is very common error while we something missing or not set (even for runtime). If you getting error in win7, then also check second link.
While searching answers of your question, someone resolved this error by
I found out the problem; the auto-generated file name seems to have
been too long for the app-server. I changes the name of the class to
PCWS and it worked fine. It's a shame Sun One Studio (which creates
these massive file names doesn't warn you
Please check this links :
https://scn.sap.com/thread/3689925
http://answers.microsoft.com/en-us/windows/forum/windows_7-update/the-system-cannot-find-the-path-specified-error/dae5f759-b053-4a4a-87af-42e79f517631?auth=1