Board index » delphi » Reports grouped by various criteria - using Quick Reports.

Reports grouped by various criteria - using Quick Reports.

Hi all,

I have a project and I'm now trying to add the reporting capabilities.

The main table is the Member table, which has things like

County, A DateOfBirth, Urban/Rural and Gender.

Now, the guy for whom I'm writing the project wants to have a capacity
to produce reports, say County by Gender or County by Urban/Rural
or Gender by Urban/Rural - or Gender by Over/Under16/26/whateverAge.

What is a good way of doing this using Quick Reports? Am I better off
putting the data in some sort of .csv file from which he can import into
Excel?

The trouble is, I don't know in advance what fields he'll choose to
analyse - or do I just have to do a truckload of reports for every
possible combination?

Thanks to anybody can help.

Paul...

--

plinehan__AT__yahoo__DOT__com

C++ Builder 5 SP1, Interbase 6.0.1.6 IBX 5.04

 

Re:Reports grouped by various criteria - using Quick Reports.


Hi Paul,
have a report parameters input form in which, he'd choose:
1. range of column values (eg. start and end country etc..)
2. grouping (it may be a listbox containing all the columns or you can
restrict him to choose only 1 or 2 columns).

when he runs the report, generate an SQL statement using the values
above. This may be something like:
a) SELECT * from mastertable where (<field1> >= startvalue1 and <field1>
<= endvalue1)
ORDER by <the comma-delimited fields-string generated by iterating
through the "group by" listbox>
b) in your quickreport, drop in as many QRgroupbands and corresponding
footers as the no. of fields you're allowing user to group by (this is
optional and you can restrict user to select only 1 or 2 fields).
Enable and disable the groups not required for any particular run where
user hasn't selected all the columns in orderby.
c) add additional bands as required.
NOTE: make sure you have the query component as the datasource of the
quickreport.

hope this helps.
Cheers
Dhaval Shah
Sr. Software Developer
Perth, Australia

select <

Quote
Paul Linehan wrote:
> Hi all,

> I have a project and I'm now trying to add the reporting capabilities.

> The main table is the Member table, which has things like

> County, A DateOfBirth, Urban/Rural and Gender.

> Now, the guy for whom I'm writing the project wants to have a capacity
> to produce reports, say County by Gender or County by Urban/Rural
> or Gender by Urban/Rural - or Gender by Over/Under16/26/whateverAge.

> What is a good way of doing this using Quick Reports? Am I better off
> putting the data in some sort of .csv file from which he can import into
> Excel?

> The trouble is, I don't know in advance what fields he'll choose to
> analyse - or do I just have to do a truckload of reports for every
> possible combination?

> Thanks to anybody can help.

> Paul...

Re:Reports grouped by various criteria - using Quick Reports.


MrDhavalS...@yahoo.com.au says...

Quote
> hope this helps.

Certainly sounds like a good start. I suppose that I can fire the
contents of the query at a .csv convertor component if he wants Excel
also?

Paul...

Quote
> Dhaval Shah

--

plinehan__AT__yahoo__DOT__com

C++ Builder 5 SP1, Interbase 6.0.1.6 IBX 5.04

Re:Reports grouped by various criteria - using Quick Reports.


Hi Paul,
you sure can! ;-)
cheers
Dhaval Shah
Sr. Software Developer
Perth, Australia
Quote
Paul Linehan wrote:
> MrDhavalS...@yahoo.com.au says...

>>hope this helps.

> Certainly sounds like a good start. I suppose that I can fire the
> contents of the query at a .csv convertor component if he wants Excel
> also?

> Paul...

>>Dhaval Shah

Other Threads