2013年8月21日 星期三

[學習] RDLC原生導出Excel之功能, 發生「忽略資料表/矩陣資料格中的子報表」

問題:
Subreports within table/matrix cells are ignored.
忽略資料表/矩陣資料格中的子報表

ReportViewer導出EXCEL時:(PDF則不會...)


解決:(就是不要把子報表放入Table或Matrix裡)
I created a List, placed the main table from the primary report in the list.
Below the table, but inside the List I placed the subreport.
Because the subreport is not inside the table, it will render in Excel.
RDLC原本設計
紅框:List
綠框:Table
黃框:SubReport

RDLC解決設計
最外框:List
紅框:Table1
楬框:SubReport
黃框:Table2
需要注意Table1底線(Bottom)與SubReport頂線(Top)不可重疊
同上SupReport的底線(Bottom)與Table2的頂線(Top)不可重疊

解決後導出EXCEL的結果:
(若導出PDF, 則當sub-report沒資料時, tb1與tb2之間的sub-report會消失,
故會畫二條的黑線[tb1的bottomBorderLine+tb2的topBorderLine], 比原本圖示的黑線約2倍,
這是因為tb1與subReport的距離隔0.001+SubRerpot與tb2的距離隔0.001)
若有發生如上之問題, 則把距離隔弄小就不會了!


不管用LIST/矩形,呈現上還是有缺陷
報表最佳呈現解法:先將資料預先處理好,在丟進到報表

參考:(用LIST or 矩形...)
VS2008
RDLC 9.0.0.0
如何在ReportingService報表樣板檔中嵌入子報表,卻又能匯出成Excel?
Reporting Services子報表導出EXCEL問題
rdlc 报表 矩阵 详解 分组、总计、表头、显示方向、序号
rdlc导出Excel时 显示"忽略表/矩阵单元内的数据区域
报表显示时列名显示忽略表/矩阵单元内的数据区域
RDLC SubReports Exporting to Excel Are Ignored
匯出至 Microsoft Excel (報表產生器 3.0 和 SSRS)
Reporting Service Export to Excel Problem
Subreports within table/matrix cells are ignored.

May try for tools to convert PDF to excel format.

Drop the table control from rdlc and Put your main report data into matrix control and put your sub reports below to maix control. Run your report and export again.It will be solved.

To be able to export SRS reports using Sub-reports to Excel, it is advisable to use List controls instead of Data Table. Once you have made this little change, the export to excel is just perfect. Infact it will automatically even freeze the rows in the page header so that when you scroll through the data that was included in the report header stays static.

第三方Dll檔_Aspose.Cells for Reporting Services

沒有留言:

張貼留言