Interactive Sale Report

Sale Report is built upon interactive PivotMatrix allowing you to custom dimension fields or measurement field.

  Number of Sales   Month   Day  
  Total Sales  
  Year  
  Customer   Category   Product  
Year 2004
Year 2005
All
Australian Collectors, Co.
Classic Cars
1976 Ford Gran Torino
1952 Alpine Renault 1300
1992 Ferrari 360 Spider red
1993 Mazda RX-7
1957 Corvette Convertible
1956 Porsche 356A Coupe
1962 LanciaA Delta 16V
1948 Porsche 356-A Roadster
1971 Alpine Renault 1600s
1995 Honda Civic
1969 Dodge Super Bee
1982 Lamborghini Diablo
All
Motorcycles
2003 Harley-Davidson Eagle Drag Bike
1996 Moto Guzzi 1100i
1997 BMW R 1100 S
1969 Harley Davidson Ultimate Chopper
1960 BSA Gold Star DBD34
1997 BMW F650 ST
1936 Harley Davidson El Knucklehead
1957 Vespa GS150
All
Vintage Cars
18th Century Vintage Horse Carriage
1913 Ford Model T Speedster
1928 Mercedes-Benz SSK
1917 Maxwell Touring Car
1934 Ford V8 Coupe
1930 Buick Marquette Phaeton
1928 Ford Phaeton Deluxe
1936 Mercedes-Benz 500K Special Roadster
All
Trucks and Buses
1940s Ford truck
1940 Ford Pickup Truck
1958 Setra Bus
1926 Ford Fire Engine
All
Planes
ATA: B757-300
P-51-D Mustang
1928 British Royal Navy Airplane
American Airlines: B767-300
F/A 18 Hornet 1/72
1900s Vintage Tri-Plane
All
All
AV Stores, Co.
Vintage Cars
1932 Alfa Romeo 8C2300 Spider Sport
1937 Lincoln Berline
1932 Model A Ford J-Coupe
18th Century Vintage Horse Carriage
1903 Ford Model A
1904 Buick Runabout
1928 Mercedes-Benz SSK
1912 Ford Model T Delivery Wagon
1911 Ford Town Car
1936 Mercedes Benz 500k Roadster
1936 Mercedes-Benz 500K Special Roadster
1934 Ford V8 Coupe
1939 Chevrolet Deluxe Coupe
1938 Cadillac V-16 Presidential Limousine
All
Classic Cars
2001 Ferrari Enzo
1969 Corvair Monza
1952 Citroen-15CV
1969 Chevrolet Camaro Z28
1949 Jaguar XK 120
2002 Chevy Corvette
1969 Ford Falcon
1970 Triumph Spitfire
1957 Ford Thunderbird
1970 Chevy Chevelle SS 454
1966 Shelby Cobra 427 S/C
All
Ships
The Titanic
18th century schooner
The Schooner Bluenose
The Mayflower
The USS Constitution Ship
The Queen Mary
Pont Yacht
All
Trains
Collectable Wooden Train
1950's Chicago Surface Lines Streetcar
1962 City of Detroit Streetcar
All
All
Auto Canal+ Petit
Motorcycles
2002 Yamaha YZR M1
1974 Ducati 350 Mk3 Desmo
1996 Moto Guzzi 1100i
2002 Suzuki XREO
1957 Vespa GS150
1982 Ducati 900 Monster
1969 Harley Davidson Ultimate Chopper
1960 BSA Gold Star DBD34
1936 Harley Davidson El Knucklehead
1982 Ducati 996 R
1997 BMW R 1100 S
All
Classic Cars
1976 Ford Gran Torino
1957 Corvette Convertible
1968 Ford Mustang
1961 Chevrolet Impala
1969 Dodge Super Bee
1971 Alpine Renault 1600s
1970 Plymouth Hemi Cuda
All
All
Amica Models & Co.
Vintage Cars
1937 Lincoln Berline
1917 Grand Touring Sedan
1932 Model A Ford J-Coupe
1913 Ford Model T Speedster
1904 Buick Runabout
1928 Mercedes-Benz SSK
1917 Maxwell Touring Car
18th Century Vintage Horse Carriage
1932 Alfa Romeo 8C2300 Spider Sport
1903 Ford Model A
1934 Ford V8 Coupe
1936 Chrysler Airflow
1938 Cadillac V-16 Presidential Limousine
1911 Ford Town Car
1936 Mercedes-Benz 500K Special Roadster
1936 Mercedes Benz 500k Roadster
1939 Chevrolet Deluxe Coupe
All
Classic Cars
2001 Ferrari Enzo
1969 Ford Falcon
1952 Alpine Renault 1300
1969 Corvair Monza
All
Ships
18th century schooner
The Mayflower
Pont Yacht
All
Trucks and Buses
1940 Ford Pickup Truck
All
Trains
Collectable Wooden Train
All
All
Auto Associés & Cie.
Vintage Cars
1913 Ford Model T Speedster
1917 Maxwell Touring Car
1937 Lincoln Berline
1928 Mercedes-Benz SSK
1936 Chrysler Airflow
1932 Model A Ford J-Coupe
18th Century Vintage Horse Carriage
1938 Cadillac V-16 Presidential Limousine
1936 Mercedes-Benz 500K Special Roadster
1939 Cadillac Limousine
1934 Ford V8 Coupe
1939 Chevrolet Deluxe Coupe
All
Trucks and Buses
1958 Setra Bus
1940 Ford Pickup Truck
1996 Peterbilt 379 Stake Bed with Outrigger
All
Classic Cars
1952 Alpine Renault 1300
1982 Camaro Z28
All
All
Anna's Decorations, Ltd
Trucks and Buses
1958 Setra Bus
1940 Ford Pickup Truck
1926 Ford Fire Engine
1940s Ford truck
1964 Mercedes Tour Bus
1996 Peterbilt 379 Stake Bed with Outrigger
All
Classic Cars
1962 LanciaA Delta 16V
1952 Alpine Renault 1300
1992 Ferrari 360 Spider red
All
Vintage Cars
1937 Lincoln Berline
1913 Ford Model T Speedster
1936 Mercedes-Benz 500K Special Roadster
1939 Chevrolet Deluxe Coupe
1938 Cadillac V-16 Presidential Limousine
1939 Cadillac Limousine
All
All
Australian Gift Network, Co
Motorcycles
1996 Moto Guzzi 1100i
1997 BMW R 1100 S
2003 Harley-Davidson Eagle Drag Bike
1936 Harley Davidson El Knucklehead
All
Planes
1928 British Royal Navy Airplane
P-51-D Mustang
All
All
Australian Collectables, Ltd
Classic Cars
1976 Ford Gran Torino
1969 Dodge Super Bee
All
Vintage Cars
1941 Chevrolet Special Deluxe Cabriolet
1937 Horch 930V Limousine
All
Planes
Boeing X-32A JSF
1900s Vintage Bi-Plane
All
Ships
HMS Bounty
All
All
Auto-Moto Classics Inc.
Planes
America West Airlines B757-200
Boeing X-32A JSF
American Airlines: MD-11S
All
Vintage Cars
1936 Chrysler Airflow
1917 Maxwell Touring Car
All
Ships
HMS Bounty
All
All
Alpha Cognac
Ships
The Titanic
The Queen Mary
The Mayflower
Pont Yacht
The USS Constitution Ship
All
All
Atelier graphique
Motorcycles
1996 Moto Guzzi 1100i
1936 Harley Davidson El Knucklehead
All
Vintage Cars
1938 Cadillac V-16 Presidential Limousine
All
All
All
$7,519
$0
$7,519
$5,657
$0
$5,657
$5,030
$0
$5,030
$4,756
$0
$4,756
$4,750
$0
$4,750
$4,718
$0
$4,718
$3,590
$0
$3,590
$3,473
$0
$3,473
$2,880
$0
$2,880
$2,535
$0
$2,535
$1,910
$0
$1,910
$1,193
$0
$1,193
$48,010
$0
$48,010
$9,300
$0
$9,300
$5,199
$0
$5,199
$3,354
$0
$3,354
$2,974
$0
$2,974
$2,316
$0
$2,316
$1,909
$0
$1,909
$1,645
$0
$1,645
$1,503
$0
$1,503
$28,200
$0
$28,200
$4,289
$0
$4,289
$4,036
$0
$4,036
$2,870
$0
$2,870
$2,193
$0
$2,193
$2,060
$0
$2,060
$1,682
$0
$1,682
$1,335
$0
$1,335
$974
$0
$974
$19,438
$0
$19,438
$5,176
$0
$5,176
$4,753
$0
$4,753
$3,845
$0
$3,845
$2,553
$0
$2,553
$16,327
$0
$16,327
$3,303
$0
$3,303
$3,176
$0
$3,176
$2,976
$0
$2,976
$2,101
$0
$2,101
$2,059
$0
$2,059
$1,566
$0
$1,566
$15,182
$0
$15,182
$127,156
$0
$127,156
$4,602
$0
$4,602
$4,111
$0
$4,111
$4,094
$0
$4,094
$4,021
$0
$4,021
$3,672
$0
$3,672
$3,320
$0
$3,320
$3,321
$0
$3,321
$2,360
$0
$2,360
$2,047
$0
$2,047
$1,413
$0
$1,413
$1,383
$0
$1,383
$1,380
$0
$1,380
$1,344
$0
$1,344
$1,118
$0
$1,118
$38,187
$0
$38,187
$5,669
$0
$5,669
$4,931
$0
$4,931
$4,754
$0
$4,754
$3,506
$0
$3,506
$3,296
$0
$3,296
$2,921
$0
$2,921
$2,907
$0
$2,907
$2,907
$0
$2,907
$1,482
$0
$1,482
$1,420
$0
$1,420
$946
$0
$946
$34,738
$0
$34,738
$3,173
$0
$3,173
$3,172
$0
$3,172
$3,067
$0
$3,067
$2,798
$0
$2,798
$2,673
$0
$2,673
$2,622
$0
$2,622
$1,682
$0
$1,682
$19,186
$0
$19,186
$3,348
$0
$3,348
$2,773
$0
$2,773
$1,753
$0
$1,753
$7,874
$0
$7,874
$99,984
$0
$99,984
$6,307
$0
$6,307
$5,859
$0
$5,859
$0
$5,352
$5,352
$4,555
$0
$4,555
$4,335
$0
$4,335
$4,271
$0
$4,271
$3,728
$0
$3,728
$0
$3,640
$3,640
$0
$3,198
$3,198
$2,937
$0
$2,937
$2,733
$0
$2,733
$34,724
$12,191
$46,915
$9,835
$0
$9,835
$9,428
$0
$9,428
$7,020
$0
$7,020
$4,420
$0
$4,420
$4,057
$0
$4,057
$2,528
$0
$2,528
$2,234
$0
$2,234
$39,522
$0
$39,522
$74,246
$12,191
$86,437
$4,367
$0
$4,367
$4,199
$0
$4,199
$4,045
$0
$4,045
$3,775
$0
$3,775
$3,570
$0
$3,570
$3,490
$0
$3,490
$3,373
$0
$3,373
$2,976
$0
$2,976
$2,706
$0
$2,706
$2,655
$0
$2,655
$2,337
$0
$2,337
$1,677
$0
$1,677
$1,633
$0
$1,633
$1,332
$0
$1,332
$1,281
$0
$1,281
$1,165
$0
$1,165
$597
$0
$597
$45,177
$0
$45,177
$8,603
$0
$8,603
$7,708
$0
$7,708
$6,995
$0
$6,995
$3,118
$0
$3,118
$26,424
$0
$26,424
$2,348
$0
$2,348
$2,261
$0
$2,261
$1,642
$0
$1,642
$6,251
$0
$6,251
$2,352
$0
$2,352
$2,352
$0
$2,352
$2,019
$0
$2,019
$2,019
$0
$2,019
$82,223
$0
$82,223
$4,520
$0
$4,520
$3,619
$0
$3,619
$3,535
$0
$3,535
$2,835
$0
$2,835
$2,667
$0
$2,667
$2,472
$0
$2,472
$2,342
$0
$2,342
$1,853
$0
$1,853
$1,735
$0
$1,735
$1,505
$0
$1,505
$1,304
$0
$1,304
$672
$0
$672
$29,060
$0
$29,060
$10,343
$0
$10,343
$4,884
$0
$4,884
$1,885
$0
$1,885
$17,112
$0
$17,112
$9,468
$0
$9,468
$3,237
$0
$3,237
$12,704
$0
$12,704
$58,876
$0
$58,876
$0
$10,612
$10,612
$0
$6,025
$6,025
$0
$3,864
$3,864
$0
$3,055
$3,055
$0
$2,241
$2,241
$0
$1,600
$1,600
$0
$27,397
$27,397
$0
$8,981
$8,981
$0
$4,680
$4,680
$0
$4,527
$4,527
$0
$18,188
$18,188
$0
$3,596
$3,596
$0
$3,177
$3,177
$0
$1,992
$1,992
$0
$876
$876
$0
$871
$871
$0
$835
$835
$0
$11,348
$11,348
$0
$56,932
$56,932
$0
$4,499
$4,499
$0
$4,283
$4,283
$0
$3,494
$3,494
$0
$1,066
$1,066
$0
$13,342
$13,342
$0
$4,933
$4,933
$0
$3,158
$3,158
$0
$8,091
$8,091
$0
$21,432
$21,432
$6,050
$0
$6,050
$3,365
$0
$3,365
$9,415
$0
$9,415
$0
$4,427
$4,427
$0
$1,077
$1,077
$0
$5,504
$5,504
$0
$1,814
$1,814
$0
$1,280
$1,280
$0
$3,095
$3,095
$0
$2,346
$2,346
$0
$2,346
$2,346
$9,415
$10,945
$20,360
$4,300
$0
$4,300
$2,263
$0
$2,263
$1,368
$0
$1,368
$7,931
$0
$7,931
$3,769
$0
$3,769
$2,089
$0
$2,089
$5,859
$0
$5,859
$1,728
$0
$1,728
$1,728
$0
$1,728
$15,517
$0
$15,517
$0
$4,135
$4,135
$0
$2,896
$2,896
$0
$2,217
$2,217
$0
$1,801
$1,801
$0
$1,383
$1,383
$0
$12,432
$12,432
$0
$12,432
$12,432
$4,129
$0
$4,129
$1,938
$0
$1,938
$6,067
$0
$6,067
$1,676
$0
$1,676
$1,676
$0
$1,676
$7,743
$0
$7,743
$475,161
$113,933
$589,095
Page size:

PivotMatrix is an awesome widget to let users construct their own pivot by customizing fields with drag and drop.

<?php
require_once "CustomersYears.php";
$CustomersYears = new CustomersYears;
$CustomersYears->run()->render();
?>    
<?php
require_once "../../../load.koolreport.php";
use \koolreport\processes\Filter;
use \koolreport\processes\ColumnMeta;
use \koolreport\pivot\processes\Pivot;

class CustomersYears extends koolreport\KoolReport
{
    function settings()
    {
        return array(
            "dataSources" => array(
                "dollarsales"=>array(
                    'filePath' => '../../../databases/customer_product_dollarsales2.csv',
                    'fieldSeparator' => ';',
                    'class' => "\koolreport\datasources\CSVDataSource"      
                ), 
            )
        );
    }
    function setup()
    {
        $this->src('dollarsales')
        ->pipe(new Filter(array(
            array('customerName', 'startsWith', 'a'),
            array('orderDate', '>', 2003),
        )))
        ->pipe(new ColumnMeta(array(
            "dollar_sales"=>array(
                'type' => 'number',
                "prefix" => "$",
            ),
        )))
        ->pipe(new Pivot(array(
            "dimensions"=>array(
                "column" => "orderYear",
                "row" => "customerName, productLine, productName",
            ),
            "aggregates"=>array(
                "sum"=>"dollar_sales",
                "count"=>"dollar_sales"
            )
        )))
        ->pipe($this->dataStore('sales'));  
    }
}
<?php
        use \koolreport\pivot\widgets\PivotMatrix;
        use \koolreport\core\Utility;
        use \koolreport\processes\Filter;
        use \koolreport\processes\ColumnMeta;
        use \koolreport\pivot\processes\Pivot;
        use \koolreport\instant\Widget;
        use \koolreport\datasources\CSVDataSource;
