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

Recognising the last record in a group

edited December 2008 in General
I have a new challenge.

I need to be able to recognise the last data item in a group at runtime
in order to enable me to make visible a solid TppLine rather than a
dotted one.

Is this easy to do?

Many thanks,

Tim.



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited December 2008
    I am using a SQL Server TDataSource.




    --- posted by geoForum on http://delphi.newswhat.com
  • edited December 2008

    Here is an example on rbWiki...

    www.digital-metaphors.com/rbWiki/Design/Groups/How_To...Detect_the_Last_Group_Detail


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    "

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited February 2011
    How can I get this example to work using a tppdbPipeline?

    Ken

  • edited March 2011
    Hi Ken,

    The example is virtually the same if you are using DBPipelines on a form.
    You will create a new dataset (TDataSet descendent) that contains the count
    of records and connect it to a new TDataSource and TppDBPipeline. Then
    inside the DetailBand BeforePrint event, you will access the count field and
    use it to determine which is the last group.



    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    "Ken Randall" wrote in message news:4d6be8ce$1@mail....

    How can I get this example to work using a tppdbPipeline?

    Ken

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2011
    Nico,

    Thanks. I like the approach that is used in
    www.digital-metaphors.com/tips/RemoveLineFromLastDetail.zip and it works
    very well. However I only want to be able to show a value when it is the
    last one in the group. Could you please advise how to do that?

    Regards,

    Ken

  • edited March 2011
    Nico,

    The example given does not work if you page through the report and then page
    back. Could you please advise how to make it work under these circumstances?

    Ken

  • edited March 2011
    Hi Ken,

    Try setting Report.CachePages to True.


    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2011
    Nico,

    Thanks, that did the trick :)

    Ken

This discussion has been closed.