This project is read-only.

Problem with report download in IE

Jul 28, 2011 at 9:42 AM

hy all,

if i try to download a report in firefox it works great.

but in ie i always get following error message for the first download attempt...

Unable to download reporting.php from xxx.xxxxx.ch
Unable to open this internet site. The requested site is either unavailable or cannot be found. Please try again later.

Why is it trying to download reporting.php?

here is my code:

require_once 'SSRSReport.php';
$report = $_GET["Report"];
$quotID = $_GET["QuotID"];

define("REPORT", "/ReportsEgasTest/".$report."");
$settings = parse_ini_file("app.config", 1);

try
{
     $rs = new SSRSReport(new Credentials($settings["UID"], $settings["PASWD"]),$settings["SERVICE_URL"]);
    if (isset($_REQUEST['rs:Command']))
    {
        switch($_REQUEST['rs:Command'])
        {
            case 'Sort':
                $rs->Sort2($_REQUEST['rs:SortId'],
                           $_REQUEST['rs:SortDirection'],
                           $_REQUEST['rs:ClearSort'],
                           PageCountModeEnum::$Estimate,
                           $ReportItem,
                           $ExecutionInfo);
                  break;
            default:
                echo 'Unknown :' . $_REQUEST['rs:Command'];
                exit;
        }
    }
    else
    {
        $executionInfo = $rs->LoadReport2(REPORT, NULL);
        $parameters = array();
		
		if($report == "order_confirmation") {
			$parameters[0] = new ParameterValue();
			$parameters[0]->Name = "QuotID";
			$parameters[0]->Value = $quotID;	
			}
		else{
			
		}
        $rs->SetExecutionParameters2($parameters);
    }

    $renderAsPDF = new RenderAsPDF();
	//$renderAsPDF->PageWidth = "12.5in";
	$result = $rs->Render2($renderAsPDF,
		PageCountModeEnum::$Estimate,
		$Extension,
		$MimeType,
		$Encoding,
		$Warnings,
		$StreamIds);
header("Content-Type: application/pdf");
header("Content-Disposition: attachment; filename=\"".$report."");
header("Content-length: ".(string)(strlen($result)));
header("Expires: ".gmdate("D, d M Y H:i:s", mktime(date("H")+2,
                                                      date("m"), date("d"),
													  date("Y")))." GMT");
													  header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
													  header("Cache-Control: no-cache, must-revalidate");
													  header("Pragma: no-cache");

   echo $result;
}
catch(SSRSReportException $serviceExcprion)
{
    echo  $serviceExcprion->GetErrorMessage();
}

 

any idea?

thx in advance & cheers

 

Aug 9, 2011 at 10:01 AM

no idea?

Aug 9, 2011 at 10:26 AM

ok,the solution was to define content-type as application-download and add the .pdf to the filename....