?>

<div class="report-content">  
    <div class="text-center">
        <h1>Interactive Sale Report</h1>
        <p class="lead">Sale Report is built upon interactive PivotMatrix allowing you
            to custom dimension fields or measurement field. 
        </p>
    </div>
    
    <form id='form1' class="form-inline" method="post">

        <?php
        PivotMatrix::create(array(
            "id" => "pivotMatrix1",
            'dataSource' => $this->dataStore('sales'),
            "measures"=>array(
                "dollar_sales - sum", 
            ),
            'rowSort' => array(
                'dollar_sales - sum' => 'desc',
                'productLine' => 'desc',
            ),
            'columnSort' => array(
                'orderMonth' => function($a, $b) {
                    return (int)$a < (int)$b;
                },
            ),
            'columnCollapseLevels' => array(0),
            'rowCollapseLevels' => array(0),
            'width' => '100%',
            'height' => '500px',
            'headerMap' => function($v, $f) {
                switch ($v) {
                    case 'dollar_sales - sum': return 'Total Sales';
                    case 'dollar_sales - count': return 'Number of Sales';
                    case 'dollar_sales - avg': return 'Average Sales';
                    case 'orderYear': return 'Year';
                    case 'orderMonth': return 'Month';
                    case 'orderDay': return 'Day';
                    case 'customerName': return 'Customer';
                    case 'productLine': return 'Category';
                    case 'productName': return 'Product';
                }
                $r = $v;
                if ($f === 'orderYear')
                    $r = 'Year ' . $v;
                $map = array(
                    '1' => 'January',
                    '2' => 'February',
                    '3' => 'March',
                    '4' => 'April',
                    '5' => 'May',
                    '6' => 'June',
                    '7' => 'July',
                    '8' => 'August',
                    '9' => 'September',
                    '10' => 'October',
                    '11' => 'November',
                    '12' => 'December',
                );
                if ($f === 'orderMonth')
                    $r = $map[$v];
                return $r;
            },
            'totalName' => 'All',
            'waitingFields' => array(
                'dollar_sales - count' => 'data', 
                'orderMonth' => 'label',
                'orderDay' => 'label',
            ),
            'paging' => array(
                'size' => 5,
                'maxDisplayedPages' => 5,
                'sizeSelect' => array(5, 10, 20, 50, 100)
            )
        ));
        ?>
    </form>
