|
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Product Reviews Reporting Solutions Using Crystal Reports for Eclipse
Modeled for ease of use, with an intuitive report design and toolset
Dec. 11, 2009 12:17 PM
SAP (Business Objects) has recently released Crystal Reports for Eclipse version 2.0 to provide reporting solutions for Java-based applications. This is available as free to use (within an organization) and has the advantage that it is built on the most tested and reliable component (Java Reporting Component in Crystal Reports) that has been in market for quite a few years now. This article discusses the features of CR4Ev2.0, usability of its designer and API, and starting off with an overview of Crystal Reports product architecture. Crystal Reports - Product Overview Crystal Reports Developer and Server editions have SDKs for Report Integration that aid in report viewing, printing and exporting in applications, customizable report viewers and report creation APIs. In case of Developer editions, the report processing resides within application and in Server editions it can be offloaded to a Reporting Server. There are two sets of SDKs available for each of SAP (Business Objects) supported technology platforms (Java and .NET) and for Java these are namely:
JRC shares many classes with the RAS SDK, and the JRC-specific classes are thin wrappers around RAS classes. CR4E vs JRC RAS SDK is the client component for the RAS server-client reporting solution, where the SDK communicates with the RAS server for report processing. With the CRJ SDK, the same classes as that of RAS SDK are used but report processing requests are sent to an in-process Java Report Engine. A great enhancement of CRJ over JRC is the introduction of RAS-type report creation and modification capabilities. With the CRJ, it's possible to programmatically modify a report on-the-fly: create new fields, introduce new data connections and tables, modify images, add lines and boxes, etc. Anything that can be done to a report using the CR4E embedded designer can also be done programmatically using CRJ as the designer uses the same SDK. Few points in comparison between CR4E and JRC are jotted in Table 1. Features of CR4E
Aspects of CR4E Designer
Layout tab: Layout tab is the designer view and has the palette with all reporting controls. The controls from palette can be dragged & dropped onto the designer area at the required position. Preview tab: Preview tab is used to preview the report designed in layout view and the report can also be directly edited in this view. The data source for the report is changed using the ‘Set Datasource Location' menu item under ‘Crystal Reports'. Datasource Explorer wizard: This wizard is used to create a connection profile for the datasource used in the reports. The CR4E supports relational databases, flat file, web services, XML and POJO as datasources. Once the connection profile is created, the required objects in datasource can be dragged & dropped onto the data view (tab). Field Explorer wizard: This wizard displays the database objects in the data pane for use in the report. Also, parameters and formulas are created using this view and then placed on to the report layout. Usage of CR4E APIs The use of CR4E API programmatically in each of this task is explained below: 1) Initiate ReportClientDocument boReportClientDocument = new ReportClientDocument();
2) Load boReportClientDocument.open("SampleReport.rpt", OpenReportOptions._openAsReadOnly); 3) Read This task is a two-step process; one is to set the connection information for datasource and next is to set the values for input parameters in the report. a) Set connection information: In most cases, the datasource configured in report template during report design will not be the same one used by the report generation application. So, the datasource connection information for the report template needs to be replaced thro' the following lines of code: dbController.replaceConnection(oldConnectionInfo, newConnectionInfo, pFields, replaceParams); dbController - DatabaseController object that is retrieved from ReportClientDocument object for managing database connections oldConnectionInfo - ConnectionInfo object that is retrieved from DatabaseController object and contains details of existing datasource such as database URL, Server Type, username, password etc. newConnectionInfo - New ConnectionInfo object that is constructed to replace oldConnectionInfo object b) Set input parameters: Data displayed on the report is restricted based on the parameter values supplied to the report, same is programmatically done below: ParameterFieldController parameterFieldController = 4) Export PrintOutputController printOutputController = The report stream can be written to a file etc. as needed. An important point to note during development using CR4E is that it contains both JRC and CRJ APIs and both the APIs have most classes with same name so import statement is critical in determining which APIs are used. To use CRJ, import classes under package name: com.crystaldecisions.sdk.occa.report.application and for JRC, package name is com.crystaldecisions.reports.sdk Conclusion Reference Reader Feedback: Page 1 of 1
Your Feedback
SOA World Latest Stories
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||