Hi, I am working with 'Pentaho Reporting 3.5 for Java Developers' step by step.
Can you please help me with some questions:
for 'Chapter 5: Working with data sources' -
I am trying to implement my own custom ExampleTableModel.
I did all step as it was described, so I got for Chapter2SwingApp is excelent showing report with reflection call to "ch5.ExampleFactory#getAllData()" - method without parameters,
...but for "ch5.ExampleFactory#getLibData(true)" call - I got 'No such method: ch5.ExampleFactory#getLibData'
How to solve it?
PS Sorry, how can I change thread title? After publishing can't find an option for this. Sorry.
for Chapter2SwingApp:
then, for ExampleFactory -
and for ExampleTableModel:
Can you please help me with some questions:
for 'Chapter 5: Working with data sources' -
I am trying to implement my own custom ExampleTableModel.
I did all step as it was described, so I got for Chapter2SwingApp is excelent showing report with reflection call to "ch5.ExampleFactory#getAllData()" - method without parameters,
...but for "ch5.ExampleFactory#getLibData(true)" call - I got 'No such method: ch5.ExampleFactory#getLibData'
How to solve it?
PS Sorry, how can I change thread title? After publishing can't find an option for this. Sorry.
for Chapter2SwingApp:
Code:
// load report definition
ResourceManager manager = new ResourceManager();
manager.registerDefaults();
URL url = this.getClass().getResource("/ch2/chapter2_report.prpt");
Resource res = manager.createDirectly(url, MasterReport.class);
MasterReport report = (MasterReport) res.getResource();
NamedStaticDataFactory factory = new NamedStaticDataFactory();
//commented code -
//factory.setQuery("default", "ch5.ExampleFactory#getLibData(true)");
factory.setQuery("default", "ch5.ExampleFactory#getAllData()");
report.setDataFactory(factory);
Code:
package ch5;
public class ExampleFactory {
public ExampleTableModel getAllData() {
return new ExampleTableModel();
}
public ExampleTableModel getLibData() {
return new ExampleTableModel(true);
}
}
Code:
...
public ExampleTableModel() {
super();
setDataVector(data, columnNames);
}
public ExampleTableModel(boolean libsOnly) {
super();
if (libsOnly) {
Vector<Vector<Object>> vData = generateData();
vData.remove(vData.size() - 1);
vData.remove(vData.size() - 1);
setDataVector(vData, getColumnNames());
} else {
setDataVector(data, columnNames);
}
}
...