简体   繁体   English

导出到Excel时,SSRS不支持CanGrow属性

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

I have a Table in an SSRS report. 我在SSRS报告中有一个表格。 one of the Table Cells contains the Descriptions of Parts in an order. 表单元格之一按顺序包含“零件说明”。 these descriptions could vary in length and for that reson i have set the "CanGrow" Property to True. 这些描述的长度可能会有所不同,为此,我将“ CanGrow”属性设置为True。 when i try to export the report to Excel im expecting that if the text length would exceed the width of the Cell then the height of the cell would grow and the whole text would be shown. 当我尝试将报告导出到Excel时,我期望如果文本长度超过单元格的宽度,那么单元格的高度就会增加,并且整个文本都会显示出来。 Unfortunately the SSRS Excel Generator keeps the height as is and so only the part of the text which fits the width of the cell would be shown. 不幸的是,SSRS Excel Generator保持高度不变,因此仅显示适合单元格宽度的文本部分。

i would appreciate any help or input to solve this problem. 我将不胜感激以帮助您解决此问题。 Thanks 谢谢

I found the solution of the same problem! 我找到了相同问题的解决方案! :) Set the "CanGrow" Property to False for all cells from one row. :)将一行中的所有单元格的“ CanGrow”属性设置为False。 And also set the "Height" Property to your specific size. 并将“高度”属性设置为您的特定大小。

我发现,您可以更改其宽度以匹配页面的宽度,而不是除去Tablix之前的任何元素。

This is how the Report Viewer's Excel renderer works. 这就是报表查看器的Excel渲染器的工作方式。 You cannot change the way it exports the excel file, however, there are other ways to resolve your issue. 您无法更改导出excel文件的方式,但是,还有其他方法可以解决您的问题。

  1. Write your own Excel Renderer (not a good idea -- time consuming) 编写自己的Excel Renderer(不是一个好主意-费时)
  2. Fix the column widths before exporting 导出前固定列宽
  3. After exporting to Excel, edit the Excel file via COM calls 导出到Excel后,通过COM调用编辑Excel文件

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. 我的建议是#2-您可以将RDLC文件加载到内存中,然后在其中进行修改,然后为更改后的报表调用ReportViewer导出功能。

If you have elements before your tablix this can stop the growth. 如果您在Tablix之前有元素,这可以阻止增长。 I've found that removing all elements before the tablix will restore the desired row-growth/auto-fit behaviour. 我发现在tablix之前删除所有元素将恢复所需的行增长/自动调整行为。 I have not found a better solution yet. 我还没有找到更好的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM