Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Adding group on runtime

edited November 2012 in General
It is possible to add groups dynamically ? ... how?

Using D7 and RB 11

Thanks

Comments

  • edited November 2012
    Hi Arturo,

    Take a look at the following article on creating groups in code.

    http://www.digital-metaphors.com/rbWiki/Delphi_Code/Layouts/Create_Group_in_Code

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2012
    Seems adding a group was not the rigth solution to my needs, but im really
    thankfull Nico.

    Do you know how to change the field assigned to a group on runtime?

    Im trying to allow end user the data order for a report, but this means the
    report grouping needs to change too, so i thinking to define all the groups
    i need (4) and try to assign the proper field to them on runtime.

    Any ideas?

  • edited November 2012
    Seems adding a group was not the correct solution to my problem, i want to
    allow my users to select data order in a report, but of course; groups needs
    to change accordingly to that. Is there a way to change field assigned to a
    group before i print my report?

    thanks for your patience and help Nico.


  • edited November 2012
    Hi Arturo,

    You can access existing groups in code using the Report.Groups property.
    From there you can adjust the field used for a specific group using
    the FieldName property. Something like the following...

    ppReport1.Groups[0].FieldName := 'MyField';
    ppReport1.Print;

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.