Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2007-10-11
1
Medium Priority
?
789 Views
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);
       clientDoc.open(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{
            if(reportName.equals(""))
                  clientDoc.getDatabaseController().setDataSource(dataSet, Class.forName(className),tableName,tableName+"_POJO");
            else
                  clientDoc.getSubreportController().getSubreport(reportName).getDatabaseController().setDataSource(dataSet, Class.forName(className),tableName,tableName+"_POJO");

      }
Thank's in advance.

0
Comment
Question by:rsamayoab
1 Comment
 
LVL 10

Accepted Solution

by:
adrpo earned 2000 total points
ID: 20125911

Hi,

I'm just jumping head on here as I never used this.
It seems that there is sometihng similar here:
http://diamond.businessobjects.com/node/582
Maybe it helps.

Cheers,
za-k/
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
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 use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

578 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