[Gambas-user] gb.report2 Conditional sections

Fabien Bodard gambas.fr at gmail.com
Mon Nov 23 19:57:32 CET 2020


Le lun. 23 nov. 2020 à 19:40, Bruce <adamnt42 at gmail.com> a écrit :

> 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.)
>

Yes.. all depend of you basis structure..

Removing the line container disable the Reading loop from datacount.

There is not difference between removing a child and doing like it not
exist in the visible property case.. just the second is reversible and not
need a new instance to be reinitialisate.

I'm nevertheless going to activate visible property for next releases.

Another thing that can be usefull can be a way to escape the line
repetition if a result is not good.. well but report is just a display tool.



> 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
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201123/09051420/attachment.htm>


More information about the User mailing list