Board index » delphi » Can report builder do cross/tab reports?

Can report builder do cross/tab reports?

Hi
I am doing an evaluation of Report Builder. Can anyone please tell me if
a cross/tab report is possible and where do I get a sample if so?
Theo Pistorius
 

Re:Can report builder do cross/tab reports?


Quote
Theo Pistorius wrote:

> Hi
> I am doing an evaluation of Report Builder. Can anyone please tell me if
> a cross/tab report is possible and where do I get a sample if so?
> Theo Pistorius

We'll be adding a cross tab component in the future.

For now, you can simulate some cross tab report by sorting the data and
using newspaper column style printing. Below is an example...

Quote
> I have data like this:

> MeasDate        ObjectType      SUM

> 4/1/98  Cooling Tower   0
> 4/1/98  HP Separator Vessel     62.42
> 4/1/98  IP Separator Vessel     50.00
> 4/1/98  Lucerne Plant   35.98
> 4/1/98  Reinjection Well        81.86
> 4/1/98  Steam Main      0.00
> 4/1/98  Surface Water   0.00
> 4/1/98  Water Feeder    112.42
> 4/2/98  Cooling Tower   0
> 4/2/98  HP Separator Vessel     130.05
> 4/2/98  IP Separator Vessel     103.85
> 4/2/98  Lucerne Plant   73.09
> 4/2/98  Reinjection Well        157.83
> 4/2/98  Steam Main      0.00
> 4/2/98  Surface Water   0.00
> 4/2/98  Water Feeder    233.90

> And two groups, on MeasDate and ObjectType, what I'm wanting to get out is:

>         TYPE1   TYPE2   TYPE3
> DATE    SUM1    SUM1    SUM1
> DATE    SUM1    SUM1    SUM1
> DATE    SUM1    SUM1    SUM1

Try sorting the data like this:

Date    Type                    Sum
------  ----------------------  -------
4/1/98  Date                    0
4/2/98  Date                    0
4/1/98  Cooling Tower           0
4/2/98  Cooling Tower           0
4/1/98  HP Separator Vessel     62.42
4/2/98  HP Separator Vessel     130.05
4/1/98  IP Separator Vessel     50
4/2/98  IP Separator Vessel     103.85
4/1/98  Lucerne Plant           35.98
4/2/98  Lucerne Plant           73.09
4/1/98  Reinjection Well        81.86
4/2/98  Reinjection Well        157.83
4/1/98  Steam Main              0
4/2/98  Steam Main              0
4/1/98  Surface Water           0
4/2/98  Surface Water           0
4/1/98  Water Feeder            112.42
4/2/98  Water Feeder            233.9

Create the two dummy records at the top.

At design-time:

Create a single NewColumn group on Type.

Set the column header DBText field to Type.

At run-time:

In the BeforeGenerate of the relevant band:

When Report.CurrentColumn = 1:
  1. Set the column header DBText invisible.
  2. Set the DBText in the detail band to the Date field

When Report.CurrentColumn > 1:
  1. Set the column header DBText to visible.
  2. Set the DBText in the detail band to the Sum field.

This should give you the following report:

        Cooling Tower   HP Separator Vessel     IP Separator Vessel     IP Separator
Vessel....
4/1/98              0                 62.42                      50                   35.98    
4/2/98              0                130.05                  103.85                  
73.09  

--
Nard Moseley            mailto:n...@digital-metaphors.com
Digital Metaphors       http://www.digital-metaphors.com

Other Threads