Java / Oracle / Reporting / Graphs and Tables / JDBC

Hi everyone,

I am creating a simple Business Intelligence Tool in Java using Eclipse. I only need this tool to get some information off a desired database and then create some graphs and tables (reports).

I can connect to an oracle database and get all the information off of it. But now I need to create the reports. I was told to check some packages on this website :
http://java-source.net/open-source/charting-and-reporting

I took a look at some of the possible packages and decided I would give JFreeChart a try. But the problem is I have no idea how to connect it to my Eclipse application.

I'm reaching the desperate point....


All I need is to create graphs and tables given some data which I get from a database....
Is there a simpler way to do this???

Please Help
RicardoVGomesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gritscbsCommented:
Crystal Reports isn't free but it connects to Oracle seamlessly and creating charts and graph is very simple.  You can download a 90 day free trial of Crystal Reports to get started.  Just google crystal reports demo.  We call Crystal Reports directly from within our Web Apps.
0
RicardoVGomesAuthor Commented:
So you mean that by incorporating Crystal Reports to my system, I could create a report with a click of a button on my application?

Say a user could choose two columns from a database in my application and crystal reports would just make a report(graph) say in jpeg?
0
gritscbsCommented:
Crystal Reports (CR) connects directly to Oracle.  You then use CR to create your reports, graphs, charts, etc.,  it is very intuitive.  You can drag and drop Oracle columns onto your report and then have CR create charts and graphs from those column totals.  Reports can be run directly from CR or called  in several different ways including from a command line.  

We write Oracle based applications and then use CR as our reporting engine.  We use an oracle table to maintain the available reports.  Our reports user interface then list the available reports with the report name being linked to the report.  When a user is on a certain Oracle record within our application and clicks on the report name we pass the record key to CR when calling the report.  

This may be overkill for what you are doing but if you want the ability to create unlimited reports, charts and graphs from any oracle data and give your users a simple interface its hard to beat.  If you want to look at this further I can paste the java code we use to call the reports.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

RicardoVGomesAuthor Commented:
I would need that code please.

And also if you could explain how to connect Crystal Reports to my eclipse project.

Thanks
0
n_sachin1Commented:
You can probably try out BIRT. Eclipse 3.2 has ready-made plugins for BIRT and best of all, its open source.
regards
Sachin
0
RicardoVGomesAuthor Commented:
I was thinking of using BIRT in the first place, being free and all...

Can someone explain how I would do this using BIRT????

Once again, all I want is : by clicking a button in my Eclipse project.... I want a report (graph/tables)... using columns from an Oracle database ( which I am already connected to in my project) .
0
RicardoVGomesAuthor Commented:
I've been looking into BIRT.... and by what I understand... I can't do what I wanted...
creating reports from my project... and not from BIRT...

anyone have possible solutions?

