管理報告 2012 數據超市整合錯誤「索引超出範圍」

本文提供當您使用 Management Reporter 2012 數據超市與 Microsoft Dynamics GP 整合時,索 引超出範圍 錯誤問題的解決方法。

適用於: Microsoft Management Reporter 2012,Microsoft Dynamics GP
原始 KB 編號: 3029952

徵狀

下列錯誤訊息可能會出現在維度值工作的 Management Reporter Dynamics GP Data Mart 整合中:

DimensionValueProvider 到維度值:錯誤文字:索引超出範圍。 必須是非負數且小於集合的大小。

此外,裝載Management Reporter 服務之伺服器上的事件查看器會在 Windows 應用程式記錄中顯示下列錯誤詳細數據。

索引超出範圍。 必須是非負數且小於集合的大小。
參數名稱:索引
---例外狀況傾印---
攔截到的例外狀況:[System.ArgumentOutOfRangeException] 索引超出範圍。 必須是非負數且小於集合的大小。
參數名稱:索引

堆疊追蹤:
at Microsoft.Dynamics.Performance.Integration.Reporting.Adapter.GP.DimensionValueProvider.CreateGLDimensionValueFromReader (SqlDataReader reader, Company cmp)
位於 Microsoft.Dynamics.Performance.Integration.Reporting.Adapter.GP.DimensionValueProvider。<ReadObjects>d__0.MoveNext ()
at Microsoft.Dynamics.Integration.Service.Tasks.MapWork.ProcessRecordsImplementation (OperationType operationType)

當您嘗試開啟建置組塊或產生報表時,也會發生此錯誤訊息。

原因

如果 Microsoft Dynamics GP 應用程式資料庫的帳戶區段數據表 (GL40200) 中沒有帳戶設定資料表 (SY00300) 或帳戶索引數據表中 (GL00100) 的帳戶參考,就會發生此錯誤。

解決方案

注意事項

遵循本文中的指示之前,請確定您有可在發生問題時還原的資料庫完整備份複本。

  1. 在 SQL Management Studio 中針對 Microsoft Dynamics GP 公司資料庫執行下列查詢,以識別無效的帳戶區段:

    select * from GL40200 where SGMTNUMB not in (select SGMTNUMB from SY00300)
    select * from GL40200 where SGMTNUMB=1 and SGMNTID not in (select distinct ACTNUMBR_1 from GL00100)
    select * from GL40200 where SGMTNUMB=2 and SGMNTID not in (select distinct ACTNUMBR_2 from GL00100)
    select * from GL40200 where SGMTNUMB=3 and SGMNTID not in (select distinct ACTNUMBR_3 from GL00100)
    select * from GL40200 where SGMTNUMB=4 and SGMNTID not in (select distinct ACTNUMBR_4 from GL00100)
    

    視區段數目而定,您可能需要調整 語句。

  2. 在 SQL 中執行下列語句,以從GL40200數據表中刪除不正確的記錄:

    delete GL40200 where SGMTNUMB not in (select SGMTNUMB from SY00300)
    delete GL40200 where SGMTNUMB=1 and SGMNTID not in (select distinct ACTNUMBR_1 from GL00100)
    delete GL40200 where SGMTNUMB=2 and SGMNTID not in (select distinct ACTNUMBR_2 from GL00100)
    delete GL40200 where SGMTNUMB=3 and SGMNTID not in (select distinct ACTNUMBR_3 from GL00100)
    delete GL40200 where SGMTNUMB=4 and SGMNTID not in (select distinct ACTNUMBR_4 from GL00100)
    
  3. 從GL40200表移除記錄之後,請在 Microsoft Dynamics GP 的帳戶主機上執行檢查連結:

    1. 取 [Dynamics GP],然後選取 [ 維護] ,然後選取 [檢查連結]
    2. 選取 [財務 系列]。 選 取 [帳戶主機],選取 [插入 ],然後選取 [ 確定]
  4. 在更正帳戶區段之後,重新設定 Management Reporter Data Mart 與新數據超市資料庫的整合。

    注意事項

    所有步驟都必須由指派給管理報告安全性系統管理員角色的網域使用者完成,該使用者也是伺服器上本機 Administrators 群組的成員

    1. 開啟 Management Reporter 組態主控台。

    2. 選取 [ERP 整合] 下的 GP 整合。

    3. 取 [停用整合]

    4. 右上角的 [移除] 以移除整合。

    5. 結束組態主控台。

    6. 啟動 SQL Server Management Studio。

    7. 備份 Management Reporter 資料庫。

    8. 將數據超市備份 (通常是 DDM 或 ManagementReporterDM) 資料庫。

    9. 刪除數據超市資料庫。

    10. 開啟組態主控台。

    11. 停止 Management Reporter 2012 Process Service。

    12. 停止 Management Reporter 2012 應用程式服務。

    13. 啟動Management Reporter 2012 應用程式服務。

    14. 啟動 Management Reporter 2012 Process Service。

    15. 取 [檔案 ],然後選取 [ 設定]

    16. 取 [新增 Microsoft Dynamics GP Data Mart]

    17. 請遵循 Microsoft Dynamics GP 提供者的步驟,

      Microsoft Dynamics ERP 管理報告 2012:安裝、移轉和設定指南

    18. 當您完成時,請在組態控制台中選 取 [啟用整合 ]。