[Gambas-user] gb.report2 Conditional sections

Bruce adamnt42 at gmail.com
Mon Nov 23 19:39:22 CET 2020


On 24/11/20 2:15 am, Fabien Bodard wrote:
>    If hResult.Count > 0 Then
>      TableLine.DataCount = hResult.Count
>      rptAltBody.Parent.Children.Remove(rptAltBody.Parent.Children.Find(rptAltBody))
> 
>    Else
> 
>      TableLine.Parent.Children.Remove(TableLine.Parent.Children.Find(TableLine))
> 
>    Endif
> 
> This do the job ... Yes It's like a work around:-)

Thank you Fabien, that solves about 80% of my tasks!

I do not think though that it would work if the conditional sections are 
ontained within a hicher level section. Suppose we have "alternitve 
subsections like:

Report
	Body
		Section for Type A data
		Section for Type B data

and I need to print 24 type A's and 12 Type B's in random order.
Would the workaround work in that case? (Just a quick answer needed.)

Or also "Optional" sections like:

Report
	Body
		Section for say "Order.lineItem"
		Optional section for line item comments like "Out of Stock"
		Option Section for say "Promo message" e.g. "Have you tried ...

I have a feeling that removing the children wont work for these.
I am not too worried about these cases at the moment as I need to get 
the 80% done. I just raise them as other "section types" that need to be 
considered, i.e. "conditional", "alternative" and "optional".

regards
bruce


More information about the User mailing list