public function testSetSessionId() { $sessionId = 't1mo0x45seatmr451xegqy55'; $headerStr = sprintf('<ExecutionHeader xmlns="%s"><ExecutionID>%s</ExecutionID></ExecutionHeader>', 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', $sessionId); $soapVar = new SoapVar($headerStr, XSD_ANYXML, null, null, null); $soapHeader = new SoapHeader('http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ExecutionHeader', $soapVar); $soapMock = $this->getMockFromWsdl(dirname(__FILE__) . '/ReportTest/ReportExecution2005.wsdl', 'SoapClientMockSession', '', array('__setSoapHeaders')); $soapMock->expects($this->any())->method('__setSoapHeaders')->with($this->equalTo(array($soapHeader))); $ssrs = new SSRS_Report('http://test/ReportServer'); $ssrs->setSoapExecution($soapMock); $result = $ssrs->setSessionId($sessionId); $this->assertEquals($ssrs, $result); }
<?php require '../library/SSRS/Report.php'; $options = array('username' => 'testing', 'password' => 'password'); $ssrs = new SSRS_Report('http://localhost/reportserver/', $options); $result = $ssrs->loadReport('/Reports/Reference_Report'); $ssrs->setSessionId($result->executionInfo->ExecutionID); $output = $ssrs->render('HTML4.0'); // PDF | XML | CSV echo $output;
<?php require '../library/SSRS/Report.php'; include_once 'Zend/Debug.php'; $options = array('username' => 'CaymanUnreg', 'password' => 'Gottex2011'); $ssrs = new SSRS_Report('http://212.203.112.85/reportserver/', $options); $result = $ssrs->loadReport('/Off Shore/Cayman Weekly Risk'); Zend_Debug::dump($result); //die(); $reportParameters = array('managedaccount' => '1'); $parameters = new SSRS_Object_ExecutionParameters($reportParameters); $ssrs->setSessionId($result->executionInfo->ExecutionID)->setExecutionParameters($parameters); $output = $ssrs->render('HTML4.0'); // PDF | XML | CSV echo $output;