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

Group: Last data record & data record count

edited October 2007 in End User
My report:

Detail:
------------------------------------------------------------------
1 ... Description
Comment
-----------------------------------------------
... Description 1
Comment 1
( ----------------------------------------------
) I don't want to see this line on the report!
------------------------------------------------------------------
2 ... .................

------------------------------------------------------------------

Has anybody an idea how to solve this problem?
Is it possible to get the last or the next data record in a group (like:
getLastInGroup or getNextInGroup)?
How to get the number of data records of a group?

Comments

  • edited October 2007
    can you make it a boolean field? if you use JIT pipelines, this makes it
    very flexible and it would be fairly easy.

    Edward Dressel
    Team DM
  • edited October 2007
    I have tables in my database which can't be changed. The tables are joined
    with each other in the report builder and there is no possibility to insert
    a boolean field.
    Is there any solutiion to do it with the RAP?

  • edited October 2007
    create a pass through function that checks the next record values--or still,
    look at using JIT pipelines and creating a field that indicates if it is the
    last.

    Just
    1) create a class structure that holds the data
    2) Create a TObjectList of the class structure
    3) Creat the pipeline & fields, and implement the OnGetFieldValue event.

    This shouldn't take more then an hour in a more complex scenario, and
    actually improves the speed of long/complex reports.

    Edward Dressel
    Team DM

  • edited October 2007
    Hi,

    Below is a simple example that keeps track of the last detail for each group
    in a separate summary query. You should be able to perform these tasks in
    RAP.

    http://www.digital-metaphors.com/tips/LastDetailInGroup.zip

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2007
    Hi,

    There is still a problem with this method because I have a sort index in our
    database. I can't rebuild the data because the report builder groups in
    another way then the SQL!!

    Regards,

    Manuel Neubauer


  • edited October 2007
    Manuel,

    ReportBuilder does not have a built-in way to detect the last detail of a
    group/page/report. This is something we are researching to add for a later
    release. Currently it is necessary to perform some sort of pre-processing
    to determine when each group will end before the report is generated. This
    was done with the second summary query in the example. Another option may
    be to generate the report to a 'dummy' TppDevice object to count the amount
    of details per group, store this number and use the information when
    generating the report a second time to screen, printer, etc.

    uses
    ppDevice
    ...

    lDevice := TppDevice.Create;
    lDevice.Publisher := Report.Publisher;
    Report.PrintToDevices;

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2007
    I would look at puting the data in a class stucture then use a JIT pipeline.
    It doesn't take very long and ends up creating very fast reports.

    Edward Dressel
This discussion has been closed.