/* * SQL query that can be used can be obtained by first creating a report * directly off the desired datasource, and then in Crystal Reports, open the * 'Database' > 'Show SQL Query' to see the SQL generated for the report. */ String query = (write a query to display information on the report depending on the selection criteria)
/* * Call simple utility function that obtains Java Result set that will be * pushed into the report. */ ResultSet resultSet = getResultSetFromQuery(query, ResultSet.TYPE_SCROLL_INSENSITIVE);
/* * Push the Java Resultset into the report. This will then become the * datasource of the report when the report itself is generated. */ reportClientDocument.getDatabaseController().setDataSource(resultSet, tableName , "resultTbl");
This approach works fine if the report has only one table configured. However, when more than one table is configured in the report with joins, it fails to display the report.
The queries we have are as follows: 1.Does JRC support multiple tables in a report with the approach suggested above? 2.If yes, a.Do we need to specify result sets multiple times for each table in the report? If yes, how? b.How do we specify the name of all the tables while setting the data source of the report document? 3.Is there any alternative way to set the selection formula of the report dynamically? Kindly post a solution, its is very urgent. [ June 29, 2007: Message edited by: vidhi majmudar ]