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,518
-
$7,518
$5,657
-
$5,657
$5,030
-
$5,030
$4,756
-
$4,756
$4,750
-
$4,750
$4,718
-
$4,718
$3,590
-
$3,590
$3,473
-
$3,473
$2,880
-
$2,880
$2,535
-
$2,535
$1,910
-
$1,910
$1,193
-
$1,193
$48,010
-
$48,010
$9,300
-
$9,300
$5,199
-
$5,199
$3,354
-
$3,354
$2,974
-
$2,974
$2,316
-
$2,316
$1,909
-
$1,909
$1,645
-
$1,645
$1,503
-
$1,503
$28,200
-
$28,200
$4,289
-
$4,289
$4,036
-
$4,036
$2,870
-
$2,870
$2,193
-
$2,193
$2,060
-
$2,060
$1,682
-
$1,682
$1,335
-
$1,335
$974
-
$974
$19,438
-
$19,438
$5,176
-
$5,176
$4,753
-
$4,753
$3,845
-
$3,845
$2,553
-
$2,553
$16,327
-
$16,327
$3,303
-
$3,303
$3,176
-
$3,176
$2,976
-
$2,976
$2,101
-
$2,101
$2,059
-
$2,059
$1,566
-
$1,566
$15,182
-
$15,182
$127,156
-
$127,156
$4,602
-
$4,602
$4,111
-
$4,111
$4,094
-
$4,094
$4,021
-
$4,021
$3,672
-
$3,672
$3,320
-
$3,320
$3,321
-
$3,321
$2,360
-
$2,360
$2,047
-
$2,047
$1,413
-
$1,413
$1,383
-
$1,383
$1,380
-
$1,380
$1,344
-
$1,344
$1,118
-
$1,118
$38,187
-
$38,187
$5,669
-
$5,669
$4,931
-
$4,931
$4,754
-
$4,754
$3,506
-
$3,506
$3,296
-
$3,296
$2,921
-
$2,921
$2,907
-
$2,907
$2,907
-
$2,907
$1,482
-
$1,482
$1,420
-
$1,420
$946
-
$946
$34,738
-
$34,738
$3,173
-
$3,173
$3,172
-
$3,172
$3,067
-
$3,067
$2,798
-
$2,798
$2,673
-
$2,673
$2,622
-
$2,622
$1,682
-
$1,682
$19,186
-
$19,186
$3,348
-
$3,348
$2,773
-
$2,773
$1,753
-
$1,753
$7,874
-
$7,874
$99,984
-
$99,984
$6,307
-
$6,307
$5,859
-
$5,859
-
$5,352
$5,352
$4,555
-
$4,555
$4,335
-
$4,335
$4,271
-
$4,271
$3,728
-
$3,728
-
$3,640
$3,640
-
$3,198
$3,198
$2,937
-
$2,937
$2,733
-
$2,733
$34,724
$12,191
$46,915
$9,835
-
$9,835
$9,428
-
$9,428
$7,020
-
$7,020
$4,420
-
$4,420
$4,057
-
$4,057
$2,528
-
$2,528
$2,234
-
$2,234
$39,522
-
$39,522
$74,246
$12,191
$86,437
$4,367
-
$4,367
$4,199
-
$4,199
$4,045
-
$4,045
$3,775
-
$3,775
$3,570
-
$3,570
$3,490
-
$3,490
$3,373
-
$3,373
$2,976
-
$2,976
$2,706
-
$2,706
$2,655
-
$2,655
$2,337
-
$2,337
$1,677
-
$1,677
$1,633
-
$1,633
$1,332
-
$1,332
$1,281
-
$1,281
$1,165
-
$1,165
$597
-
$597
$45,177
-
$45,177
$8,603
-
$8,603
$7,708
-
$7,708
$6,995
-
$6,995
$3,118
-
$3,118
$26,424
-
$26,424
$2,348
-
$2,348
$2,261
-
$2,261
$1,642
-
$1,642
$6,251
-
$6,251
$2,352
-
$2,352
$2,352
-
$2,352
$2,019
-
$2,019
$2,019
-
$2,019
$82,223
-
$82,223
$4,520
-
$4,520
$3,619
-
$3,619
$3,535
-
$3,535
$2,835
-
$2,835
$2,667
-
$2,667
$2,472
-
$2,472
$2,342
-
$2,342
$1,853
-
$1,853
$1,735
-
$1,735
$1,505
-
$1,505
$1,304
-
$1,304
$672
-
$672
$29,060
-
$29,060
$10,343
-
$10,343
$4,884
-
$4,884
$1,885
-
$1,885
$17,112
-
$17,112
$9,468
-
$9,468
$3,237
-
$3,237
$12,704
-
$12,704
$58,876
-
$58,876
-
$10,612
$10,612
-
$6,025
$6,025
-
$3,864
$3,864
-
$3,055
$3,055
-
$2,241
$2,241
-
$1,600
$1,600
-
$27,397
$27,397
-
$8,981
$8,981
-
$4,680
$4,680
-
$4,527
$4,527
-
$18,188
$18,188
-
$3,596
$3,596
-
$3,177
$3,177
-
$1,992
$1,992
-
$876
$876
-
$871
$871
-
$835
$835
-
$11,348
$11,348
-
$56,932
$56,932
-
$4,499
$4,499
-
$4,283
$4,283
-
$3,494
$3,494
-
$1,066
$1,066
-
$13,342
$13,342
-
$4,933
$4,933
-
$3,158
$3,158
-
$8,091
$8,091
-
$21,432
$21,432
$6,050
-
$6,050
$3,365
-
$3,365
$9,415
-
$9,415
-
$4,427
$4,427
-
$1,077
$1,077
-
$5,504
$5,504
-
$1,814
$1,814
-
$1,280
$1,280
-
$3,095
$3,095
-
$2,346
$2,346
-
$2,346
$2,346
$9,415
$10,945
$20,360
$4,300
-
$4,300
$2,263
-
$2,263
$1,368
-
$1,368
$7,931
-
$7,931
$3,769
-
$3,769
$2,089
-
$2,089
$5,859
-
$5,859
$1,728
-
$1,728
$1,728
-
$1,728
$15,517
-
$15,517
-
$4,135
$4,135
-
$2,896
$2,896
-
$2,217
$2,217
-
$1,801
$1,801
-
$1,383
$1,383
-
$12,432
$12,432
-
$12,432
$12,432
$4,129
-
$4,129
$1,938
-
$1,938
$6,067
-
$6,067
$1,676
-
$1,676
$1,676
-
$1,676
$7,743
-
$7,743
$475,161
$113,933
$589,094
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.33
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