Jump to content

Ireport Professional - call reports


aeco414

Recommended Posts

 

Dear Friends.

Before asking you about my problem, I want to know about my project. I’m developing a system and I’m using the Ireport free version, with this software I can do all tabular reports, but I need to create several Complex Static Graph for that reason in my job we’ve decided to buy the Ireport Professional.

Now We’re using a demo version of the Ireport professional and we have we make our reports, but our problem is when we’re calling from java:

It’s my source, using the Free version it’s all ok:

 

       URL url = this.getClass().getResource("/reportes/"+reporte +".jasper");

        String archivo = url.getPath();//path completo

        JasperReport report=null;

        JasperPrint print=null;

        try {

            //compile  the Reporte

            report = JasperCompileManager.compileReport(archivo); //HERE THE ERROR

        } catch (JRException ex) {

            Logger.getLogger(RunRptResultadosIndividuales.class.getName()).log(Level.SEVERE, null, ex);

            ex.printStackTrace();

        }

 

And whether I delete the last source, I continue with the error:

 

        URL url = this.getClass().getResource("/reportes/"+reporte +".jasper");

        String archivo = url.getPath();//path completo

 

           try {

                print = JasperFillManager.fillReport(archivo, parameters, session.connection());

           } catch (JRException ex) {

                HibSession.cerrarSesion();

                Logger.getLogger(RunRptResultadosIndividuales.class.getName()).log(Level.SEVERE, null, ex);

                ex.printStackTrace();

            }

          

This is the error:

net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://jaspersoft.com/schema/fusion.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:Schema>.

 

Please I need to solve this problem, and after we’ll buy the Ireport Professional.

--

Thank you.
Greetings.
Angel

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Hello Angel,

 

In order to generate report you need to use .JRXML files and then later compile them to .jasper files.

Try to use something like

URL url = this.getClass().getResource("/reportes/" + reporte + ".JRXML");

 

Hope that will help.

 

Best regards,

Taras Matyashovsky

 

Link to comment
Share on other sites

  • 11 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...