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
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]
MasterData1.Visible := <Line> < 101;
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): The second one (for DetailData): 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.