在報表開發過程中,經常會遇到各種各樣的問題,比如The report cannot be displayed. (rsProcessingAborted),一點有意義的提示都沒有;再就是分頁問題,經常我們想把一條記錄放在一頁,下一條記錄另起一頁,而不是緊連在上一條記錄的后面;有時我們還會出現上傳報表時報錯:An error occurred while trying to add the report to Microsoft Dynamics CRM. Try adding the report again. If this problem persists, contact your system administrator,也是沒有什么提示;有時需要導出excel時指定sheet名。下面分別介紹這幾個常見的錯誤怎么解決。
一、每條數據沒有顯示在一頁,下一條記錄的頭部緊連着上一條記錄
有時想每條記錄顯示在一行,選中整個Tablix,在里面設置分頁,怎么都不行:
實際上上面的設置是所有行前面,或后面加page break。應該在group上設置就行了:
最終效果,每頁都是一條新的記錄:
二、運行報表報錯:The report cannot be displayed. (rsProcessingAborted)
這個錯誤可能是出現最多的一個錯誤了
首先檢查下是不是查詢語句里的表沒有用filteredXXX開始, 參考《Dynamic CRM 2013學習筆記(十五)報表入門、開發工具及注意事項》;
如果還報錯,再檢查權限:
1. 打開sql server management studio;
2. 展開security->logins;
3. 右健點擊 運行sql server reporting service的帳號 (例如PrivReportingGroup , ReportingGroup);
4. 選中User Mapping –> YourOrg_MSCRM database,指定下面的權限
問題解決
三、上傳報表報錯
有時上傳報表時,報這種錯誤:An error occurred while trying to add the report to Microsoft Dynamics CRM. Try adding the report again. If this problem persists, contact your system administrator
一般情況下,如果不是網絡有問題,就是報表本身有問題,可以先在report builder里運行下,沒問題了再上傳
四、導出excel時指定sheet名
如圖所示,設置PageName即可:
這樣導出excel時,sheet的名就有了: