Jump to content
Changes to the Jaspersoft community edition download ×

JRResultSetDataSource problem


Recommended Posts

By: Charles McClain - cmcclain1

JRResultSetDataSource problem

2003-04-16 15:52

I'm having difficulty passing a JRResultSetDataSource to my report and getting it to fill.

 

I create the JRResultSetDataSource in a bean, and store it as a session attribute, as follows:

 

String sql = new String("select CUST__T, CUST_NAME from CUSTOMER");

stmt = conn.prepareStatement(sql);

rs = stmt.executeQuery();

ds = new JRResultSetDataSource(rs);

session.setAttribute("QueryTestDataSource",ds);

 

.....and then try to use it in my JSP as follows:

 

JRResultSetDataSource ds = (JRResultSetDataSource) session.getAttribute("QueryTestDataSource");

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,parameters,ds);

 

I should note that I have a similar report which contains a SQL query, and a similar bean-JSP pair, which works flawlessly.

 

I have checked and double-checked my report definition file vs. my PreparedStatement, and both contain the same columns.

 

I also have debug writes to logs, and I can definitely see that the ResultSet from which Icreate the JRResultSetDataSource has about 30 rows. Also, I've written "ds" out to the log both in the bean and after I retrieve it from the HTTP session, and the signature is the same.

 

However, whatever I do, I get a "Unable to get next record" error when I run. What am I doing wrong?

 

 

 

 

By: Charles McClain - cmcclain1

RE: JRResultSetDataSource problem

2003-04-18 10:41

Hello? Anybody home?

 

-- cmcclain

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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