Hello I am working with Jasper iReports, I call a method inside of one subreport created in Java when I run the application sends me the following error:

Cannot cast from JasperReport to String
value = (java.lang.String)(com.server.beans.GafJasperUtil.getReport(((java.lang.Object)parameter_SUBREPORT_GIS.getValue()), ((java.lang.String)parameter_SUBREPORT_DIR.getValue()) + "GIS-Report"));//$JR_EXPR_ID=45$
<---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

What should I modified?

Thank you.

Don't try to cast a JasperReport object, which is apparently returned by that method call, to a String. The error is pretty clear.

Hi,

I am calling the method in the subreport as follow, I am not casting anything:

com.server.beans.GafJasperUtil.getReport(parameter_SUBREPORT_GIS.getValue(), (parameter_SUBREPORT_DIR.getValue() + "GIS-Report")); I have also tried:
com.server.beans.GafJasperUtil.getReport(parameter_SUBREPORT_GIS.getValue(), ((parameter_SUBREPORT_DIR.getValue()).toString + "GIS-Report"));

And the error is:

Cannot cast from JasperReport to String
value = (java.lang.String)(com.server.beans.GafJasperUtil.getReport(((java.lang.Object)parameter_SUBREPORT_GIS.getValue()), ((java.lang.String)parameter_SUBREPORT_DIR.getValue()) + "GIS-Report"));//$JR_EXPR_ID=45$

That is way I dont kown what I to modify because I have try to cast to String and without casting.

Thank you
______________________________________________________

Hello I am working with Jasper iReports, I call a method inside of one subreport created in Java when I run the application sends me the following error:

<---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

What should I modified?

Thank you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.