Jump to content
We've recently updated our Privacy Statement, available here ×

net.sf.jasperreports.engine.JRException: Unable to get next record


augarte

Recommended Posts

Hi,

I have a master report with a subrepot. Both use the same database connection but the query to retrieve the fields of each one is differentes. If I try to preview the master report with the subreport in iReport, the result is OK. The problem is when I try to run it from my web app, because it is showing the following exception:

net.sf.jasperreports.engine.JRException: Unable to get next record

I have tried removing the subreport and works ok. I have checked how is the connection defined for the subreport. When I create the subreport I select the option to use the same connection as the master report. The jrxml file is defined as follows:

<subreport>
                <reportElement x="0" y="56" width="555" height="100"/>
                <subreportParameter name="IniDat">
                    <subreportParameterExpression><![CDATA[$P{IniDat}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="EndDat">
                    <subreportParameterExpression><![CDATA[$P{EndDat}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="Prt">
                    <subreportParameterExpression><![CDATA[$P{Prt}]]></subreportParameterExpression>
                </subreportParameter>
                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                <subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "DevFil_subreport1.jasper"]]></subreportExpression>
            </subreport>

Am I missing something? Does anybody know the cause of this exception?

Thanks in advance.

Regards,

Aitor

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Hi again,

The problem is when executing the report from a web applications. I have created a main java class and it generates the report in doc and pdf formats without problems. But if I run exactly the same code from my web application I get the mentioned error...

This is the code I execute to generate the report:

     /* Compile the template */
      JasperReport Rep = JasperCompileManager.compileReport ("DevFil.jrxml");

        /* Create the JasperPrint object with the template and the data */
      Data.put ("IniDat", "2011/05/01");
      Data.put ("EndDat", "2011/05/31");
      Data.put ("Prt", "ALU");

      JasperPrint  Prn = JasperFillManager.fillReport (Rep, Data, con);

      /* Export the report to pdf format */
      JasperExportManager.exportReportToPdfFile (Prn, "DevFil.pdf");

        /* Export the report to rtf format */
      JRRtfExporter RtfExporter = new JRRtfExporter();
      RtfExporter.setParameter(JRExporterParameter.JASPER_PRINT, Prn);
      String RtfNam = "DevFil.rtf";
      File RtfFil = new File (RtfNam);
      RtfExporter.setParameter(JRExporterParameter.OUTPUT_FILE, RtfFil);
      RtfExporter.exportReport();

Any clue?

Thanks in advance.

Best regards.

 

Link to comment
Share on other sites

  • 2 years later...
  • 7 months later...

Good afternoon.

Having the simillar error, but only when producing a report with going back more than 20 days worth of data. The strange part is that I can generate a report with 2 charts, perfectly ok, if I select less than 20 days. I can confirm that the SQL database (SQL server 2012) has records going back to 18th of April of 2014.

Error information:

Error filling print... Unable to get next record.
Setting up the file resolver... 
net.sf.jasperreports.engine.JRException: Unable to get next record. 
    at net.sf.jasperreports.engine.JRResultSetDataSource.next(JRResultSetDataSource.java:122) 
    at net.sf.jasperreports.engine.fill.JRFillDataset.advanceDataSource(JRFillDataset.java:1407) 
    at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1256) 
    at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1235) 
    at net.sf.jasperreports.engine.fill.JRFillDatasetRun.advanceDataset(JRFillDatasetRun.java:277) 
    at net.sf.jasperreports.engine.fill.JRFillDatasetRun.iterate(JRFillDatasetRun.java:263) 
    at net.sf.jasperreports.engine.fill.JRFillDatasetRun.evaluate(JRFillDatasetRun.java:208) 
    at net.sf.jasperreports.engine.fill.JRFillElementDataset.evaluateDatasetRun(JRFillElementDataset.java:231) 
    at net.sf.jasperreports.engine.fill.JRFillChart.evaluateDatasetRun(JRFillChart.java:1408) 
    at net.sf.jasperreports.engine.fill.JRFillChart.evaluateChart(JRFillChart.java:833) 
    at net.sf.jasperreports.engine.fill.JRFillChart.evaluateRenderer(JRFillChart.java:809) 
    at net.sf.jasperreports.engine.fill.JRFillChart.evaluate(JRFillChart.java:798) 
    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:2067) 
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:788) 
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:298) 
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:152) 
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:963) 
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:873) 
    at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:87) 
    at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:287) 
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:760) 
    at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:891) 
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) 
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) 
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 1047) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction. 
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) 
    at com.microsoft.sqlserver.jdbc.SQLServerResultSet$FetchBuffer.nextRow(SQLServerResultSet.java:4853) 
    at com.microsoft.sqlserver.jdbc.SQLServerResultSet.fetchBufferNext(SQLServerResultSet.java:1781) 
    at com.microsoft.sqlserver.jdbc.SQLServerResultSet.next(SQLServerResultSet.java:1034) 
    at net.sf.jasperreports.engine.JRResultSetDataSource.next(JRResultSetDataSource.java:118) 
    ... 25 more 

Print not filled. Try to use an EmptyDataSource..

The connection to the SQL db is working (tested using the test button upon initial connection).

iReport data:

Product Version: Jaspersoft iReport Designer 5.6.0

Java: 1.7.0_51; Java HotSpot 64-Bit Server VM 24.51-b03

System: Windows Server 2012 version 6.2 running on amd64; Cp1252; en_US (ireport)       

The query to the DB also works:

select distinct robot, origin from s_qos_data where probe = 'cdm' and origin = $P{origin}

 

This JRXML file originally had the aegean chart on it, but then was replaced by the normal / default one, since the evaluation version I am using, can't handle that one.

Not sure if it related, but after initial iReport installation had to add the following line in the ireport.conf file:

jdkhome="C:Program FilesJavajdk1.7.0_51"

Also added the classpath (options - classpath tab)

sqljdbc4 

should I have added the sqljdbc also?

Can anyone assist on this matter?

Thank you in advance.

Francisco Ramilo

Link to comment
Share on other sites

  • 4 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...