cancel
Showing results for 
Search instead for 
Did you mean: 

Designing Reports with RAS JAVA SDK & How to use POJO Datasource

Former Member
0 Kudos

Hi,

I have to create reports using JAVA RAS SDK. The approach I am thinking is to create report templates using crystal report designer tool of BO and then publish the report to BO Enterprise. At the time of running the report, will use RAS JAVA SDK at client which will retrieve the report from BO and then create the report instance. Let me know if this looks good.

Additionally, I have to create report using data which is not available in database. The user fills a form, I have to use this data to create report. I thought of using POJO datasource but could not find much material on how to design the report using POJO datasource with RAS JAVA SDK. Is there a option available in crystal report designer tool to select pojo datasource or I have to design the report using RAS JAVA SDK.

Please provide some details on how to use POJO Datasource with RAS JAVA SDK

Thanks

VV

Accepted Solutions (1)

Accepted Solutions (1)

Adam_Stone
Active Contributor
0 Kudos

I found these two pages that might help you:

[Creating Reports from POJO Datasources|http://wiki.sdn.sap.com/wiki/display/BOBJ/CreatingReportsfromPOJODatasources]

[Advanced Enterprise Development with Crystal Reports Samples|http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/701b2bd2-2da5-2b10-459a-a859608bd771]

Former Member
0 Kudos

Thanks, Adam.

I checked both the links, but they are not for RAS Java SDK.

The first link is for crystal reports with Eclipse where it uses JRC instead of RAS SDK. The second link sample uses JRC Pojo Datasource, again not for RAS Java SDK.

Whats your opinion on using RAS Java SDK for designing complex reports? Do you think BO tool like Crystal report should be used for designing and the RAS SDK for runnning the report.

Former Member
0 Kudos

Hi

Below is the Sample POJO which you can use in Report.Check getCustomerResultSet() it is returning java.sql.ResultSet.

public class JavaBeanConnectivityTest {

private Connection m_Connection;

private ResultSet m_CustomerResultSet;

public JavaBeanConnectivityTest() throws Exception {

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

String sJdbcURL = "jdbc:odbc:Xtreme Sample Database 9";

m_Connection = DriverManager.getConnection(sJdbcURL);

}

public Connection getConnection(){

return m_Connection;

}

public ResultSet getCustomerResultSet() throws SQLException{

Statement oStatement;

String sQuery;

sQuery = "Select [Customer ID], [Customer Name], [Last Year's

Sales] from Customer";

oStatement =

m_Connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,

ResultSet.CONCUR_READ_ONLY);

m_CustomerResultSet = oStatement.executeQuery(sQuery);

return m_CustomerResultSet;

public void setCustomerResultSet(java.sql.ResultSet newResultSet)

{

m_CustomerResultSet = newResultSet;

}

public void setOrdersResultSet(ResultSet newResultSet)

{

m_OrdersResultSet = newResultSet;

}

}

Below creates a new report and adds a table specified by a Java class.

String className = "JavaBeanConnectivityTest";

String tableName = "getCustomerResultSet"

PropertyBag pbConnAttributes = new PropertyBag();

PropertyBag pbLogonProperties = new PropertyBag();

TableLinks requiredLink = new TableLinks();

pbLogonProperties.putStringValue("Java Bean Classes", className);

pbConnAttributes.putStringValue("QE_DatabaseType", "Java Beans

Connectivity");

pbConnAttributes.putStringValue("Database DLL",

"crdb_javabeans.dll");

pbConnAttributes.put("QE_LogonProperties", pbLogonProperties);

pbConnAttributes.putStringValue("QE_ServerDescription",

className);

pbConnAttributes.putBooleanValue("QE_SQLDB", true);

IProcedure newTable = new Procedure();

newTable.setName(tableName);

newTable.getConnectionInfo().setKind(ConnectionInfoKind.CRQE);

newTable.getConnectionInfo().setAttributes(pbConnAttributes);

m_ClientDoc.getDatabaseController().addTable(newTable,

requiredLink);

Hope this helps you in your work

Answers (0)