Aggregate child table values in Birt -


I have it Birt report, which I inherited from another developer, including a child table in the master table For each line in the master table, the child lists the table items related to the current master line item.

Two tables are fed from different data sets, the child table dataset takes parameters that point to a master item in bringing the baby items.

Now, I have to add a total sum to the lower part of the master table, the total child needs to do a certain area of ​​the field (for all the master items) showing. Consider

When, for example, the following data:

  MasterItem1 ChildItem1 SomeValue ChildItem2 SomeValue ChildItem3 SomeValue MasterItem2 ChildItem1 SomeValue ChildItem2 SomeValue ChildItem3 SomeValue -------- - ---------------------- Total  

(Why was not it done with the group instead? Small Answer These are actually two in each master row child tables with different numbers and types of fields, so not searched this way to meet with the previous developer proba Bly group.)

At first I thought I could add another child to the table inside the total area by simply adding value to an overall baby dataset. That's not why work is, however, since the child dataset requires a parameter master item which indicates to bring the kids, because there are children dataset at the same time there to get all the values There is no way.

I think there may be a way of making such an expression that instead of going through the hair data set, directly references the SomeValue field in the hair table.

Any suggestions very are appreciated

< P> It should be possible to declare a global variable at the beginning of the report, then add each of the hair table line events into one of the hair values ​​and output it at the end - if you are writing javascript So, this is probably the fastest solution.

You not comfortable writing JavaScript (I'm not) or if does not work above techniques, you can try either:

  • The combination of two existing child data value tables (so that the master table is A, the main child's table is B. and the sub- The table table is C, you have AB union AC), the subreport table and existing extension rows of the row line with conditional information with new lines, and at the end of the report, the AC value

Obviously, the latter of these approaches is more complex - but I think it should be easy to understand and maintain.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -