This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other Java Products and Servers and the fly likes JRC - multiple tables in crystal report Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "JRC - multiple tables in crystal report " Watch "JRC - multiple tables in crystal report " New topic
Author

JRC - multiple tables in crystal report

Crystal Wong
Greenhorn

Joined: Feb 27, 2008
Posts: 2
Hi,

I am using the Java Reporting component of Crystal Report XI R2 SP2.

I encounter error when pushing 2 Java resultset to a report as a datasource, like the code belows,

ReportClientDocument reportClientDoc = new ReportClientDocument();
reportClientDoc.open(REPORT_NAME, 0);

String query1 = "SELECT COLUMN1, COLUMN2 FROM TABLE1" ;
ResultSet resultSet1 = getResultSetFromQuery(query1, ResultSet.TYPE_SCROLL_INSENSITIVE);
String tableAlias1 = reportClientDoc.getDatabaseController().getDatabase().getTables().getTable(0).getAlias();
reportClientDoc.getDatabaseController().setDataSource(resultSet1, tableAlias1 , tableAlias1);

String query1 = "SELECT COLUMN1, COLUMN2 FROM TABLE2" ;
ResultSet resultSet2 = getResultSetFromQuery(query2, ResultSet.TYPE_SCROLL_INSENSITIVE);
String tableAlias2 = reportClientDoc.getDatabaseController().getDatabase().getTables().getTable(1).getAlias();
reportClientDoc.getDatabaseController().setDataSource(resultSet2, tableAlias2 , tableAlias2);

I wanna to ask, Does JRC support multiple tables in a report with the approach suggested above?

Thanks a lot!
Crystal Wong
Greenhorn

Joined: Feb 27, 2008
Posts: 2
Finally, I decided to use a join SQL or SubReport to do it.

Re-write SQL to form a single ResultSet and push it in into the report

OR

To push one ResultSet to each SubReport => multiple tables in a report
 
 
subject: JRC - multiple tables in crystal report
 
Similar Threads
Failed to export report with subreport using CrystalReports in java
Java with Crystal Report11
Trouble with ODBC CSV connection when export Crystal RPT to PDF
[Crystal Reports] JRCAgent1 received a request that cannot be handled by the JRC
setting runtime selection criteria in a jsp for crystal reports11 using jrc