Asked  8 Months ago    Answers:  5   Viewed   48 times

I'm using SSRS SDK for PHP

PHP Version 5.4

WebServer: Centos 6.4

MSSQL Server 2008 R2

When I make

$ssrs_report = new SSRSReport(new Credentials(UID, PASWD), SERVICE_URL);

I got the following error

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: 
Couldn't load from 'http://172.16.4.63/ReportServerURL/Pages/ReportViewer.aspx?%2fTestFolder%2ftestClaimHdr&rs:Command=Render/ReportExecution2005.asmx?wsdl' : 
Premature end of data in tag html line 1 in /var/www/emilio/app/Libraries/SSRSReport/bin/SSRSReport.php:196 

Stack trace: #0 /var/www/emilio/app/Libraries/SSRSReport/bin/SSRSReport.php(196): 
SoapClient->SoapClient('http://172.16.4...', Array) #1 /var/www/emilio/SSRS/index.php(12): 
SSRSReport->SSRSReport(Object(Credentials), 'http://172.16.4...') #2 {main} thrown in 
/var/www/emilio/app/Libraries/SSRSReport/bin/SSRSReport.php on line 196

I'm looking how to fix it and get the report trough the soap(SSRS SDK for PHP).

I tried using file_get_content() and curl and both worked fine, then isn't connection problems, I have

  • Soap Client enabled
  • allow_url_fopen is On

this is the line where the sdk call the soap service

$executionServiceUrl="http://172.16.4.63/ReportServerURL?%2fTestFolder%2ftestClaimHdr&rs:Command=Render/ReportExecution2005.asmx?wsdl";
$options = array ( 'login' => 'xxxx\xxxx', 'password' => 'xxxx', )

$this->_soapHandle_Exe = new SoapClient($executionServiceUrl, $options);

Adding

 try {
  $this->_soapHandle_Exe = new SoapClient($executionServiceUrl, $options);
} catch (Exception $e) {
  var_export(libxml_get_last_error());
}

I get the following array:

LibXMLError::__set_state(array(
      'level' => 3,
      'code' => 77,
      'column' => 43325,
      'message' => 'Premature end of data in tag html line 1',
      'file' => 'http://172.16.4.63/ReportServerURL?%2fTestFolder%2ftestClaimHdr&rs:Command=Render/ReportExecution2005.asmx?WSDL',
      'line' => 1,
)

According to xmlerror from libxml2

level 3 = XML_ERR_FATAL = 3 : A fatal error

code 77 = XML_ERR_TAG_NOT_FINISHED = 77 : 77

I have alredy set the Basic authentication in the SSRS SERVER

Update

As @jwhaley58 said I changed to:

define("SERVICE_URL", "http://172.16.4.63/ReportServerURL");
$ssrs_report = new SSRSReport(new Credentials(UID, PASWD), SERVICE_URL);
$ssrs_report->LoadReport2('testClaimHdr',NULL);

and I get:

Fatal error: Uncaught exception 'SSRSReportException' in 
/var/www/emilio/app/Libraries/SSRSReport/bin/SSRSReport.php:590 Stack trace: #0 
/var/www/emilio/app/Libraries/SSRSReport/bin/SSRSReport.php(326): 
SSRSReport->ThrowReportException(Object(SoapFault)) #1 /var/www/emilio/SSRS/index.php(15): 
SSRSReport->LoadReport2('testClaimHdr', NULL) #2 {main} thrown in 
/var/www/emilio/app/Libraries/SSRSReport/bin/SSRSReport.php on line 590

 Answers

61

Some gochas that I only found through trial and error are some configuration issues, on the server that is running the reporting server service, make sure that in your file rsreportserver.config has been modified to allow for basic authentication. By default, if I'm understanding it correctly, it wants a more trustworthy connection type, but the sdk needs you to allow simple name and passwords to be passed. This means that needs to be added to your authentication methods in the configuration.

so for example,

In C:Program FilesMicrosoft SQL ServerMSRS11.1Reporting ServicesReportServerrsreportserver.config (Different for server and version, but you get the idea.)

<Authentication>
    <AuthenticationTypes>
        <RSWindowsNTLM/>
        <RSWindowsBasic/> ##you need to add this one##
    </AuthenticationTypes>
    <RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel>
</Authentication>

IIRC you will have to restart the service for this to take effect.

Also, if you are attempting to RenderAs, some of the template files used to pop the headers have space in them towards the bottom that will prevent you from rendering as Excel, PDF, ect unless that has been fixed since I worked on it.

I'm looking through the code you provided, I may be reading it wrong, but it looks like you are trying to explicitly define the report you're after in the execution url. If that is in fact what you are doing, I believe the fix would be to only define the report base you are connecting to so for your example the url should be http://172.16.4.63/ReportServer/. After that connection is made, you would use the LoadReport2 function to specify which report you need.

Lastly, Where you have the name of the report, it looks like you have a subdirectory called testfolder? if that is still the case, you would need your report name to be "/TestFolder/testClaimHdr" in the call to LoadReport2.

Hope any of that helps.

Wednesday, March 31, 2021
 
jakubos
answered 8 Months ago
44

Port 8080 on that host seems to be closed, that will be the problem. Contact them.

Actually, try using a proxy server like this:

$client = new SoapClient(“http://someaddress?WSDL”, array(‘proxy_host’ => “example.proxy.com”,’proxy_port’ => portnumber));
Saturday, May 29, 2021
 
samayo
answered 5 Months ago
79

Create functions in the code under the report properties:

Page Number:

Function PageNumber() As String    
    Return Me.Report.Globals!PageNumber    
End Function

Total Pages:

Function TotalPages() As String   
    Return Me.Report.Globals!TotalPages    
End Function

Access it in the body via an expression:

=code.PageNumber & " of " & code.TotalPages

Check out Sample Usage of the Concat Function

Saturday, July 3, 2021
 
borrible
answered 4 Months ago
33

The trouble was solved. In fact when I had so errors using WAMP(orange icon) I decided to set it up again.

So I installed the newest version of WAMP but there was no the same php.ini as I used previously and in fact the trouble was that on the php.ini I had to make active the line ;extension=php_openssl.dll

so I just removed the ;character and this line has become like extension=php_openssl.dll

Now it works fine.

Friday, August 13, 2021
 
Shurmajee
answered 3 Months ago
86

The missing dates in your data is causing the issues with the background row color not working correctly.

You can waste lots of time trying to make your query work.

Or you could just use the Alternating Row Color function.

Private bOddRow As Boolean
'*************************************************************************
' -- Display green-bar type color banding in detail rows
' -- Call from BackGroundColor property of all detail row textboxes
' -- Set Toggle True for first item, False for others.
'*************************************************************************
Function AlternateColor(ByVal OddColor As String, _
         ByVal EvenColor As String, ByVal Toggle As Boolean) As String
    If Toggle Then bOddRow = Not bOddRow
    If bOddRow Then
        Return OddColor
    Else
        Return EvenColor
    End If
End Function

For the first column that controls the color:

=Code.AlternateColor("AliceBlue", "White", True)

For the remaining columns, don't toggle with the third argument:

=Code.AlternateColor("AliceBlue", "White", False)

You may need to switch the colors in the first column in a matrix.

SSRS Alternating row color issues when some rows are not visible

Saturday, August 28, 2021
 
Mashhadi
answered 2 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :
 
Share