背景说明:
润乾报表设计器提供的数据集面板可以由用户重新自定义,用户可以根据自己的需求自定义数据集面板。
自定义数据集面板需要实现润乾报表提供的com.raqsoft.report.ide.custom.IPanelDataSet接口,请看如下示例:
◆ 代码示例
package ......; //指定类路径
import com.raqsoft.report.ide.custom.IPanelDataSet;
import ......;
public class CustomPanelDataSetDemo extends JPanel implements IPanelDataSet { //实现IPanelDataSet接口,自动引入以下两个方法
public Component getComponent() { //返回面板控件
… …
return this;
}
public void refresh(Map<String, Vector<String>> dsColsMap) { //用于刷新数据集面板的方法,以下方法体内容仅为示例,用户自己掌握
… …
System.err.println("my custom dataset panel!");
for (Map.Entry<String, Vector<String>> entry : dsColsMap.entrySet()) { //遍历报表内部获取并传入的键值形式的数据集
System.err.println(entry.getKey()+":"+entry.getValue());
}
… …
}
}
参考文件:CustomPanelDataSet.java