2

我有一个查询,它从包含数据的表中设计动态列数。现在我需要根据查询添加具有动态列数的网格。

select fruit,count(*) from mytable group by fruit;

我正在了解如何手动添加它,但在运行时我可能有不同数量的列。那么我需要做什么才能在 BIRT 报告中动态地将列添加到网格中

4

2 回答 2

0

You can extend or modify your report template at runtime in, for instance, a custom EventHandler for the Report.beforeFactory() event. The handler can be implemented either in Java or in JavaScript. BIRT has Design Engine API. There is a plug-in, that could be helpful. Even if you cannot use it as it is, it provides examples of how to use BIRT Design Engine API. Using Design Enigine API you can also create new template from scratch at runtime.

于 2013-10-28T14:25:46.353 回答
0

或者,您可以使用 Crosstab 并将其fruits作为Dimension 和 COUNT(*)作为Measure。它将为每个水果添加一列,但对于您的示例而言,这可能有点过头了。

于 2014-01-14T14:58:16.473 回答