Hitachi Vantara Pentaho Community Forums
Results 1 to 1 of 1

Thread: What to do in PRD when using a Java TableModel

  1. #1
    Join Date
    Jun 2013
    Posts
    14

    Post What to do in PRD when using a Java TableModel

    This might be a simple question, but I don't know what to do in PRD when passing in a Java TableModel.
    I thought I have to make a Table data source and name the columns exactly as they are named in the TableModel. But the report preview showing up in my Java application is empty.
    So doesn't it work that way ??

    Basically I'm doing the following:

    Code:
    TableModel tm = ResultSetTableModelFactory.getInstance().createTableModel(rs) ;     //  generate a TableModel
    DataFactory df = new TableDataFactory("Query 1", tm) ;                                        //  generate a DataFactory 
    report.setDataFactory(df)                                                               //  setting the DataFactory of the report object

    the report object is generated like this:

    Code:
    final ClassLoader classloader = this.getClass().getClassLoader();
    final URL reportDefinitionURL = classloader.getResource("tablemodel_report.prpt");
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
    final Resource directly = resourceManager.createDirectly(reportDefinitionURL, MasterReport.class);
    return (MasterReport) directly.getResource();
    Pleeease help!!
    thanks.
    Last edited by clic; 06-14-2013 at 12:17 PM.

Tags for this Thread

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.