WPReporter - Grouping from single data source

  • Sorry if this is a bit of a simple question.

    I would like to be able to allow the users to select their own grouping based on the dataset I deliver to them. I have made a test project, similar to the WP Tools master client, but it only seems to group properly if I have a master client relationship.

    Is it possible to group on different fields that all come from the same dataset?

    Is there an example of demo which demonstrates this?

    Thanks,

    Olly

  • Yes, I have already done this, but was not sure how to achieve this without knowing which, or how many, field(s) the user chooses to group on.

    I wish to allow the user to select one or several fields to group on, and would need to dynamically create the ProcessGroup processing.

    Would you have any ideas about the best way to do this?

    • Offizieller Beitrag

    Hi,

    >>I wish to allow the user to select one or several fields to group on, and would need to dynamically create the ProcessGroup processing. <<

    Unless the SQL GROUPBY statment helps you, I see no other way to create sub queries for each internaly group. That sub query can be created dynamically. You can assign the query object to the var parameter CustomData which is passed to BeforeProcessGroup. This object will be automatically freed when all data has been added.

    Julian

  • I am unsure about how to force processing of a particular band.

    If I have two groups from a single dataset:
    1). Suburb
    2). Personal details

    The dataset will be sorted by suburb, then names. By checking for a change in suburb, I can detect when the suburb band should be processed, otherwise the personal details band should always be processed.

    When I have been working with 2 datasets, I move through them separately, but now I wish to move continously through the one dataset, however each time the subub changes, I wish for this band to be processed.

    Does the "BeforeProcessGroup" fire separately for each group, i.e. can I simply detect which group is being process and set the var ProcessGroup?

    This sounds like it would be relatively simple - is it possible or do you have a better idea?

    Thanks

    Olly

  • A more specific enquiry:

    If I do not wish to process a group (the outer one) then I set ProcessGroup to false - however this group never gets processed again.

    How can I simply skip processing of a group until I reach a record in the dataset that has changed and needs processing again?

    Thanks

    Olly

    • Offizieller Beitrag

    Hi,

    >>If I do not wish to process a group (the outer one) then I set ProcessGroup to false - however this group never gets processed again. <<

    This is normal, the groups on document level are tested once and when skipped not processed - since the groups after that group are than processed.

    You will need a group outside of this group.

    Julian

  • How then should I structure my groups / process my groups. If I have a "suburb" group, that should be processed say 50 times, and for each time the sub group "details" should be processay say 10 times.

    I cannot seem to understand how to control the processing of the groups - is there no code example that I can study to teach myself?

    Olly

    • Offizieller Beitrag

    Hi,

    please see the PDF manual. In genberal it is pretty simple, if you have a group

    <group>

    </group>

    this will be processed as long as you set the boolean in the BeforePrcessGroup event to true. When you set it to false this group (and the innner groups are not processed anymore)

    Using the alias name of a group you can switch your condition statement.

    The current count is also passed to that event.

    Julian