开发者

Eclipse Birt, Binding a Group to a Div or something besides a table so that a header, for example, can span width of document?

I am a bit confused on this, I made a report template in Birt and have a table as a "Group" where I rely on this to display diff开发者_如何学运维erent data on each page based on a dataset column.

When I add a header, however, It is still part of the table, so if I want something from the report to appear on every page it has to be part of the table, however I want to put something like:

Current Department: [department]

and have this not be constricted by the table width, is there any way to do this while keeping it as part of the group (as it needs to be in order to get the proper data from it)


You could consider using the Master Page header. This is made a little more complex because you want to include contextual data in the header itself. I would suggest setting a Persistent Global Variable to hold the value for department. Persistent global variables are available anywhere int he report, so you can easily use an expression in the header to get to it. Setting it is even easier as you can use the JavaScript event when the group changes to grab the new value and update the PGV.

Setting a Persistent Global Variable (via an event-based script):

reportContext.setPersistentGlobalVariable("deptName", row["department"]);

Recalling a Persistent Global Variable

reportContext.getPersistentGlobalVariable("deptName");

You could also use a grid to contain both your header and your table. This way the grid controls can be sized independent of the table elements contained within them. Make sure if you go this route you bind the GRID to your data set and allow the sub-controls to inherit data from their parent. This will ensure both the table and the header you are fabricating are looking at the same point in the same data set.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