• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

setting runtime selection criteria in a jsp for crystal reports11 using jrc

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We�re presently piloting the JRC packaged with Crystal Reports XI - Release-2.

We wanted to modify the selection formula of the report dynamically.
However, we came to know that presently this feature is only supported with the RAS and that JRC does not support this feature.

Hence, we decided to run the SQL query externally and set the data source for the report dynamically.

Mentioned below is a snippet of the code we�re using for achieving the same:

reportClientDocument.open("jrc_set_resultset_datasource/jrc_set_resultset_datasource.rpt", 0);

/*
* 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);

String tableName = reportClientDocument.getDatabaseController().getDatabase().getTables().getTable(0).getName();

/*
* 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 ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

You can modify the selection formula of the report dynamically.

See more in API:

http://help.sap.com/javadocs/boe/xi/ras/en/com/crystaldecisions/sdk/occa/report/application/FilterController.html


Bye!
 
reply
    Bookmark Topic Watch Topic
  • New Topic