gpt4 book ai didi

java - 通过 BusinessObjects Java SDK 访问简单的报告过滤器和输入控件

转载 作者:行者123 更新时间:2023-12-01 09:01:49 26 4
gpt4 key购买 nike

如何通过 Java SDK 访问 BusinessObjects 简单报表过滤器和输入控件?我在 DocumentInstance 类中进行了搜索,但我发现的只是查询过滤器。我错过了一些事情或者没有解决方案?

最佳答案

输入控件未在 Java SDK for BusinessObjects XI 3.x 中公开。为了管理输入控件,您至少需要拥有 BusinessObjects 4.1 SP6 并使用新的 RESTfull SDK。

您可以使用以下代码获取报告过滤器:

DocumentInstance documentInstance = null;  // I let you handle openDocument
ReportStructure structure = documentInstance.getStructure();
ReportContainer firstReport = (ReportContainer) structure.getReportElement(0);
if (firstReport.hasFilter()) {
FilterContainer filterContainer = firstReport.getFilter();
// Now you have the filters tree
}

以下是检索过滤栏过滤器的代码:

Reports reports = document.getReports();
Report report = reports.getItem(0);
// Gets the drill info
DrillInfo drillInfo = (DrillInfo) report.getNamedInterface("DrillInfo");
DrillBar drillBar = null;
try {
drillBar = drillInfo.getDrillBar();
} catch (Exception e) {
// it may fails if you have prompt to answer for example.
}
if (drillBar != null) {
// drillBar.getCount(); // to have the number of filters
DrillBarObject drillBarObject = drillBar.getItem(0);
System.out.println(drillBarObject.getName()); // Print the filter abject name

// Print the filter value / if it is an empty string, it means "AllValues"
System.out.println(drillBarObject.getFilter());
}

关于java - 通过 BusinessObjects Java SDK 访问简单的报告过滤器和输入控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41607426/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com