please help, reaching desperate phase
0
gritscbsCommented:
This is the main section of code we use for CR integration into our applications if you still want to look into using CR.

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="com.crystaldecisions.report.web.viewer.*"%>
<%@page import="com.grits.JRCHelperSample" %>
<%@page import="com.crystaldecisions.reports.sdk.ReportClientDocument" %>
<%@page import="com.crystaldecisions.sdk.occa.report.lib.ReportSDKExceptionBase" %>
<%@page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSource"%>
<%@page import="com.crystaldecisions.sdk.occa.report.application.OpenReportOptions"%>
<%
try {
    String storedReportName = (String)session.getAttribute("reportName");
    String reportName = (request.getParameter("reportName") != null ? request.getParameter("reportName") : storedReportName);
    String storedParams = (String)session.getAttribute("params");
    String params = (request.getParameter("params") != null ? request.getParameter("params") : (storedParams == null ? "" : storedParams));
    boolean clearReport = (request.getParameter("clr") != null ? true : false);
    ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute(reportName);
    //CrystalReportViewer viewer  = (CrystalReportViewer) session.getAttribute("viewer");
   
    if (reportName == null) {
        reportName = storedReportName;
    }
   
    if (clearReport || clientDoc == null || !reportName.equals(storedReportName) || !params.equals(storedParams)) {
   
        clientDoc = null;
        //viewer = null;
   
        // Report can be opened from the relative location specified in the CRConfig.xml, or the report location
        // tag can be removed to open the reports as Java resources or using an absolute path
        // (absolute path not recommended for Web applications).
        clientDoc = new ReportClientDocument();
       
        // Open report
        clientDoc.open("Reports/" + reportName, OpenReportOptions._openAsReadOnly);
   
        // ****** BEGIN CHANGE DATASOURCE SNIPPET ****************  
        String connectString = "jdbc:oracle:thin:@192.168.1.8:1521:ORCL";
        String driverName = "oracle.jdbc.driver.OracleDriver";
        String JNDIName = "jdbc/OSILASDS";
        String userName = "xxxxxxxxxx";
        String password = "yyyyyyyyy";
       
        // Switch all tables on the main report and sub reports
        JRCHelperSample.changeDataSource(clientDoc, userName, password, connectString, driverName, JNDIName);
       
        if (request.getParameter("params") != null) {
            JRCHelperSample.addReportParameters(clientDoc, "", request.getParameter("params"));
        }
   
        // Store the report document in session
        session.setAttribute(reportName, clientDoc);
        session.setAttribute("reportName", reportName);
        session.setAttribute("params", params);
    }
   
    // Create the CrystalReportViewer object
    CrystalReportViewer viewer = new CrystalReportViewer();
    viewer.setOwnPage(true);
    viewer.setOwnForm(true);
    viewer.setHasLogo(false);    
    viewer.setDisplayGroupTree(false);
    viewer.setHasToggleGroupTreeButton(false);
    viewer.setHasViewList(false);
    viewer.setEnableParameterPrompt(true);
    viewer.setPrintMode(CrPrintMode.PDF);
    viewer.setDisplayToolbar(true);
    viewer.setHasPageNavigationButtons(true);
    viewer.setHasRefreshButton(true);
    viewer.setName(reportName);

    //  set the reportsource property of the viewer
    IReportSource reportSource = clientDoc.getReportSource();              
    viewer.setReportSource(reportSource);
   
    // Process the report
    viewer.processHttpRequest(request, response, application, pageContext.getOut());
}
catch (ReportSDKExceptionBase e) {
    pageContext.getOut().write(e.getMessage());
}
%>
0
RicardoVGomesAuthor Commented:
I took a look, and there is only a 30 day free trial, I would need it for at least 60. But thanks for your help.

I'm thinking BIRT is a possibility. Can anyone help with BIRT?


0
n_sachin1Commented:
Ricardo,
  Here are some links that can guide you on using BIRT. Are you on Eclipse 3.2 ? If yes, there is a BIRT report designer perspective that you can use to design the reports. Details are present at:
http://www.eclipse.org/birt/phoenix/tutorial/

You can use the BIRT report engine for integration with your java application and bind data to previously designed reports programmatically.
http://www.eclipse.org/birt/phoenix/deploy/
http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php

regards
Sachin


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RicardoVGomesAuthor Commented:
You can use the BIRT report engine for integration with your java application and bind data to previously designed reports programmatically.

Can you explain how I can do this? step by step ?

0
n_sachin1Commented:
Ricardo, look at the links provided above. There is a step by step process definition to achieve this, with examples.
0
RicardoVGomesAuthor Commented:
Thanks n_sachin1,
http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php

I have downloaded birt-runtime_2_1_2.zip and extracted it.

I have added the iText1.3.jar file into the apropriate plugin directory.

Configuring JDBC drivers.......
Now it asks me to put the driver jar file into a certain directory.... what is this jar file and where do I find it? I can already connect to a database using jdbc_odbc.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DB Reporting Tools

From novice to tech pro — start learning today.