我正在尝试以编程方式填写可以移动的模板,然后将文件上传到我的程序。我一直在寻找一段时间,似乎只有旧的答案,旧的API允许这样一个简单的setText:
designHandle.findElement("ValueName").setText("text");
我还发现ITextItemInstance
能够像我想的那样设置文本,但是它似乎只在创建新的标签实例时使用,而不是编辑现有标签。
我正在使用Birt 4.5.0
答案 0 :(得分:0)
从书Integrating and Extending BIRT第296页:
//Access the label by name.
LabelHandle headerLabel = (LabelHandle) design.findElement("Header Label");
try {
headerLabel.setText("Updated " + headerLabel.getText());
} catch (Exception e) {
// Handle the exception
}
design
是ReportDesignHandle
个对象。