Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: JFreeReport and Eclipse

  1. #1
    Join Date
    Mar 2003
    Posts
    4,947

    Default JFreeReport and Eclipse

    Hi All,

    I was trying out JFreeReport for java/swing application. I am not getting data to be displayed. It shows all <null>. Which is default
    Here is what I have and what I did

    a. Eclipse 2.1
    b. JRE 1.4

    1. Added all jarfiles(includin in the lib directory) to my project.
    2. added(SampleData1) java data file which extends TableModel
    3. added(report1.xml)
    4. Created Java file which actually has the report code

    public JFreeReport createReport() throws FunctionInitializeException
    {
    //JFreeReport report = new JFreeReport();
    JFreeReport report = parseReport();
    TableModel data = new SampleModelData();

    report.setData(data);

    report.setName("Sample Report 1");
    report.setReportFooter(createReportFooter());
    report.setReportHeader(createReportHeader());
    report.setPageFooter(createPageFooter());
    report.setPageHeader(createPageHeader());
    report.setGroups(createGroups());
    report.setItemBand(createItemBand());
    report.setFunctions(createFunctions());
    report.setPropertyMarked("report.date", true);

    return report;
    }

    private JFreeReport parseReport()
    {
    URL in = getClass().getResource("/xml/report1.xml");
    System.out.println("URL FOR XML= "+in);
    JFreeReport result = null;
    ReportGenerator generator = ReportGenerator.getInstance();
    try
    {
    result = generator.parseReport(in);
    }
    catch (Exception e)
    {
    e.printStackTrace();
    }
    return result;

    }



    I am able to see the report but not the values (<nulls>).

    I am not getting any error messages or warnings. It just is not parsing. Am I doing anything wrong?

  2. #2
    Join Date
    Mar 2003
    Posts
    4,947

    Default Working wonderfully

    Please disregard previous message.

    It was a simple error.



    Great product. Keep it up.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.