2013-03-01 15 views
1

我正在嘗試獲取帶有子報表的SSRS報表以用作訂閱,但是失敗。這些報告在手動執行時工作正常。我想要做的事可能對訂閱來說太複雜,但這裏有一個總體思路:我可以通過參數將連接字符串傳遞給子報表並用作訂閱嗎?

我的主要報告中有一個非常簡單的查詢,它構建了一個數據庫列表。比方說,我總共有10個數據庫。我的主要報告查詢所有10個數據庫並返回每個數據庫的實際數據庫名稱。然後,主報告將每個數據庫名稱作爲參數傳遞給我的子報表。

子報表通過下面的連接字符串中使用每個數據庫名稱:="Data Source=sql-server-name;" & "Initial Catalog=" & Parameters!ParentID.Value

我遇到的問題是雙重的:

  1. 目前,我在創造我的主要訂閱收到錯誤報告。我收到的錯誤消息是Subscriptions cannot be created because the credentials used to run the report are not stored, or if a linked report, the link is no longer valid.我已經嘗試指定報告服務器上可用的每種可用身份驗證方法,包括「安全存儲的憑證」,Windows集成安全性等。
  2. 有一次,我創建了訂閱,但是當訂閱試圖運行併發送電子郵件時,我收到的錯誤消息是:The current action cannot be completed. The user data source credentials do not meet the requirements to run this report or shared dataset. Either the user data source credentials are not stored in the report server database, or the user data source is configured not to require credentials but the unattended execution account is not specified. (rsInvalidDataSourceCredentialSetting)。爲了解決這個問題,我最近嘗試在建議here之後創建一個「無人蔘與的執行帳戶」,但無法證明它是否有效,因爲目前我無法修改我的訂閱以安排測試(由於問題#1)。

我可以通過參數將連接字符串傳遞給子報表,並將主報表作爲訂閱執行嗎?如果是這樣,怎麼樣?

+0

通常,報告需要使用主報告和所有子報告中所有數據源的存儲憑據。傳遞基於表達式的連接字符串作爲參數應該沒問題。 – user1578107 2013-03-02 00:52:15

回答

0

而不是使用連接字符串,首選的方法是使用內置的操作選項轉到子報表。在屬性中,轉到操作並選擇「轉到報告」。一旦你指定了一個報告,你可以添加一個參數列表來發送。您甚至可以使用函數來確定要傳遞的值。

相關問題