summaryrefslogtreecommitdiffstats
path: root/library/SSRS/Object/ReportOutput.php
blob: 05005250051cbae3593cfbf0b06330f027ccb788 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php

namespace SSRS\Object;

class ReportOutput extends ObjectAbstract {

    public function download($filename) {
        header("Cache-control: max-age=3600, must-revalidate");
        header("Pragma: public");
        header("Expires: -1");
        header("Content-Description: File Transfer");
        header('Content-Disposition: attachment; filename="' . $filename . '"');
        header("Content-Type: " . $this->MimeType);
        header("Content-Transfer-Encoding: binary");
        header("Content-Length: " . strlen($this->Result));

        echo($this->Result);
        exit(0);
    }

    public function __toString() {
        return (string) $this->Result;
    }

}