summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarron.woods <arron.woods@deae1e92-32f9-c189-e222-5b9b5081a27a>2011-04-11 13:48:57 +0000
committerarron.woods <arron.woods@deae1e92-32f9-c189-e222-5b9b5081a27a>2011-04-11 13:48:57 +0000
commitb3d89e951133b0eaf4eaa50b2d4b2a932f080631 (patch)
tree251a34628e171e55f5ca264b79a2c1aea98af309
parent4850f2c09dc3b8f886bd90cfb8b1b7e380b2d78e (diff)
downloadphp-ssrs-b3d89e951133b0eaf4eaa50b2d4b2a932f080631.zip
php-ssrs-b3d89e951133b0eaf4eaa50b2d4b2a932f080631.tar.gz
php-ssrs-b3d89e951133b0eaf4eaa50b2d4b2a932f080631.tar.bz2
Sample tidyup
-rwxr-xr-xsamples/GetItemDefinition.php25
-rwxr-xr-xsamples/ListChildren.php27
-rwxr-xr-xsamples/ListRenderingExtensions.php57
-rwxr-xr-xsamples/LoadReport.php28
4 files changed, 55 insertions, 82 deletions
diff --git a/samples/GetItemDefinition.php b/samples/GetItemDefinition.php
index 5139500..ff62818 100755
--- a/samples/GetItemDefinition.php
+++ b/samples/GetItemDefinition.php
@@ -2,22 +2,15 @@
require('../library/SSRS/Report.php');
-try {
- $options = array(
- 'username' => 'testing',
- 'password' => 'password'
- );
+$options = array(
+ 'username' => 'testing',
+ 'password' => 'password'
+);
- $ssrs = new SSRS_Report('http://localhost/reportserver/', $options);
+$ssrs = new SSRS_Report('http://localhost/reportserver/', $options);
- $ItemPath = '/Reports/Reference_Report';
+$ItemPath = '/Reports/Reference_Report';
+$result = $ssrs->getItemDefinition($ItemPath);
- $result = $ssrs->getItemDefinition($ItemPath);
-
- header('Content-Type:text/xml');
- echo $result;
-} catch (Exception $error) {
- echo 'Exception:' . PHP_EOL;
- print_r($error);
-}
-?>
+header('Content-Type:text/xml');
+echo $result; \ No newline at end of file
diff --git a/samples/ListChildren.php b/samples/ListChildren.php
index eca797c..513e7a2 100755
--- a/samples/ListChildren.php
+++ b/samples/ListChildren.php
@@ -1,22 +1,15 @@
<?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);
+require(dirname(__FILE__) . '/../library/SSRS/Report.php');
-// print_r($result);
+$options = array(
+ 'username' => 'testing',
+ 'password' => 'password',
+);
- foreach($result->CatalogItems AS $item){
- echo $item->Name . ': ' . $item->Path . PHP_EOL;
- }
+$ssrs = new SSRS_Report('http://localhost/reportserver/', $options);
+$result = $ssrs->listChildren('/Reports', true);
-} catch (Exception $error) {
- echo 'Exception:' . PHP_EOL;
- print_r($error);
-}
+foreach ($result->CatalogItems AS $item) {
+ echo $item->Name . ': ' . $item->Path . PHP_EOL;
+} \ No newline at end of file
diff --git a/samples/ListRenderingExtensions.php b/samples/ListRenderingExtensions.php
index 0f17f2a..5b3bf91 100755
--- a/samples/ListRenderingExtensions.php
+++ b/samples/ListRenderingExtensions.php
@@ -1,40 +1,33 @@
<?php
+
require('../library/SSRS/Report.php');
-try {
- $options = array(
- 'username' => 'testing',
- 'password' => 'password'
- );
+$options = array(
+ 'username' => 'testing',
+ 'password' => 'password'
+);
+
+$ssrs = new SSRS_Report('http://localhost/reportserver/', $options);
+$results = $ssrs->listRenderingExtensions();
- $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 '<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 '<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>';
- 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
+echo '</table>'; \ No newline at end of file
diff --git a/samples/LoadReport.php b/samples/LoadReport.php
index c33c3af..58910b3 100755
--- a/samples/LoadReport.php
+++ b/samples/LoadReport.php
@@ -1,23 +1,17 @@
<?php
-require('../library/SSRS/Report.php');
-try {
- $options = array(
- 'username' => 'testing',
- 'password' => 'password'
- );
+require('../library/SSRS/Report.php');
- $ssrs = new SSRS_Report('http://localhost/reportserver/', $options);
- $result = $ssrs->loadReport('/Reports/Reference_Report');
+$options = array(
+ 'username' => 'testing',
+ 'password' => 'password'
+);
- $ssrs->setSessionId($result->executionInfo->ExecutionID);
- $ssrs->setExecutionParameters(new SSRS_Object_ExecutionParameters($result->executionInfo->Parameters));
+$ssrs = new SSRS_Report('http://localhost/reportserver/', $options);
+$result = $ssrs->loadReport('/Reports/Reference_Report');
- $output = $ssrs->render('HTML4.0'); // PDF | XML | CSV
- echo $output;
-} catch (Exception $error) {
- echo 'Exception:' . PHP_EOL;
- print_r($error);
+$ssrs->setSessionId($result->executionInfo->ExecutionID);
+$ssrs->setExecutionParameters(new SSRS_Object_ExecutionParameters($result->executionInfo->Parameters));
-}
-?>
+$output = $ssrs->render('HTML4.0'); // PDF | XML | CSV
+echo $output; \ No newline at end of file