Counting Field Values per type

edited 11:56AM in FastReport VCL
Hello,

I have a master detail report. Articles are listed in detail band.
At the end of the report, I would like to display a summary showing the number of devices per article.

Here is a similar example: http://www.databasedev.co.uk/count_values_countiif.html

How can I solve this with FastReport?

Thank you

Comments

  • edited 11:56AM
    Do you have a fixed set of groupings, as in the example (male / female) or is it a variable number based on the returned rows?

    Since it also sounds as if you want the summation to be across all the master-data bands, not just within the given master's detail rows, have you looked at creating a secondary query that simply counts the "device" rows in the detail table?
    e.g.
      select device, count(device) from Details 
      where <insert whatever filtering necessary>
      group by device
    

    Then display this as a sub report after the Master/Detail bands.
  • edited 11:56AM
    Thank you, the second query is the perfect solution for me >

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.