method build_report_desc ?row () =
let rec build rr =
let it = rr#iter in
match store#get ~row: it ~column: col_data with
Leaf l -> Leaf { leaf = l.leaf }
| Tag t ->
let subs = List.map build (self#get_children (Some it)) in
Tag { t with tag_subs = subs }
| List l ->
let subs = List.map build (self#get_children (Some it)) in
List { l with list_subs = subs }
| Cond c ->
let (subs_then, subs_else) =
match self#get_children (Some it) with
rr_then :: rr_else :: _ ->
(List.map build (self#get_children (Some rr_then#iter)),
List.map build (self#get_children (Some rr_else#iter))
)
| _ -> ([], [])
in
Cond { c with subs_then = subs_then ; subs_else = subs_else ; }
| Sub s ->
Sub { sub_code = s.sub_code }
| Mark m ->
Mark { m with mark_id = m.mark_id }
| Then c ->
Cond { c with subs_else = [] ;
subs_then = List.map build (self#get_children (Some it)) }
| Else c ->
Cond { c with subs_then = [] ;
subs_else = List.map build (self#get_children (Some it)) }
in
match row with
None -> List.map build (self#get_children None)
| Some it -> [build (store#get_row_reference (store#get_path it))]