cancel
Showing results for 
Search instead for 
Did you mean: 

How to setup a recordSet for the report dinamically ?

Former Member
0 Kudos

I'm able to load via jdb connection from java code a custom dataset for every single table of my .rpt file

for example

statement = jdbcConnection.createStatement();

javaResultSet = statement.executeQuery("Select * FROM NICHEL.dbo.destdiv" );

myRpt.getDatabaseController().addDataSource(javaResultSet);

myRpt.getDatabaseController().setDataSource(javaResultSet, "destdiv", "destdiv");

myRpt.getDatabaseController().setDataSource(javaResultSet, "destdiv2", "destdiv");

Is it correct?

Well... Now I copy the query from Crystal Report designer and paste into my code.

I load the recordset and then add to my rpt.

But How I tell to my report that this last recordset is the main source for the report !?

Accepted Solutions (0)

Answers (1)

Answers (1)

Adam_Stone
Active Contributor
0 Kudos

If you have more than one table in your report, the query you see in the designer combines all the tables, but understands it. When you create a single table recordset and try to pass that to the report it doesn't know what to do with it because it is expecting multiple tables not one.