SSRS doesn't honor the CanGrow Property when Exporting to Excel

独自空忆成欢 提交于 2019-12-05 03:23:36

I've found that instead of removing any elements before the tablix, you can change their width to match that of the page.

I found the solution of the same problem! :) Set the "CanGrow" Property to False for all cells from one row. And also set the "Height" Property to your specific size.

This is how the Report Viewer's Excel renderer works. You cannot change the way it exports the excel file, however, there are other ways to resolve your issue.

  1. Write your own Excel Renderer (not a good idea -- time consuming)
  2. Fix the column widths before exporting
  3. After exporting to Excel, edit the Excel file via COM calls

My suggestion is #2 -- You can load the RDLC file in memory, and do your modifications there, then call the ReportViewer export function for that altered report.

If you have elements before your tablix this can stop the growth. I've found that removing all elements before the tablix will restore the desired row-growth/auto-fit behaviour. I have not found a better solution yet.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!