</div>
customerNameproductNameproductLineorderDateorderDayorderMonthorderYearorderQuarterdollar_sales
Vitachrome Inc. 1937 Lincoln Berline Vintage Cars 2003-01-10 00:00:00 10 1 2003 1 3726.45
Vitachrome Inc. 1936 Mercedes-Benz 500K Special Roadster Vintage Cars 2003-01-10 00:00:00 10 1 2003 1 1768.3300000000002
Baane Mini Imports 1952 Alpine Renault 1300 Classic Cars 2003-01-29 00:00:00 29 1 2003 1 5571.8
Baane Mini Imports 1962 LanciaA Delta 16V Classic Cars 2003-01-29 00:00:00 29 1 2003 1 5026.14
Baane Mini Imports 1958 Setra Bus Trucks and Buses 2003-01-29 00:00:00 29 1 2003 1 3284.28
Baane Mini Imports 1940 Ford Pickup Truck Trucks and Buses 2003-01-29 00:00:00 29 1 2003 1 3307.5
Baane Mini Imports 1926 Ford Fire Engine Trucks and Buses 2003-01-29 00:00:00 29 1 2003 1 1283.48
Baane Mini Imports 1913 Ford Model T Speedster Vintage Cars 2003-01-29 00:00:00 29 1 2003 1 2489.13
Baane Mini Imports 1934 Ford V8 Coupe Vintage Cars 2003-01-29 00:00:00 29 1 2003 1 2164.4
Baane Mini Imports 18th Century Vintage Horse Carriage Vintage Cars 2003-01-29 00:00:00 29 1 2003 1 2173

What People Are Saying

"KoolReport helps me very much in creating data report for my corporate! Keep up your good work!"
-- Alain Melsens

"The first use of your product. I was impressed by its easiness and powerfulness. This product is a great and amazing."
-- Dr. Lew Choy Onn

"Fantastic framework for reporting!"
-- Greg Schneider

Download KoolReport Get KoolReport Pro