Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2008

Tip: Looking for answers? Try searching our database.

JRC - multiple tables in crystal report

Thread view: 
Crystal Wong - 28 Feb 2008 06:32 GMT
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 - 29 Feb 2008 03:45 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.