Limit records in group report

I have a report that has data grouped into several sections, each group can potentially have many thousands of records/items. I would like my users to create a summary report that just reports the first x values - is this possible?

Comments

  • edited 6:29AM
    I have a report that has data grouped into several sections, each group can potentially have many thousands of records/items. I would like my users to create a summary report that just reports the first x values - is this possible?
    I prefer such a work done by my database system.
    Can you do the same with yours by creating a dynamic TfxADOQuery (or similar) like in an example below

    select top 100 from ...
  • gpigpi
    edited 6:29AM
    use div 100 as group condition, where i is script variable - line counter
  • Mick.pl wrote: »
    Mick.pl wrote: »
    I have a report that has data grouped into several sections, each group can potentially have many thousands of records/items. I would like my users to create a summary report that just reports the first x values - is this possible?
    I prefer such a work done by my database system.
    Can you do the same with yours by creating a dynamic TfxADOQuery (or similar) like in an example below

    select top 100 from ...


    I would prefer to do this as a sql query also but i cant get my head around it.

    select a, count(*), count(distinct [img]style_emoticons/<#EMO_DIR#>/cool.gif" style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" />, count© from table where a > 0 and b < 4 group by a The table can produce anything from 0 to many thousand rows for a I would like to limit the maximum number of rows for a to a specific value, say 100[/img]
  • gpigpi
    edited 6:29AM
    You can use in script
    MasterData1.Visible := <Line> < 101;
  • edited 6:29AM
    select a, count(*), count(distinct B), count?© from table where a > 0 and b < 4 group by a
    
    The table can produce anything from 0 to many thousand rows for a
    I would like to limit the maximum number of rows for a to a specific value, say 100
    First I'd like to make sure I understand your table with a great number of rows.
    I mean - column A stands for a group of thousands rows.

    I'd start with a typical Master-Detail report having two queries.
    The first one (for MasterData):
    select A as AGr, max(name_of_A) as Name from MyTable group by A order by A;
    
    The second one (for DetailData):
    select top 100 * from MyTable where a = :Gru;
    
    with its param :Gru set to firstQry."AGr"

    If you decide to go this way (and your database engine allows to use select top N option) then first have a look at demo examples and ... ask for another tips [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> If your database engine doesn't allow top N then maybe it allows: - number(*) as the row number in a query or - temporary tables and autoincrement columns. If not then (probably) you'll have to transport ALL data to your report and control visiblity of a band in FR script as[/img]gpi suggests.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.