Eclipse Crystal Report XI pass more than one pojo object from JSP to Crystal Report

Posted on 2007-10-11
Last Modified: 2013-12-15
I'm using Crystal Report XI for Java, and in my sample I'm using one Pojo dataset and it works ok, but I would like to know how to pass more than one pojo object to a same report result. ( like having two simple separate tables.)
This is a little peace of code inside the JSP:

String reportName = "submitedContracts.rpt";
ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute(reportName);, OpenReportOptions._openAsReadOnly);
 // Populate POJO data source
 String className = "org.tempuri.FDCInformation.FDCInformationSrv.SubmittedContractsBE";
 List dataset = new ArrayList();
 dataset = (List)request.getAttribute("dataSet");
 JRCHelperSample.passPOJO(clientDoc, dataset, className, tableAlias, "");

IReportSource reportSource = clientDoc.getReportSource();
JRCHelperSample.exportPDF(reportSource, request, response, config.getServletContext(), true);

above example just send one Object to crystal report . Do you know how to send more than one object on above code example..? passPOJO just accept one object and I tried to below line after fill my second data set:
 JRCHelperSample.passPOJO(clientDoc, dataset2, className2, tableAlias2, ""); but does not work,

passPOJO method:

public static void passPOJO(ReportClientDocument clientDoc, Collection dataSet,
                  String className, String tableName, String reportName) throws ReportSDKException,ClassNotFoundException{
                  clientDoc.getDatabaseController().setDataSource(dataSet, Class.forName(className),tableName,tableName+"_POJO");
                  clientDoc.getSubreportController().getSubreport(reportName).getDatabaseController().setDataSource(dataSet, Class.forName(className),tableName,tableName+"_POJO");

Thank's in advance.

Question by:rsamayoab
    1 Comment
    LVL 10

    Accepted Solution



    I'm just jumping head on here as I never used this.
    It seems that there is sometihng similar here:
    Maybe it helps.


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
    As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
    The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now