Delphi QuickReport COUNT problem
I have one very simple, but very annoying problem. I'm trying to count number of rows with specific condition (for example, some column has value 1) in QuickReport. Data in report are given using stored procedure from SQL Server. I tried to use COUNT function in QRExpr but it shows me some error. Another idea is to use que开发者_如何学Pythonry in code and count number of rows directly from procedure and put it in Label, but also didn't succeed.
Do you have idea how to solve this?
TnX in advance!
Nemanja
Because I have flag column (value 1 if condition is achieved, 0 if not), one solution can be to use SUM function at that column, so summarized value will be number of rows with that condition. That can be one solution.
But still interested in COUNT function and is it possible to add WHERE condition etc. Also, same question for code solution...
The COUNT function in Quickreports doesn't have a condition or receive a parameter. Use it to get the count at the point of printing. If you want to sum conditionally, declare your own private variable in the form that contains QuickRep, add 1 to it conditionally, then print the variable when you need to.
精彩评论