2012-04-30 36 views
1

我一直參與部署SSRS SDK(http://ssrsphp.codeplex.com)以訪問Reporting Services一段時間。但是,無論我使用的教程,博客,工作示例如何,都使用「帶有高級服務版本的SQL Server 2008 Express」。該版本僅支持此SDK。SSRS SDK是否支持SQL Server 2008(我的意思是非快速版)?

目前我正在使用SQL Server 2008(不是快速版)。而我的一切到現在是這樣的: -

Failed to connect to Reporting Service 
Make sure that the url (http://localhost:80/reportServer/) and credentials are correct! 

爲代碼: -

<?php require_once 'SSRSReport.php'; 
try{ 
    $ssrs_report = new SSRSReport(new Credentials(UID, PASWD), SERVICE_URL); 
}catch (SSRSReportException $serviceException){ 
    echo $serviceException->GetErrorMessage(); 
}?> 

雖然我已經正確安裝報告在我的機器服務器,也是我的憑據是正確的;但我無處可去。

回答

0

發現在企業版中使用SSRSPHP是可行的。當代碼嘗試查看Web服務URL是否正常時,此庫始終會拋出異常。請參見下面的SSRSReport.php線開始在195線:

$context = stream_context_create($stream_conext_params); 
$content = @file_get_contents($executionServiceUrl, false, $context); 
if ($content === FALSE) 
    { 
     throw new SSRSReportException("", 
        "Failed to connect to Reporting Service <br/> Make sure " . 
        "that the url ($this->_BaseUrl) and credentials are correct!"); 
    } 

你看這個異常的「無法連接到報告服務......」似乎所有的時間,我和其他人。這是不可修復的錯誤。我可以解釋這一點,但它不是正確的時間。只要讓它像下面這樣工作就完成了。

$context = stream_context_create($stream_conext_params); 
$content = @file_get_contents($executionServiceUrl, false, $context); 
if ($content === FALSE) 
{ 
    //throw new SSRSReportException("", 
     //   "Failed to connect to Reporting Service <br/> Make sure " . 
     //  "that the url ($this->_BaseUrl) and credentials are correct!"); 
} 

它的工作,真的!這一直在爲我工作。我希望你也能做到。

0

有幾件事情可以進行。

你能直接通過URL訪問http://localhost:80/reportServer/嗎?它會提示您輸入用戶名\密碼嗎?您的SSRS實例是否被稱爲默認?

+0

我已經有了SSRS的工作版本。穩定的Aspx項目已經存在以提取報告;但這裏的問題是如果SQL Server 2008(非快速版)允許SSRS SDK與它一起工作。我認爲這是不允許的;沒有得到具體的推理;所以向社區提出了這個問題。感謝您的回覆 –

+0

順便說一下,我可以通過URL直接訪問http:// localhost:80/reportServer /;密碼提示出現在課程中;因爲我已經使用Windows驗證SSRS –

+0

爲什麼你的意思是由SDK?如果您使用的是PHP,您唯一可以通過代碼與SSRS進行交互的選項是URL訪問或SOAP。你能更具體地說明你如何去做這件事嗎? – Diego

1

您還可以放入位於「:\ Program Files \ Microsoft SQL Server \ MSRS11.MSSQLSERVER \ Reporting Services \ ReportServer」中的rsreportserver.config文件的身份驗證類型。

<Authentication> 
    <AuthenticationTypes> 
     <RSWindowsNTLM/> 
     <RSWindowsBasic/> 
    <AuthenticationTypes> 
<Authentication> 

reference

+0

感謝您的建議。由於該庫SSRSPHP使用基本HTTP身份驗證,因此必須在配置中配置。 –

+0

@MrigeshRajShrestha你可以標記它是正確的,所以每個人都可以看到它 –

+0

背後的真正原因是SSRSPHP庫本身的問題。所以這是相關的,但不是正確的答案 –

相關問題