diff options
author | arron.woods <arron.woods@deae1e92-32f9-c189-e222-5b9b5081a27a> | 2011-03-10 23:14:50 +0000 |
---|---|---|
committer | arron.woods <arron.woods@deae1e92-32f9-c189-e222-5b9b5081a27a> | 2011-03-10 23:14:50 +0000 |
commit | 634884044dd95345962db9e54764f37f6ba84853 (patch) | |
tree | e16f69cd22e0ac4a1759987e2f66566b4f9a08eb /samples | |
download | php-ssrs-634884044dd95345962db9e54764f37f6ba84853.zip php-ssrs-634884044dd95345962db9e54764f37f6ba84853.tar.gz php-ssrs-634884044dd95345962db9e54764f37f6ba84853.tar.bz2 |
v0.1 committed
Diffstat (limited to 'samples')
-rwxr-xr-x | samples/GetItemDefinition.php | 23 | ||||
-rwxr-xr-x | samples/ListChildren.php | 22 | ||||
-rwxr-xr-x | samples/ListRenderingExtensions.php | 40 | ||||
-rwxr-xr-x | samples/LoadReport.php | 23 |
4 files changed, 108 insertions, 0 deletions
diff --git a/samples/GetItemDefinition.php b/samples/GetItemDefinition.php new file mode 100755 index 0000000..5139500 --- /dev/null +++ b/samples/GetItemDefinition.php @@ -0,0 +1,23 @@ +<?php + +require('../library/SSRS/Report.php'); + +try { + $options = array( + 'username' => 'testing', + 'password' => 'password' + ); + + $ssrs = new SSRS_Report('http://localhost/reportserver/', $options); + + $ItemPath = '/Reports/Reference_Report'; + + $result = $ssrs->getItemDefinition($ItemPath); + + header('Content-Type:text/xml'); + echo $result; +} catch (Exception $error) { + echo 'Exception:' . PHP_EOL; + print_r($error); +} +?> diff --git a/samples/ListChildren.php b/samples/ListChildren.php new file mode 100755 index 0000000..eca797c --- /dev/null +++ b/samples/ListChildren.php @@ -0,0 +1,22 @@ +<?php +require(dirname(__FILE__) . '/../library/SSRS/Report.php'); + +try { + $options = array( + 'username' => 'testing', + 'password' => 'password', + ); + + $ssrs = new SSRS_Report('http://localhost/reportserver/', $options); + $result = $ssrs->listChildren('/Reports', true); + +// print_r($result); + + foreach($result->CatalogItems AS $item){ + echo $item->Name . ': ' . $item->Path . PHP_EOL; + } + +} catch (Exception $error) { + echo 'Exception:' . PHP_EOL; + print_r($error); +} diff --git a/samples/ListRenderingExtensions.php b/samples/ListRenderingExtensions.php new file mode 100755 index 0000000..0f17f2a --- /dev/null +++ b/samples/ListRenderingExtensions.php @@ -0,0 +1,40 @@ +<?php +require('../library/SSRS/Report.php'); + +try { + $options = array( + 'username' => 'testing', + 'password' => 'password' + ); + + $ssrs = new SSRS_Report('http://localhost/reportserver/', $options); + $results = $ssrs->listRenderingExtensions(); + + echo '<table border="1" width="100%">'; + echo '<tr>'; + echo '<th>ExtensionType</th>'; + echo '<th>Name</th>'; + echo '<th>LocalisedName</th>'; + echo '<th>Visible</th>'; + echo '<th>IsModelGenerationSupported</th>'; + echo '</tr>'; + foreach ($results->Extensions->Extension as $extension) { + $extension->Visible = (empty($extension->Visible))?"Null":$extension->Visible; + $extension->IsModelGenerationSupported = (empty($extension->IsModelGenerationSupported))?"Null":$extension->IsModelGenerationSupported; + + echo '<tr>'; + echo '<td>'.$extension->ExtensionType.'</td>'; + echo '<td>'.$extension->Name.'</td>'; + echo '<td>'.$extension->LocalizedName.'</td>'; + echo '<td>'.$extension->Visible.'</td>'; + echo '<td>'.$extension->IsModelGenerationSupported.'</td>'; + echo '</tr>'; + } + echo '</table>'; + +} catch (Exception $error) { + echo 'Exception:' . PHP_EOL; + print_r($error); + +} +?>
\ No newline at end of file diff --git a/samples/LoadReport.php b/samples/LoadReport.php new file mode 100755 index 0000000..c33c3af --- /dev/null +++ b/samples/LoadReport.php @@ -0,0 +1,23 @@ +<?php +require('../library/SSRS/Report.php'); + +try { + $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); + $ssrs->setExecutionParameters(new SSRS_Object_ExecutionParameters($result->executionInfo->Parameters)); + + $output = $ssrs->render('HTML4.0'); // PDF | XML | CSV + echo $output; +} catch (Exception $error) { + echo 'Exception:' . PHP_EOL; + print_r($error); + +} +?> |