JRC - multiple tables in crystal report

Discussion in 'Java' started by Crystal Wong, Feb 28, 2008.

  1. Crystal Wong

    Crystal Wong Guest

    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 query2 = "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, Feb 28, 2008
    #1
    1. Advertising

  2. Crystal Wong

    Crystal Wong Guest

    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
     
    Crystal Wong, Feb 29, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Wallace
    Replies:
    0
    Views:
    1,083
    James Wallace
    Oct 17, 2003
  2. rb
    Replies:
    0
    Views:
    325
  3. =?Utf-8?B?SmFpZ2FuZXNo?=

    Reading report content using Crystal Report Viewer XI

    =?Utf-8?B?SmFpZ2FuZXNo?=, Jan 4, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,218
    =?Utf-8?B?SmFpZ2FuZXNo?=
    Jan 4, 2006
  4. Learner
    Replies:
    1
    Views:
    1,166
    Richard Dudley
    Jan 11, 2006
  5. Comfort
    Replies:
    0
    Views:
    583
    Comfort
    Oct 18, 2004
Loading...

Share This Page